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
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v4 |
| Diagnostic codes | TS377078 |
| Language Service name | cryptoRandomUUID |
| Oxlint name | effecttsgo/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"
}
}