@jchiam/eslint-config 6.0.0 → 7.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.
Files changed (3) hide show
  1. package/README.md +23 -3
  2. package/package.json +1 -1
  3. package/react.js +6 -0
package/README.md CHANGED
@@ -30,10 +30,11 @@ export default [...jchiamConfig];
30
30
 
31
31
  ```js
32
32
  // eslint.config.js — React + TypeScript project
33
- import jchiamConfig from '@jchiam/eslint-config';
33
+ // The /react config is self-contained — it includes the base config, so spread
34
+ // it alone. Do not also spread the base, or it will be included twice.
34
35
  import jchiamReact from '@jchiam/eslint-config/react';
35
36
 
36
- export default [...jchiamConfig, ...jchiamReact];
37
+ export default [...jchiamReact];
37
38
  ```
38
39
 
39
40
  Override rules by appending a config object to the array:
@@ -63,12 +64,31 @@ export default [
63
64
 
64
65
  ### `react.js`
65
66
 
66
- Extends `recommended.js` intent with:
67
+ Self-contained — includes everything in `recommended.js`, plus:
67
68
  - [`@eslint-react/eslint-plugin`](https://github.com/Rel1cx/eslint-react) recommended rules (bundled — no separate install needed)
68
69
  - [`eslint-plugin-react-hooks`](https://github.com/facebook/react) rules of hooks + exhaustive deps
69
70
 
71
+ Spread it on its own (`[...jchiamReact]`); there is no need to also spread the base config.
72
+
70
73
  ## Breaking Changes
71
74
 
75
+ ### v6 to v7
76
+
77
+ The `/react` config is now **self-contained** — it includes the base config, so React projects spread a single array instead of composing base + react themselves.
78
+
79
+ ```js
80
+ // Before (v6)
81
+ import jchiamConfig from '@jchiam/eslint-config';
82
+ import jchiamReact from '@jchiam/eslint-config/react';
83
+ export default [...jchiamConfig, ...jchiamReact];
84
+
85
+ // After (v7)
86
+ import jchiamReact from '@jchiam/eslint-config/react';
87
+ export default [...jchiamReact];
88
+ ```
89
+
90
+ Spreading both as before still "works" but includes the base config twice. Non-React projects are unaffected — keep using `recommended` as before.
91
+
72
92
  ### v5 to v6
73
93
 
74
94
  Replaced [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import) with its maintained fork [`eslint-plugin-import-x`](https://github.com/un-ts/eslint-plugin-import-x). The original plugin does not support ESLint 10 (it crashes at runtime under ESLint 10); `import-x` does, and is lighter and faster.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jchiam/eslint-config",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "my personal ESLint rules",
5
5
  "type": "module",
6
6
  "main": "recommended.js",
package/react.js CHANGED
@@ -1,8 +1,14 @@
1
+ import recommended from './recommended.js';
1
2
  import eslintReact from '@eslint-react/eslint-plugin';
2
3
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
3
4
  import stylistic from '@stylistic/eslint-plugin';
4
5
 
6
+ // Self-contained React + TypeScript config. It includes the base `recommended`
7
+ // config, so consumers spread a single array (`[...jchiamReact]`) rather than
8
+ // composing base + react themselves and having to get the order right.
9
+ // recommended.js remains the standalone base for non-React projects.
5
10
  export default [
11
+ ...recommended,
6
12
  eslintReact.configs.recommended,
7
13
  {
8
14
  plugins: {