Minor Changes
-
13a46c9: The
deterministicKeysrule and the key completions now compute a key for files without apackage.json, or whose nearestpackage.jsonhas noname. The key is built as usual, but without the package name. The sub-directory segment is relative to thepackage.jsondirectory if one is found, otherwise to thetsconfig.jsondirectory, otherwise to the program's common source directory.Projects that enabled
deterministicKeyswithout apackage.jsonwill now see reports. This differs from the upstream@effect/language-service, which skips these files.{ "name": "@effect/language-service", "keyPatterns": [{ "target": "service", "pattern": "default" }] }// src/services/AuthService.ts, no package.json, tsconfig.json at the project root // reports: the expected key is `services/AuthService/MyService` export class MyService extends Context.Service<MyService, {}>()("MyService") {}
-
d8c489b: Add
errorPayloadShadowsNameto detect inlinenamepayload fields on Effect error classes. For example,Data.TaggedError("ToolNotFound")<{ name: string }>copies the payload'snameonto the error instance and hides the error type in logs. Rename the field totoolName. The rule inspects inline payloads only and allows a field whose value is the literal the error already uses as its name. -
13a46c9: Add an
"identifier"pattern tokeyPatternsfor thedeterministicKeysrule. With it, the expected key is the class name alone.{ "name": "@effect/language-service", "keyPatterns": [{ "target": "error", "pattern": "identifier" }] }// reports: the expected key is `KeybindingsConfigError` export class KeybindingsConfigError extends Data.TaggedError("KeybindingsConfigParseError")<{}> {}
-
b1ed4ba: Add
preferNamespaceImportandpreferBarrelImport, two diagnostics that report existing imports that contradict the import style configured withnamespaceImportPackagesandbarrelImportPackages. Auto-import already follows these options; the new rules also cover imports written by hand. Both are off by default and have no quick fix.preferNamespaceImportreports named imports from packages innamespaceImportPackages:// "namespaceImportPackages": ["effect"] import { Effect } from "effect" // expected: import * as Effect from "effect/Effect" import { map } from "effect/Array" // expected: import * as Array from "effect/Array" import { pipe } from "effect" // reported only with "topLevelNamedReexports": "follow"
preferBarrelImportreports imports of individual modules from packages inbarrelImportPackages:// "barrelImportPackages": ["effect"] import * as Record from "effect/Record" // expected: import { Record } from "effect" import * as HttpClient from "effect/http/HttpClient" // expected: import { HttpClient } from "effect/http"
Both the rules and auto-import find a barrel from the package files, for any package, instead of from a built-in list of Effect paths. A module's barrel is the nearest
indexmodule above it that forwards it withexport * as Name, andNameis the import name used. Barrel files are read from disk when no file in the program imports them yet. Auto-import withbarrelImportPackagesuses the same lookup, so it no longer rewrites a module that no barrel forwards, and no longer rewrites an import that already comes from a barrel (such aspipefrom"effect") intoimport { effect } from "effect". -
b1ed4ba: Allow
namespaceImportPackages,barrelImportPackages,importAliases, andtopLevelNamedReexportsin per-fileoverrides. Auto-import, the import quick fixes, and thepreferNamespaceImportandpreferBarrelImportdiagnostics use the value resolved for the current file, and a scoped value replaces the base value.{ "namespaceImportPackages": ["effect"], "overrides": [{ "include": ["src/legacy/**/*.ts"], "options": { "namespaceImportPackages": [], "barrelImportPackages": ["effect"] } }] }
Patch Changes
-
61eb79c: Compute Effect diagnostics with less work. Rules and the type parser now test node kinds, shapes and argument counts before they query types, symbols or signatures, and they compute types only for steps that can still report:
IsNodeReferenceToModuleExportanswers symbols with no declaration in the requested module from a per-symbol bitmask instead of a per-symbol map.DataFirstOrLastCallchecks the cached signature shape before it types call arguments, and caches its result per call.missedPipeableOpportunity,catchDieToOrDieandpreferTypedSchemaDecodertype piping-flow steps only when a step matches.- The
experimentalApiUsageandunstableApiUsagerules reuse their own symbol lookup instead of repeating it.
With every rule enabled,
tsc -bof the Effect monorepo drops from 33.9s to 32.1s (stock TypeScript-Go: 20.4s). The reported diagnostics are unchanged. -
cb5739d: Update the TypeScript next tag to
typescript@next, which shipstypescript-gocommitb5c34ba0c61a756c8abaf133236dddf982c27f45, and update the TypeScript latest tag totypescript@latest. Refresh the Oxlint configuration schema from the selected package.