@dendavidov/eslint-config-react 2.2.1 → 2.2.2
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 +16 -2
- package/package.json +18 -8
- package/src/index.d.ts +5 -3
- package/src/index.js +1 -0
package/README.md
CHANGED
|
@@ -6,15 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
# @dendavidov/eslint-config-react
|
|
8
8
|
|
|
9
|
-
Opinionated eslint-config for React.js SPA with ESLint
|
|
9
|
+
Opinionated eslint-config for React.js SPA with ESLint 9+ (flat config).
|
|
10
10
|
Includes security best-practice rules via `eslint-plugin-security`.
|
|
11
11
|
|
|
12
|
+
- **ESLint 9+ flat config** (bundled `eslint` + `@eslint/js`; plugin ecosystem is not fully on ESLint 10 yet, so this package currently resolves ESLint 9.x)
|
|
13
|
+
- **Node.js 24.x required** (`engines.node`); this repo pins an exact patch in `.nvmrc` / `Dockerfile` for CI
|
|
14
|
+
- **ESLint is bundled** as a normal dependency — you do not add `eslint` as its own devDependency; resolve the CLI with `npx eslint`, `pnpm exec eslint`, or a `lint` script
|
|
15
|
+
|
|
12
16
|
## Installation
|
|
13
17
|
|
|
18
|
+
Install this package **and** its peer dependencies (ESLint plugins and parsers this config expects):
|
|
19
|
+
|
|
14
20
|
```bash
|
|
15
|
-
|
|
21
|
+
pnpm add -D @dendavidov/eslint-config-react @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-jest eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-security eslint-plugin-testing-library
|
|
16
22
|
```
|
|
17
23
|
|
|
24
|
+
(or the equivalent `npm i -D …` with the same package list.)
|
|
25
|
+
|
|
26
|
+
`eslint` itself is installed transitively with `@dendavidov/eslint-config-react`; use `npx eslint` or `pnpm exec eslint` so the binary comes from your install tree.
|
|
27
|
+
|
|
18
28
|
## Usage
|
|
19
29
|
|
|
20
30
|
Create `eslint.config.js` in the root of your project:
|
|
@@ -50,6 +60,10 @@ Add script to package.json:
|
|
|
50
60
|
}
|
|
51
61
|
```
|
|
52
62
|
|
|
63
|
+
## Node.js version
|
|
64
|
+
|
|
65
|
+
This config requires **Node.js 24.x** (see `engines.node` on npm). Development of this package uses a **pinned patch** in `.nvmrc` (and `Dockerfile`) so CI and Dependabot stay aligned.
|
|
66
|
+
|
|
53
67
|
## Contributing
|
|
54
68
|
|
|
55
69
|
Pull requests are welcome. For major changes, please open an issue first
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dendavidov/eslint-config-react",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"description": "Shareable ESLint config for React + TypeScript (ESLint
|
|
3
|
+
"version": "2.2.2",
|
|
4
|
+
"description": "Shareable ESLint config for React + TypeScript (ESLint 9+ flat config), supporting Node.js 24.x.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"types": "src/index.d.ts",
|
|
@@ -25,14 +25,25 @@
|
|
|
25
25
|
"src/index.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --watchAll=false",
|
|
28
|
+
"test": "node scripts/verify-node-pins.cjs && NODE_OPTIONS=--experimental-vm-modules jest --watchAll=false",
|
|
29
29
|
"format": "prettier --write .",
|
|
30
|
-
"format:check": "prettier --check
|
|
31
|
-
"
|
|
32
|
-
"
|
|
30
|
+
"format:check": "prettier --check .",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"release": "semantic-release",
|
|
33
|
+
"prepare": "husky"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "pnpm@10.32.0",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=24.0.0 <25"
|
|
38
|
+
},
|
|
39
|
+
"pnpm": {
|
|
40
|
+
"onlyBuiltDependencies": [
|
|
41
|
+
"unrs-resolver"
|
|
42
|
+
]
|
|
33
43
|
},
|
|
34
44
|
"dependencies": {
|
|
35
|
-
"@eslint/js": "^
|
|
45
|
+
"@eslint/js": "^9.39.0",
|
|
46
|
+
"eslint": "^9.39.0"
|
|
36
47
|
},
|
|
37
48
|
"peerDependencies": {
|
|
38
49
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
@@ -54,7 +65,6 @@
|
|
|
54
65
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
55
66
|
"@typescript-eslint/parser": "^8.56.0",
|
|
56
67
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
57
|
-
"eslint": "^10.0.0",
|
|
58
68
|
"eslint-config-prettier": "^10.1.8",
|
|
59
69
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
60
70
|
"eslint-plugin-import": "^2.32.0",
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import jestPlugin from 'eslint-plugin-jest';
|
|
|
9
9
|
import testingLibraryPlugin from 'eslint-plugin-testing-library';
|
|
10
10
|
import prettierConfig from 'eslint-config-prettier';
|
|
11
11
|
|
|
12
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
12
13
|
export default [
|
|
13
14
|
// core ESLint recommended
|
|
14
15
|
js.configs.recommended,
|