eslint-plugin-kerfjs 4.0.0 → 4.1.1
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 +14 -9
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -21,6 +21,14 @@ All but one rule are AST-only — no `@typescript-eslint/parser` *service* depen
|
|
|
21
21
|
npm install --save-dev eslint-plugin-kerfjs
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
### Supported ESLint versions
|
|
25
|
+
|
|
26
|
+
`peerDependencies` declares `^9.0.0 || ^10.0.0`, and that is a **tested** range rather than an optimistic one: the rule suite runs against the latest release of each of those majors in CI on every push. A major is added to the range only after the suite has passed on it.
|
|
27
|
+
|
|
28
|
+
A version outside the range is not "probably fine" — it is one nobody has run. If you need a newer major, open an issue rather than forcing the peer; expanding the range is a one-line change once the matrix is green.
|
|
29
|
+
|
|
30
|
+
**ESLint 8 is not supported.** This package is ESM-only, and ESLint 8 loads plugins for `.eslintrc` configs with `require()` — so `extends: ["plugin:kerfjs/..."]` fails to resolve the plugin at all. ESLint 8's opt-in flat-config mode can load it, but that is not the default path an ESLint 8 project is on, so the range does not claim it.
|
|
31
|
+
|
|
24
32
|
## Configure (flat config, ESLint v9+)
|
|
25
33
|
|
|
26
34
|
```js
|
|
@@ -40,15 +48,12 @@ export default [
|
|
|
40
48
|
];
|
|
41
49
|
```
|
|
42
50
|
|
|
43
|
-
##
|
|
51
|
+
## Legacy `.eslintrc` configs are not supported
|
|
52
|
+
|
|
53
|
+
The package is ESM-only. ESLint's `.eslintrc` system loads plugins with `require()`, which cannot load an ESM package, so `extends: ["plugin:kerfjs/legacy-recommended"]` fails with *"couldn't find the config to extend from"* on ESLint 8 **and** on ESLint 9's legacy mode.
|
|
54
|
+
|
|
55
|
+
Use flat config (`eslint.config.js`), shown above. The `legacy-recommended` export still exists in the package but is unreachable through any config system — treat it as deprecated.
|
|
44
56
|
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"parser": "@typescript-eslint/parser",
|
|
48
|
-
"parserOptions": { "ecmaFeatures": { "jsx": true } },
|
|
49
|
-
"extends": ["plugin:kerfjs/legacy-recommended"]
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
57
|
|
|
53
58
|
## Rules
|
|
54
59
|
|
|
@@ -65,7 +70,7 @@ export default [
|
|
|
65
70
|
|
|
66
71
|
The "Hard Rule" column refers to the numbered rules in [`docs/ai/usage-guide.md`](../docs/ai/usage-guide.md) on the main kerf repo. `no-raw-with-dynamic-arg` and `ai-assistant-configs` don't map to numbered Hard Rules — the former creates an audit trail for every dynamic `raw()` call site (potential XSS); the latter checks that the bundled AI-assistant configs are installed and current. See [`docs/12-ai-assistant-configs.md`](../docs/12-ai-assistant-configs.md) on the main kerf repo for the AI-configs design.
|
|
67
72
|
|
|
68
|
-
## Why these
|
|
73
|
+
## Why these rules, and not more
|
|
69
74
|
|
|
70
75
|
Rules that need flow analysis (signal reads outside render — Rule 8), call-graph analysis (`addEventListener` inside the mount tree — Rule 4), or type information (partial-set against multi-key state — Rule 9) are already covered by the opt-in dev-warns and strict TS. Duplicating them here would mean either high false-positive rates without type info, or a `parserServices` dependency that complicates consumer setup.
|
|
71
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-kerfjs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "ESLint rules that enforce kerf's hard rules — catches AI-shaped bugs at edit time.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,10 +36,11 @@
|
|
|
36
36
|
"LICENSE"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"test": "node --test tests/rules/*.test.js"
|
|
39
|
+
"test": "node --test tests/rules/*.test.js",
|
|
40
|
+
"test:eslint-matrix": "node scripts/eslint-matrix.mjs"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
|
-
"eslint": "
|
|
43
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@typescript-eslint/parser": "^8.0.0",
|