@noctcore/eslint-plugin-async-safety 0.2.0 → 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 +5 -3
- package/dist/index.cjs +10 -4
- package/dist/index.js +10 -4
- package/docs/rules/no-concurrent-shared-mutation.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,9 +55,11 @@ export default [
|
|
|
55
55
|
| `require-fetch-timeout` | `error` | Precise and syntactic. |
|
|
56
56
|
| `require-client-timeout` | `error` | Inert until you list `clients`, so it ships enabled but checks nothing by default. |
|
|
57
57
|
| `no-shared-mutable-module-state` | `error` | Inert until you set `include` globs, so it ships enabled but off by default. |
|
|
58
|
-
| `forward-abort-signal` | `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
58
|
+
| `forward-abort-signal` | `error` | A dead `signal` is a real bug; any forwarding shape counts as a pass. |
|
|
59
|
+
| `no-concurrent-shared-mutation` | `error` | A lost update is a real bug; order-tolerant writes are skipped. |
|
|
60
|
+
| `prefer-parallel-awaits` | `off` | A latency hint, not a bug. Sequential awaits are often deliberate. Opt in where you want it. |
|
|
61
|
+
|
|
62
|
+
Every rule is `error` or `off`, never `warn`: a warning is a rule nobody obeys.
|
|
61
63
|
|
|
62
64
|
The 💡 rules provide editor suggestions (not autofixes) — parallelizing awaits and adding a timeout both change
|
|
63
65
|
runtime behavior, so they are never applied automatically.
|
package/dist/index.cjs
CHANGED
|
@@ -34,10 +34,16 @@ var recommended = {
|
|
|
34
34
|
"noctcore-async-safety/require-client-timeout": "error",
|
|
35
35
|
// Inert until you set `include` globs, so it ships enabled but off by default.
|
|
36
36
|
"noctcore-async-safety/no-shared-mutable-module-state": "error",
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
"noctcore-async-safety/
|
|
40
|
-
|
|
37
|
+
// A dead `signal` parameter is a real bug (the cancel never reaches the I/O), and
|
|
38
|
+
// the rule counts any forwarding shape as a pass, so it errs toward silence.
|
|
39
|
+
"noctcore-async-safety/forward-abort-signal": "error",
|
|
40
|
+
// A lost update is a real bug, and the rule skips order-tolerant writes
|
|
41
|
+
// (`push`, `set`, distinct-index) and plain overwrites.
|
|
42
|
+
"noctcore-async-safety/no-concurrent-shared-mutation": "error",
|
|
43
|
+
// Ships OFF: a latency hint, not a correctness bug. Sequential awaits are often
|
|
44
|
+
// deliberate (one transaction client, rate limits, deterministic test setup), and
|
|
45
|
+
// the rule cannot see that. Enable it where you want the nudge.
|
|
46
|
+
"noctcore-async-safety/prefer-parallel-awaits": "off"
|
|
41
47
|
};
|
|
42
48
|
|
|
43
49
|
// src/rules/forward-abort-signal.ts
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,16 @@ var recommended = {
|
|
|
6
6
|
"noctcore-async-safety/require-client-timeout": "error",
|
|
7
7
|
// Inert until you set `include` globs, so it ships enabled but off by default.
|
|
8
8
|
"noctcore-async-safety/no-shared-mutable-module-state": "error",
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
"noctcore-async-safety/
|
|
12
|
-
|
|
9
|
+
// A dead `signal` parameter is a real bug (the cancel never reaches the I/O), and
|
|
10
|
+
// the rule counts any forwarding shape as a pass, so it errs toward silence.
|
|
11
|
+
"noctcore-async-safety/forward-abort-signal": "error",
|
|
12
|
+
// A lost update is a real bug, and the rule skips order-tolerant writes
|
|
13
|
+
// (`push`, `set`, distinct-index) and plain overwrites.
|
|
14
|
+
"noctcore-async-safety/no-concurrent-shared-mutation": "error",
|
|
15
|
+
// Ships OFF: a latency hint, not a correctness bug. Sequential awaits are often
|
|
16
|
+
// deliberate (one transaction client, rate limits, deterministic test setup), and
|
|
17
|
+
// the rule cannot see that. Enable it where you want the nudge.
|
|
18
|
+
"noctcore-async-safety/prefer-parallel-awaits": "off"
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
// src/rules/forward-abort-signal.ts
|
|
@@ -45,4 +45,4 @@ None.
|
|
|
45
45
|
## When not to use it
|
|
46
46
|
|
|
47
47
|
If you intentionally accumulate into shared state and have externally serialized the callbacks (e.g. a mutex, or
|
|
48
|
-
a concurrency limit of 1), this rule's
|
|
48
|
+
a concurrency limit of 1), this rule's report is a false positive: disable it inline for that block.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctcore/eslint-plugin-async-safety",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "ESLint rules for async correctness: fetch timeouts, AbortSignal forwarding, and shared-state / concurrency races.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|