cryptoRandomUUIDInEffect

September 8, 2026 ยท View on GitHub

Warns when using crypto.randomUUID() inside Effect generators instead of the Effect Crypto module

PropertyValue
CategoryEffect-native
Default severityoff
FixableNo
Effect versionsv4
Diagnostic codesTS377079
Language Service namecryptoRandomUUIDInEffect
Oxlint nameeffecttsgo/crypto-random-uuid-in-effect

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
  return crypto.randomUUID()
/**
         ^^^^^^^^^^^^^^^^^^^ effecttsgo(crypto-random-uuid-in-effect): This Effect code uses `crypto.randomUUID()`, prefer the Effect `Crypto` module instead.
*/
})

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": {
          "cryptoRandomUUIDInEffect": "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-in-effect": "warn"
  }
}