Suggests Effect String APIs for native String method invocations, with semantic caveats
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377150 |
| Language Service name | preferEffectString |
| Oxlint name | effecttsgo/prefer-effect-string |
import * as Str from "effect/String"
const email = "[email protected]"
export const native = email.indexOf("@")
/**
^^^^^^^ effecttsgo(prefer-effect-string): Consider effect/String.indexOf instead of native String.indexOf. Returns Option<number>, with None replacing -1; there is no position parameter.
*/
export const preferred = Str.indexOf("@")(email)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-string": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "preferEffectString": "warning" } } ] } }