Suggests Effect Array APIs for native array member references, with semantic caveats
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377140 |
| Language Service name | preferEffectArray |
| Oxlint name | effecttsgo/prefer-effect-array |
import * as A from "effect/Array"
const values = [1, 2, 3]
export const native = values.find(n => n > 1)
/**
^^^^ effecttsgo(prefer-effect-array): Consider effect/Array.findFirst instead of native Array.find. Returns Option, with None replacing undefined; the callback type accepts (value, index), with no array parameter or thisArg.
*/
export const preferred = A.findFirst(values, n => n > 1)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-array": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "preferEffectArray": "warning" } } ] } }