Suggests Effect Record APIs for native Object member references, with semantic caveats
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377143 |
| Language Service name | preferEffectRecord |
| Oxlint name | effecttsgo/prefer-effect-record |
import * as Record from "effect/Record"
const scores = { alice: 1, bob: 2 }
export const native = Object.entries(scores)
/**
^^^^^^^ effecttsgo(prefer-effect-record): Consider effect/Record.toEntries instead of native Object.entries. Requires a record rather than arrays or primitives; types entries with inferred keys and snapshots keys before reads, so getter or proxy mutations can change the result.
*/
export const preferred = Record.toEntries(scores)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/prefer-effect-record": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "preferEffectRecord": "warning" } } ] } }