@systemfsoftware/oxlint-plugin-effect-platform 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @systemfsoftware/oxlint-plugin-effect-platform
2
2
 
3
- # @systemfsoftware/oxlint-plugin-effect-platform@2.2.0
3
+ # @systemfsoftware/oxlint-plugin-effect-platform@3.0.0
4
4
 
5
- `runtime-construction-placement` reports a factory that builds a fresh `ManagedRuntime` per call even when its returned closures capture it, and no longer reports `Layer.provide`, which composes a Layer graph and builds no runtime. Its fix message names `Layer.build` in the owner's scope for wiring that belongs to an object with its own lifetime.
5
+ `no-die-on-service-option` reports an `Effect.serviceOption` read whose own `None` branch reaches a defect — `Effect.die`, `Effect.failCause(Cause.die(...))`, `throw`, `Option.getOrThrow`/`Option.getOrThrowWith`, or `Effect.orDie` over an `Effect.fromOption` of the read — and is enabled at `error` in the recommended preset. Optional reads that fall back, skip the work, or fail with a typed error keep passing. A consumer of the recommended preset must fix such reads in the change that takes this release: put the dependency back in the requirement type with `yield* Tag`, or handle absence with a fallback, a skip, or `Effect.fail`.
6
+
7
+ New rule `node-runtime-needs-engines` reports code that reaches the Node runtime directly (a Node builtin import, a Node global such as `process` or `Buffer`, a static `globalThis` or `Reflect.get` key naming one, or `import.meta.dirname`/`filename`/`resolve`) in a package whose nearest `package.json` declares no `engines.node`, and reports an `engines.node` that is not `^M.m.p` or `>=M.m.p` clauses joined by `||`. Test files are exempt except in a private package. The plugin's own recommended preset does not enable it.
8
+
9
+ Declares the Node.js lines it supports in `engines.node`: 22, 24 and 26 and later, each from the lowest release its runtime dependencies accept. A package manager with engine checks enabled now warns or refuses on an unsupported Node.
package/README.md CHANGED
@@ -67,6 +67,7 @@ All six rules are in the recommended set, so the spread enables them at `error`.
67
67
  | `entrypoint-no-promise-wrapper` | `runMain(Effect.tryPromise(...))` or `runMain(Effect.promise(...))`: the outer edge awaits a promise while the real fibers run in a runtime it cannot interrupt |
68
68
  | `runtime-construction-placement` | `ManagedRuntime.make` inside a function body — a runtime built per call that nothing finalizes — and `ManagedRuntime.make` at module scope, where importing the module starts fibers nothing can interrupt. It judges runtime code: a file under a `src/` directory segment, or a `*.test.ts` file; a package-root hook, config, or setup file is outside its subject |
69
69
  | `no-unported-time-source` | A direct `Date.now`, `performance.now`, `process.hrtime`, `Math.random`, `crypto.getRandomValues`, `crypto.randomUUID`, `setTimeout`, `setInterval`, or `setImmediate` call, an argument-less `new Date()`, or a static or dynamic import of `node:timers` in production source outside a file listed in the rule's `ports` option |
70
+ | `no-die-on-service-option` | An `Effect.serviceOption` read whose own None branch reaches a defect: `Effect.die`, `Effect.failCause(Cause.die(…))`, `throw`, `Option.getOrThrow*`, or `Effect.orDie` over `Effect.fromOption` of the read. The read removes the service from the requirement type, so a defect on absence passes typecheck and fails only at runtime |
70
71
 
71
72
  What the placement rule leaves alone, each a shape the rule's own fixtures pin:
72
73
 
@@ -88,6 +89,15 @@ What the time-source rule leaves alone, each a shape the rule's own fixtures pin
88
89
  - A file listed in the rule's `ports` option, matched by repo-relative path or path suffix: the recommended config registers `packages/atom/effect-atom/src/internal/HostTimer.ts` and `packages/schema/effect-schema-law/src/recursion-laws.ts`.
89
90
  - Test and fixture files (`.test.ts`, `.spec.ts`, `__tests__/`, `__fixtures__/`, `tests/`, `testResources/`): the regime binds production code.
90
91
 
92
+ What the service-option rule leaves alone, and what it cannot see:
93
+
94
+ - A None branch that returns a fallback, skips the work, or fails with a typed error (`Effect.fail`, `Effect.fromOption(() => new E())` not wrapped in `Effect.orDie`).
95
+ - A defect reachable only when the read is Some, or elsewhere in the function and not on the read's None path.
96
+ - A fallback object whose methods die: the walk stops at a nested function, except a generator passed to `Effect.gen`, or an `Effect.fn` that is itself the handler.
97
+ - Not seen: a module-level stub that dies indirectly, returned from the None branch of a read in another function; an `Option` returned from a helper and crashed by its caller; absence mapped to `undefined` and then crashed; `Effect.orDie` wrapped around the read rather than after it. These need typed entry points and a test at the invocation boundary.
98
+
99
+ There is no option, allowlist or disable comment. A service that must be present goes back into the requirement type with `yield* Tag`; code implementing a framework interface that fixes its requirement type takes the value as a construction argument instead.
100
+
91
101
  ## FAQ
92
102
 
93
103
  **Q: Installed, but nothing is reported.**
package/dist/index.d.ts CHANGED
@@ -10,10 +10,12 @@ declare const _default: {
10
10
  'entrypoint-not-imported': import("@oxlint/plugins").Rule;
11
11
  'entrypoint-no-promise-wrapper': import("@oxlint/plugins").Rule;
12
12
  'runtime-construction-placement': import("@oxlint/plugins").Rule;
13
+ 'no-die-on-service-option': import("@oxlint/plugins").Rule;
13
14
  'no-logging-in-catch': import("@oxlint/plugins").Rule;
14
15
  'no-native-map-in-effect': import("@oxlint/plugins").Rule;
15
16
  'no-native-set-in-effect': import("@oxlint/plugins").Rule;
16
17
  'no-new-worker-with-wasm-import': import("@oxlint/plugins").Rule;
18
+ 'node-runtime-needs-engines': import("@oxlint/plugins").Rule;
17
19
  'no-unported-time-source': import("@oxlint/plugins").Rule;
18
20
  };
19
21
  configs: {