@tsfpp/eslint-config 2.0.0 → 2.1.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 CHANGED
@@ -6,7 +6,8 @@ Enforces the machine-checkable subset of TSF++ rules via `@typescript-eslint` an
6
6
 
7
7
  ## Requirements
8
8
 
9
- - ESLint ≥ 9 (flat config format)
9
+ - ESLint 9 or 10 (flat config format)
10
+ - Node.js `^20.19.0 || ^22.13.0 || >=24` — the range ESLint 10 itself supports
10
11
  - TypeScript ≥ 5.3
11
12
  - A `tsconfig.json` reachable from each linted file
12
13
 
@@ -211,6 +212,10 @@ throw new Error('unreachable')
211
212
 
212
213
  Several ESLint plugin packages ship types that lag behind the current `@eslint/core` `Plugin` interface. This package contains a single `coercePlugin` adapter (`plugin-compat.ts`) that isolates the necessary type cast at one auditable boundary per TSF++ DEVIATION(1.6). Consumers are unaffected — this is an internal concern of the config package itself.
213
214
 
215
+ ### ESLint 10 and the React profile
216
+
217
+ `eslint-plugin-react` (7.37.5) and `eslint-plugin-jsx-a11y` (6.10.2) have not yet released ESLint 10 support: both call rule-context methods that ESLint 10 removed. The React profile registers them through `coerceLegacyPlugin`, which wraps them with `fixupPluginRules` from `@eslint/compat`, so the profile works on ESLint 9 and 10 alike. Your package manager will still report an unmet `eslint` peer for those two plugins under ESLint 10 — that warning comes from the plugins' own manifests and is expected until they publish a compatible release.
218
+
214
219
  ## See also
215
220
 
