Suggests using Effect.forEach instead of Effect.all over an effectful Array#map
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377113 |
| Language Service name | allOfMapToForEach |
| Oxlint name | effecttsgo/all-of-map-to-for-each |
import { Effect } from "effect"
declare const values: ReadonlyArray<number>
export const program = Effect.all(
/**
^^^^^^^^^^ effecttsgo(all-of-map-to-for-each): `Effect.forEach` expresses this effectful array mapping more directly than `Effect.all` over `Array#map`.
*/
values.map((value) => Effect.succeed(value + 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/all-of-map-to-for-each": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "allOfMapToForEach": "warning" } } ] } }