Warns when importing Node.js built-in modules that have Effect-native counterparts
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377057 |
| Language Service name | nodeBuiltinImport |
| Oxlint name | effecttsgo/node-builtin-import |
import { Effect } from "effect"
import { randomUUID } from "node:crypto"
/**
^^^^^^^^^^^^^ effecttsgo(node-builtin-import): This module reference uses the `crypto` module, the corresponding Effect API is `crypto` from `effect`.
*/
import fs from "node:fs"
/**
^^^^^^^^^ effecttsgo(node-builtin-import): This module reference uses the `fs` module, the corresponding Effect API is `FileSystem` from `effect`.
*/
export const preview = Effect.sync(() => ({
id: randomUUID(),
contents: fs.readFileSync("config.json", "utf8")
}))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/node-builtin-import": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "nodeBuiltinImport": "warning" } } ] } }