216
221
  - [spec/standards/TSFPP_CODING_STANDARD.md §9](../../spec/standards/TSFPP_CODING_STANDARD.md#9--compiler-and-tooling-configuration) — normative rule reference
@@ -27,4 +27,15 @@ import type { ESLint } from 'eslint';
27
27
  * type errors.
28
28
  */
29
29
  export declare const coercePlugin: (plugin: unknown) => ESLint.Plugin;
30
+ /**
31
+ * Coerces a plugin and additionally restores the rule-context methods ESLint 10
32
+ * removed (`context.getFilename()`, `context.getSourceCode()`, …).
33
+ *
34
+ * Use for plugins that have not shipped ESLint 10 support — currently
35
+ * eslint-plugin-react and eslint-plugin-jsx-a11y. Without the fixup,
36
+ * eslint-plugin-react 7.37.5 throws `contextOrFilename.getFilename is not a
37
+ * function` on the first linted file. Harmless under ESLint 9; drop the call
38
+ * for a plugin once its own peer range includes ESLint 10.
39
+ */
40
+ export declare const coerceLegacyPlugin: (plugin: unknown) => ESLint.Plugin;
30
41
  //# sourceMappingURL=plugin-compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-compat.d.ts","sourceRoot":"","sources":["../plugin-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,CAAC,MAE7B,CAAA"}
1
+ {"version":3,"file":"plugin-compat.d.ts","sourceRoot":"","sources":["../plugin-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAW,QAAQ,CAAA;AAGzC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,CAAC,MAE7B,CAAA;AAEzB;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,OAAO,KAAG,MAAM,CAAC,MACpB,CAAA"}
@@ -18,6 +18,7 @@
18
18
  * no runtime effect — this is a pure type-level coercion with zero behavior.
19
19
  * Reviewed and approved per TSF++ deviation procedure.
20
20
  */
21
+ import { fixupPluginRules } from '@eslint/compat';
21
22
  /**
22
23
  * Coerces a third-party ESLint plugin object to the canonical `ESLint.Plugin`
23
24
  * type accepted by flat config `plugins` records.
@@ -28,4 +29,15 @@
28
29
  export const coercePlugin = (plugin) =>
29
30
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- DEVIATION(1.6): see module JSDoc above
30
31
  plugin;
32
+ /**
33
+ * Coerces a plugin and additionally restores the rule-context methods ESLint 10
34
+ * removed (`context.getFilename()`, `context.getSourceCode()`, …).
35
+ *
36
+ * Use for plugins that have not shipped ESLint 10 support — currently
37
+ * eslint-plugin-react and eslint-plugin-jsx-a11y. Without the fixup,
38
+ * eslint-plugin-react 7.37.5 throws `contextOrFilename.getFilename is not a
39
+ * function` on the first linted file. Harmless under ESLint 9; drop the call
40
+ * for a plugin once its own peer range includes ESLint 10.
41
+ */
42
+ export const coerceLegacyPlugin = (plugin) => fixupPluginRules(coercePlugin(plugin));
31
43
  //# sourceMappingURL=plugin-compat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-compat.js","sourceRoot":"","sources":["../plugin-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAiB,EAAE;AAC7D,mHAAmH;AACnH,MAAuB,CAAA"}
1
+ {"version":3,"file":"plugin-compat.js","sourceRoot":"","sources":["../plugin-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAiB,EAAE;AAC7D,mHAAmH;AACnH,MAAuB,CAAA;AAEzB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAe,EAAiB,EAAE,CACnE,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAS,QAAQ,CAAA;AASvC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAqG1B,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAS,QAAQ,CAAA;AASvC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAsG1B,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/react.js CHANGED
@@ -31,7 +31,7 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks';
31
31
  import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
32
32
  import tanstackQueryPlugin from '@tanstack/eslint-plugin-query';
33
33
  import base from './base.js';
34
- import { coercePlugin } from './plugin-compat.js';
34
+ import { coerceLegacyPlugin, coercePlugin } from './plugin-compat.js';
35
35
  const config = [
36
36
  // ── Inherit all base TSF++ rules (applies to .ts and .tsx) ───────────────────
37
37
  ...base,
@@ -39,9 +39,10 @@ const config = [
39
39
  {
40
40
  files: ['**/*.tsx'],
41
41
  plugins: {
42
- 'react': coercePlugin(reactPlugin),
42
+ // react and jsx-a11y predate ESLint 10 — see coerceLegacyPlugin
43
+ 'react': coerceLegacyPlugin(reactPlugin),
43
44
  'react-hooks': coercePlugin(reactHooksPlugin),
44
- 'jsx-a11y': coercePlugin(jsxA11yPlugin),
45
+ 'jsx-a11y': coerceLegacyPlugin(jsxA11yPlugin),
45
46
  '@tanstack/query': coercePlugin(tanstackQueryPlugin),
46
47
  },
47
48
  settings: {
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,WAAW,MAAa,qBAAqB,CAAA;AACpD,OAAO,gBAAgB,MAAQ,2BAA2B,CAAA;AAC1D,wEAAwE;AACxE,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EAAE,OAAO;YAEhD,6BAA6B;YAC7B,qBAAqB,EAAG,OAAO;YAC/B,oBAAoB,EAAI,OAAO;YAE/B,sFAAsF;YACtF,uBAAuB,EAAE,MAAM;YAE/B,0EAA0E;YAE1E,+CAA+C;YAC/C,iCAAiC,EAAK,OAAO;YAE7C,uFAAuF;YACvF,uCAAuC,EAAE,OAAO;YAEhD,0EAA0E;YAC1E,qCAAqC,EAAE,OAAO;YAE9C,2EAA2E;YAE3E,yFAAyF;YACzF,kGAAkG;SACnG;KACF;IAED,gFAAgF;IAChF;QACE,KAAK,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;QACpC,KAAK,EAAE;YACL,4BAA4B,EAAG,OAAO;YACtC,6BAA6B,EAAE,OAAO;SACvC;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsfpp/eslint-config",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Shared ESLint flat configuration for TSF++ projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -36,14 +36,14 @@
36
36
  "test": "node --input-type=module --eval \"import './dist/base.js'\""
37
37
  },
38
38
  "engines": {
39
- "node": ">=18.18.0"
39
+ "node": "^20.19.0 || ^22.13.0 || >=24"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@tanstack/eslint-plugin-query": ">=5.0.0",
43
43
  "@typescript-eslint/eslint-plugin": ">=8.0.0",
44
44
  "@typescript-eslint/parser": ">=8.0.0",
45
- "eslint": ">=9.0.0",
46
- "eslint-plugin-functional": "^9.0.0",
45
+ "eslint": "^9.0.0 || ^10.0.0",
46
+ "eslint-plugin-functional": "^9.0.0 || ^10.0.0",
47
47
  "eslint-plugin-jsx-a11y": ">=6.0.0",
48
48
  "eslint-plugin-react": ">=7.0.0",
49
49
  "eslint-plugin-react-hooks": ">=5.0.0",
@@ -64,14 +64,17 @@
64
64
  }
65
65
  },
66
66
  "devDependencies": {
67
- "@tanstack/eslint-plugin-query": "^5.100.10",
68
- "@typescript-eslint/eslint-plugin": "^8.59.3",
69
- "@typescript-eslint/parser": "^8.59.3",
70
- "eslint": "^9.39.4",
71
- "eslint-plugin-functional": "^9.0.0",
67
+ "@tanstack/eslint-plugin-query": "^5.104.2",
68
+ "@typescript-eslint/eslint-plugin": "^8.71.2",
69
+ "@typescript-eslint/parser": "^8.71.2",
70
+ "eslint": "^10.12.0",
71
+ "eslint-plugin-functional": "^10.0.1",
72
72
  "eslint-plugin-jsx-a11y": "^6.10.2",
73
73
  "eslint-plugin-react": "^7.37.5",
74
74
  "eslint-plugin-react-hooks": "^7.1.1",
75
75
  "typescript": "^5.9.3"
76
+ },
77
+ "dependencies": {
78
+ "@eslint/compat": "^2.1.1"
76
79
  }
77
80
  }