cryptoRandomUUID

August 4, 2026 ยท View on GitHub

Warns when using crypto.randomUUID() outside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes

PropertyValue
CategoryEffect-native
Default severityoff
FixableNo
Effect versionsv4
Diagnostic codesTS377078
Language Service namecryptoRandomUUID
Oxlint nameeffecttsgo/crypto-random-uuid

Preview

export const preview = crypto.randomUUID()
/**
                       ^^^^^^^^^^^^^^^^^^^ effecttsgo(crypto-random-uuid): This code uses `crypto.randomUUID()`, prefer the Effect `Random` module instead because it uses Effect-injected randomness rather than the `crypto` module behind the scenes.
*/

Language Service Configuration

See the Language Service setup guide for installation instructions.

{
  "$schema": "./node_modules/@effect/tsgo/schema.json",
  "compilerOptions": {
    "plugins": [
      {
        "name": "@effect/language-service",
        "diagnosticSeverity": {
          "cryptoRandomUUID": "warning"
        }
      }
    ]
  }
}

Oxlint Configuration

See the Oxlint setup guide for installation and patching instructions.

{
  "$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
  "options": {
    "typeAware": true
  },
  "plugins": ["effecttsgo"],
  "rules": {
    "effecttsgo/crypto-random-uuid": "warn"
  }
}