@codfish/eslint-config 12.3.0 → 13.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.
- package/README.md +70 -5
- package/package.json +18 -17
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @codfish/eslint-config
|
|
2
2
|
|
|
3
3
|
> Modern ESLint configuration with TypeScript, React/Next.js, YAML, Testing Library, and testing framework support using
|
|
4
|
-
> ESLint
|
|
4
|
+
> ESLint v10+ flat config format.
|
|
5
5
|
|
|
6
6
|
[](http://npm.im/@codfish/eslint-config)
|
|
7
7
|
[](http://npm-stat.com/charts.html?package=@codfish/eslint-config&from=2015-08-01)
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
- [Use in combination with prettier-plugin-tailwindcss](#use-in-combination-with-prettier-plugin-tailwindcss)
|
|
25
25
|
- [Example scripts](#example-scripts)
|
|
26
26
|
- [Commitlint Configuration](#commitlint-configuration)
|
|
27
|
+
- [Upgrading to ESLint 10](#upgrading-to-eslint-10)
|
|
28
|
+
- [Breaking Changes in ESLint 10](#breaking-changes-in-eslint-10)
|
|
29
|
+
- [Migration Steps](#migration-steps)
|
|
30
|
+
- [What Changed](#what-changed)
|
|
27
31
|
- [Migration from Legacy Config](#migration-from-legacy-config)
|
|
28
32
|
|
|
29
33
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
@@ -31,7 +35,7 @@
|
|
|
31
35
|
|
|
32
36
|
## Features
|
|
33
37
|
|
|
34
|
-
- **Modern ESLint
|
|
38
|
+
- **Modern ESLint v10+ flat config**: Uses the new flat configuration format
|
|
35
39
|
- **Dynamic feature detection**: Automatically configures based on your project's dependencies
|
|
36
40
|
- **TypeScript support**: Full TypeScript linting with modern typescript-eslint parser and rules
|
|
37
41
|
- **React ecosystem**: React, React Hooks, and JSX accessibility rules when React is detected
|
|
@@ -49,7 +53,7 @@
|
|
|
49
53
|
Install the package and required peer dependencies:
|
|
50
54
|
|
|
51
55
|
```sh
|
|
52
|
-
npm i -D eslint@
|
|
56
|
+
npm i -D eslint@10 @codfish/eslint-config
|
|
53
57
|
|
|
54
58
|
# Optionally, you can uninstall plugins or presets you don't need to manage anymore,
|
|
55
59
|
# @codfish/eslint-config includes them all.
|
|
@@ -379,7 +383,7 @@ export default {
|
|
|
379
383
|
### Use in combination with prettier-plugin-tailwindcss
|
|
380
384
|
|
|
381
385
|
```sh
|
|
382
|
-
npm i -D eslint@
|
|
386
|
+
npm i -D eslint@10 @codfish/eslint-config prettier-plugin-tailwindcss
|
|
383
387
|
```
|
|
384
388
|
|
|
385
389
|
```js
|
|
@@ -501,11 +505,72 @@ jobs:
|
|
|
501
505
|
--verbose
|
|
502
506
|
```
|
|
503
507
|
|
|
508
|
+
## Upgrading to ESLint 10
|
|
509
|
+
|
|
510
|
+
This package now requires **ESLint 10.0.0 or higher** and **Node.js v20.19.0 or higher**.
|
|
511
|
+
|
|
512
|
+
### Breaking Changes in ESLint 10
|
|
513
|
+
|
|
514
|
+
- **ESLint 10 Required**: Minimum ESLint version is now 10.0.0
|
|
515
|
+
- **Node.js v20.19.0+**: Minimum Node.js version increased from v20.0.0 to v20.19.0
|
|
516
|
+
- **Legacy eslintrc removed**: ESLint 10 completely removes the deprecated eslintrc config system (this package already
|
|
517
|
+
uses flat config)
|
|
518
|
+
- **Improved JSX tracking**: ESLint 10 properly tracks JSX references in scope analysis, which may surface previously
|
|
519
|
+
hidden unused import warnings in React files
|
|
520
|
+
- **New recommended rules**: Three new rules enabled in `eslint:recommended`:
|
|
521
|
+
- `no-unassigned-vars` - Disallow variables that are assigned but never used
|
|
522
|
+
- `no-useless-assignment` - Disallow assignments that don't change the value
|
|
523
|
+
- `preserve-caught-error` - Enforce that caught errors are not reassigned
|
|
524
|
+
|
|
525
|
+
### Migration Steps
|
|
526
|
+
|
|
527
|
+
1. **Update Node.js** (if needed):
|
|
528
|
+
|
|
529
|
+
```sh
|
|
530
|
+
node --version # Ensure you're on v20.19.0+ or v22.13.0+
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
2. **Update ESLint and this config**:
|
|
534
|
+
|
|
535
|
+
```sh
|
|
536
|
+
npm install --save-dev eslint@10 @codfish/eslint-config@latest
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
3. **Install dependencies with legacy peer deps** (required until all plugins update):
|
|
540
|
+
|
|
541
|
+
```sh
|
|
542
|
+
npm install --legacy-peer-deps
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
This is necessary because some ESLint plugins haven't updated their `peerDependencies` to include ESLint 10 yet. The
|
|
546
|
+
plugins still work correctly with ESLint 10.
|
|
547
|
+
|
|
548
|
+
4. **Run linting** and check for new violations:
|
|
549
|
+
|
|
550
|
+
```sh
|
|
551
|
+
npm run lint
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
5. **Review React files** for newly reported unused imports. ESLint 10's improved JSX tracking may flag imports that
|
|
555
|
+
were previously ignored but are actually used in JSX.
|
|
556
|
+
|
|
557
|
+
### What Changed
|
|
558
|
+
|
|
559
|
+
Since this package already uses ESLint's flat config format (the biggest change in ESLint 9), the upgrade to ESLint 10
|
|
560
|
+
is relatively smooth. The main changes are:
|
|
561
|
+
|
|
562
|
+
- ✅ Flat config format (already implemented)
|
|
563
|
+
- ✅ Plugin configurations updated to ESLint 10-compatible versions
|
|
564
|
+
- ✅ All tests passing with ESLint 10
|
|
565
|
+
- ⚠️ Some plugins show peer dependency warnings but work correctly (ecosystem is catching up)
|
|
566
|
+
|
|
567
|
+
For more details, see the [ESLint 10 Migration Guide](https://eslint.org/docs/latest/use/migrate-to-10.0.0).
|
|
568
|
+
|
|
504
569
|
## Migration from Legacy Config
|
|
505
570
|
|
|
506
571
|
If you're upgrading from an older version that used Airbnb presets:
|
|
507
572
|
|
|
508
|
-
1. **Update to ESLint
|
|
573
|
+
1. **Update to ESLint v10+**: `npm install --save-dev eslint@10`
|
|
509
574
|
2. **Switch to flat config**: Replace `.eslintrc.js` with `eslint.config.js`
|
|
510
575
|
3. **Use import syntax**: Change from `require()` to `import` statements
|
|
511
576
|
4. **Remove explicit React config**: React support is now automatically detected
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codfish/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Modern ESLint configuration with TypeScript, React, and testing framework support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -54,44 +54,45 @@
|
|
|
54
54
|
"prepare": "husky"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@commitlint/cli": "^20.4.
|
|
58
|
-
"@commitlint/config-conventional": "^20.4.
|
|
59
|
-
"@eslint/js": "^
|
|
60
|
-
"@eslint/json": "^1.0.
|
|
57
|
+
"@commitlint/cli": "^20.4.1",
|
|
58
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
59
|
+
"@eslint/js": "^10.0.0",
|
|
60
|
+
"@eslint/json": "^1.0.1",
|
|
61
61
|
"@eslint/markdown": "^7.5.1",
|
|
62
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
63
|
-
"@html-eslint/parser": "^0.
|
|
62
|
+
"@html-eslint/eslint-plugin": "^0.55.0",
|
|
63
|
+
"@html-eslint/parser": "^0.55.0",
|
|
64
64
|
"@next/eslint-plugin-next": "^16.1.6",
|
|
65
65
|
"@tanstack/eslint-plugin-query": "^5.91.4",
|
|
66
|
-
"@vitest/eslint-plugin": "^1.
|
|
66
|
+
"@vitest/eslint-plugin": "^1.6.9",
|
|
67
67
|
"cosmiconfig": "^9.0.0",
|
|
68
68
|
"eslint-config-prettier": "^10.1.8",
|
|
69
|
-
"eslint-plugin-jest": "^29.0
|
|
69
|
+
"eslint-plugin-jest": "^29.14.0",
|
|
70
70
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
71
|
-
"eslint-plugin-prettier": "^5.5.
|
|
71
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
72
72
|
"eslint-plugin-react": "^7.37.5",
|
|
73
73
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
74
74
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
75
75
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
76
|
-
"eslint-plugin-testing-library": "^7.
|
|
77
|
-
"eslint-plugin-yml": "^3.
|
|
76
|
+
"eslint-plugin-testing-library": "^7.15.4",
|
|
77
|
+
"eslint-plugin-yml": "^3.1.2",
|
|
78
78
|
"globals": "^17.3.0",
|
|
79
79
|
"lodash.has": "^4.5.2",
|
|
80
80
|
"prettier": ">= 3",
|
|
81
81
|
"read-package-up": "^12.0.0",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.55.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
+
"@types/node": "^25.2.3",
|
|
85
86
|
"@vitest/coverage-v8": "^4.0.18",
|
|
86
87
|
"doctoc": "^2.2.1",
|
|
87
|
-
"eslint": "^
|
|
88
|
+
"eslint": "^10.0.0",
|
|
88
89
|
"husky": "^9.1.7",
|
|
89
90
|
"lint-staged": "^16.1.6",
|
|
90
91
|
"typescript": "^5.9.2",
|
|
91
92
|
"vitest": "^4.0.18"
|
|
92
93
|
},
|
|
93
94
|
"engines": {
|
|
94
|
-
"node": ">=20.
|
|
95
|
+
"node": ">=20.19.0"
|
|
95
96
|
},
|
|
96
97
|
"files": [
|
|
97
98
|
"dist",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"commitlint.js"
|
|
105
106
|
],
|
|
106
107
|
"peerDependencies": {
|
|
107
|
-
"eslint": ">=
|
|
108
|
+
"eslint": ">= 10",
|
|
108
109
|
"prettier": ">= 3"
|
|
109
110
|
},
|
|
110
111
|
"peerDependenciesMeta": {
|
|
@@ -127,6 +128,6 @@
|
|
|
127
128
|
]
|
|
128
129
|
},
|
|
129
130
|
"volta": {
|
|
130
|
-
"node": "24.
|
|
131
|
+
"node": "24.13.0"
|
|
131
132
|
}
|
|
132
133
|
}
|