Warns when using crypto.randomUUID() inside Effect generators instead of SecureRandom from effect/crypto
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v4 |
| Diagnostic codes | TS377079 |
| Language Service name | cryptoRandomUUIDInEffect |
| Oxlint name | effecttsgo/crypto-random-uuid-in-effect |
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 `SecureRandom` from `effect/crypto` instead.
*/
})See the Language Service setup guide for installation instructions.
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"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "cryptoRandomUUIDInEffect": "warning" } } ] } }