@opsydyn/oxlint-effect 0.1.1 → 0.3.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/README.md +30 -1
- package/dist/index.mjs +785 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,11 +16,15 @@ import { recommended } from "@opsydyn/oxlint-effect";
|
|
|
16
16
|
|
|
17
17
|
export default defineConfig({
|
|
18
18
|
plugins: ["typescript"],
|
|
19
|
-
jsPlugins: recommended.jsPlugins,
|
|
19
|
+
jsPlugins: [...recommended.jsPlugins],
|
|
20
20
|
rules: recommended.rules,
|
|
21
21
|
});
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
`recommended.jsPlugins` is exported as a readonly tuple. Spreading it creates
|
|
25
|
+
the mutable array shape expected by Oxlint's `ExternalPluginEntry[]` config
|
|
26
|
+
type.
|
|
27
|
+
|
|
24
28
|
For local development inside this repository, point `jsPlugins` at the TypeScript source:
|
|
25
29
|
|
|
26
30
|
```ts
|
|
@@ -46,6 +50,8 @@ boundaries.
|
|
|
46
50
|
| --- | --- | --- |
|
|
47
51
|
| `linteffect/no-react-state` | React state hooks such as `useState`, `useReducer`, and `useEffect`. | Keeps React UI state in the atom/runtime model instead of bypassing it. |
|
|
48
52
|
| `linteffect/no-runtime-runfork` | `Runtime.runFork(...)`. | Detached fibers hide ownership, interruption, and lifecycle boundaries. |
|
|
53
|
+
| `linteffect/no-run-effect-outside-boundary` | Direct `Effect.runPromise`, `Effect.runSync`, `Effect.runFork`, and related `Effect.run*` calls. | Keeps Effect execution owned by app, CLI, worker, route, or test boundaries. |
|
|
54
|
+
| `linteffect/no-or-die-outside-boundary` | `Effect.orDie(...)`, `Effect.orDieWith(...)`, and pipe arguments such as `Effect.orDie`. | Prevents recoverable typed failures from being converted to defects inside domain logic. |
|
|
49
55
|
| `linteffect/prevent-dynamic-imports` | Dynamic `import(...)`. | Static imports keep dependency boundaries visible. |
|
|
50
56
|
| `linteffect/no-render-side-effects` | `Match.value(...).pipe(...)` used as a render-time statement. | Prevents side effects from running during render. |
|
|
51
57
|
| `linteffect/no-inline-runtime-provide` | Inline `Effect.provide(...)` inside local runtime/generator chains. | Keeps dependency assembly at service or application boundaries. |
|
|
@@ -58,11 +64,34 @@ boundaries.
|
|
|
58
64
|
| `linteffect/no-effect-do` | `Effect.Do`. | Avoids builder-style hidden sequencing. |
|
|
59
65
|
| `linteffect/no-effect-bind` | `Effect.bind(...)`. | Prefers direct `Effect.gen` or pipeline flow over builder state. |
|
|
60
66
|
| `linteffect/no-effect-async` | `Effect.async(...)`. | Manual callback bridges are easy to leak or resume incorrectly. |
|
|
67
|
+
| `linteffect/no-effect-ignore` | `Effect.ignore(...)` and pipe arguments such as `Effect.ignore`. | Makes ignored failures explicit at boundaries instead of burying failure ownership. |
|
|
61
68
|
| `linteffect/no-effect-never` | `Effect.never`. | Infinite effects should have explicit lifecycle and teardown ownership. |
|
|
62
69
|
| `linteffect/no-effect-fn-generator` | `Effect.fn(function* ...)`. | Avoids wrapper generators that obscure sequencing. |
|
|
63
70
|
| `linteffect/no-nested-effect-gen` | `Effect.gen` nested inside another `Effect.gen`. | Keeps generator-based effects linear. |
|
|
71
|
+
| `linteffect/no-yield-without-star-in-effect-gen` | Plain `yield` inside `Effect.gen`. | Requires `yield*` so generator steps delegate to the Effect interpreter. |
|
|
72
|
+
| `linteffect/no-async-effect-combinator-callback` | `async` callbacks passed to common Effect combinators. | Prevents Promise-returning callbacks from bypassing Effect error, interruption, and tracing semantics. |
|
|
73
|
+
| `linteffect/no-throw-in-effect-logic` | `throw` inside `Effect.gen` or common Effect combinator callbacks. | Keeps failures in typed Effect error channels. |
|
|
74
|
+
| `linteffect/no-try-catch-in-effect-logic` | `try/catch` inside `Effect.gen` or common Effect combinator callbacks. | Uses Effect error combinators instead of local imperative recovery. |
|
|
75
|
+
| `linteffect/no-promise-api-in-effect-logic` | `Promise.all`, `Promise.race`, `.then`, `.catch`, and related Promise APIs inside Effect logic. | Keeps scheduling, cancellation, tracing, and failures inside Effect. |
|
|
76
|
+
| `linteffect/no-swallowed-catch-all` | `Effect.catchAll` handlers that recover with `Effect.succeed`, `Effect.void`, `Effect.asVoid`, or `Effect.ignore`. | Avoids hiding failures without telemetry, re-fail, or explicit typed recovery. |
|
|
64
77
|
| `linteffect/no-manual-effect-channels` | Manual `Effect.Effect<...>` and `Layer.Layer<...>` channel types. | Lets Effect infer channels from real composition. |
|
|
65
78
|
| `linteffect/no-effect-type-alias` | Type aliases around `Effect.Effect<...>`. | Keeps service surfaces concrete and discoverable. |
|
|
79
|
+
| `linteffect/no-public-generic-effect-error` | Exported APIs returning `Effect.Effect<_, Error, _>`. | Public Effect APIs should expose tagged, recoverable domain errors instead of generic `Error`. |
|
|
80
|
+
|
|
81
|
+
### Concurrency Safety
|
|
82
|
+
|
|
83
|
+
| Rule | Catches | Why |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `linteffect/no-unbounded-effect-all` | `Effect.all(items.map(...))` without an explicit `concurrency` option. | Prevents load-dependent runaway parallelism and makes throughput ownership explicit. |
|
|
86
|
+
| `linteffect/no-fire-and-forget-fork` | Bare `Effect.fork(...)` expression statements. | Detached fibers hide failure, interruption, and lifecycle ownership. |
|
|
87
|
+
| `linteffect/no-fork-in-loop` | `Effect.fork(...)` inside `for`, `for...of`, `for...in`, `while`, or `do...while` loops. | Avoids loop-spawned unbounded fibers; use bounded `Effect.all` / `Effect.forEach` or scoped supervision. |
|
|
88
|
+
| `linteffect/no-race-without-cleanup` | `Effect.race(...)` / `Effect.raceAll(...)` without `Effect.ensuring`, scoped, or acquire/release cleanup. | Racing effects need explicit loser cleanup so losing work and resources do not leak. |
|
|
89
|
+
| `linteffect/no-unobserved-fiber` | `const fiber = Effect.fork(...)` when the fiber is never passed to `Fiber.join`, `Fiber.await`, or `Fiber.interrupt`. | Forked fibers should have observed failure and interruption ownership. |
|
|
90
|
+
| `linteffect/no-unbounded-concurrent-retry` | `Effect.retry(...)` nested inside unbounded mapped `Effect.all(...)` or unbounded `Effect.forEach(...)`. | Prevents retry storms by requiring bounded concurrency or a queue/backoff policy. |
|
|
91
|
+
| `linteffect/no-blocking-call-in-effect` | Sync `fs` / `crypto` / `zlib` calls inside `Effect.sync` or `Effect.gen`. | Blocking calls stall the runtime worker and should live behind async/platform boundaries. |
|
|
92
|
+
| `linteffect/no-promise-concurrency-in-effect` | `Promise.all`, `Promise.allSettled`, `Promise.race`, or `Promise.any` inside Effect logic. | Keeps concurrency, interruption, tracing, and typed failures inside Effect. |
|
|
93
|
+
| `linteffect/no-shared-mutable-state-across-fibers` | Outer `let` / `var` state mutated from `Effect.fork`, `Effect.all`, or `Effect.forEach` work. | Shared mutable state across fibers creates nondeterministic races; use Effect concurrency primitives. |
|
|
94
|
+
| `linteffect/no-timeout-with-noninterruptible-promise` | `Effect.timeout(Effect.promise(...))` or `Effect.timeout(Effect.tryPromise(...))` without a signal-aware callback. | Timeout should interrupt the underlying async operation, not only the Effect wrapper. |
|
|
66
95
|
|
|
67
96
|
### Pipeline Shape and Sequencing
|
|
68
97
|
|