eslint-config-scratch 12.0.23 → 12.0.25
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 +18 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -14,20 +14,27 @@ npm install -D eslint-config-scratch eslint@^9 prettier@^3
|
|
|
14
14
|
|
|
15
15
|
Add `eslint.config.mjs` to your project root.
|
|
16
16
|
|
|
17
|
-
For a TypeScript project, you can add `languageOptions` to enable type checking
|
|
17
|
+
For a TypeScript project, you can add `languageOptions` to enable type checking. For example, if your `tsconfig.json`
|
|
18
|
+
covers files under `src/`, and you want to ignore `dist/` and `node_modules/`, your configuration might look like this:
|
|
18
19
|
|
|
19
20
|
```js
|
|
20
21
|
// myProjectRoot/eslint.config.mjs
|
|
21
22
|
import { eslintConfigScratch } from 'eslint-config-scratch'
|
|
23
|
+
import { globalIgnores } from 'eslint/config'
|
|
22
24
|
|
|
23
|
-
export default eslintConfigScratch.defineConfig(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
export default eslintConfigScratch.defineConfig(
|
|
26
|
+
eslintConfigScratch.recommended,
|
|
27
|
+
{
|
|
28
|
+
files: ['src/**'],
|
|
29
|
+
languageOptions: {
|
|
30
|
+
parserOptions: {
|
|
31
|
+
projectService: true,
|
|
32
|
+
tsconfigRootDir: import.meta.dirname,
|
|
33
|
+
},
|
|
28
34
|
},
|
|
29
35
|
},
|
|
30
|
-
|
|
36
|
+
globalIgnores(['dist/**', 'node_modules/**']),
|
|
37
|
+
)
|
|
31
38
|
```
|
|
32
39
|
|
|
33
40
|
For a JavaScript project, it might look like this:
|
|
@@ -77,6 +84,7 @@ import globals from 'globals'
|
|
|
77
84
|
export default eslintConfigScratch.defineConfig(
|
|
78
85
|
eslintConfigScratch.recommended,
|
|
79
86
|
{
|
|
87
|
+
files: ['src/**'],
|
|
80
88
|
languageOptions: {
|
|
81
89
|
globals: {
|
|
82
90
|
...globals.node,
|
|
@@ -88,8 +96,8 @@ export default eslintConfigScratch.defineConfig(
|
|
|
88
96
|
},
|
|
89
97
|
},
|
|
90
98
|
},
|
|
91
|
-
// Ignore all files in the dist
|
|
92
|
-
globalIgnores(['dist
|
|
99
|
+
// Ignore all files in the dist and node_modules directories
|
|
100
|
+
globalIgnores(['dist/**', 'node_modules/**']),
|
|
93
101
|
)
|
|
94
102
|
```
|
|
95
103
|
|
|
@@ -143,7 +151,7 @@ export default eslintConfigScratch.defineConfig(
|
|
|
143
151
|
// ...other settings for `src/`...
|
|
144
152
|
},
|
|
145
153
|
// ...settings for `test/`, etc...
|
|
146
|
-
globalIgnores(['dist
|
|
154
|
+
globalIgnores(['dist/**', 'node_modules/**']),
|
|
147
155
|
)
|
|
148
156
|
```
|
|
149
157
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-scratch",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.25",
|
|
4
4
|
"description": "Shareable ESLint config for Scratch",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@babel/eslint-parser": "7.28.5",
|
|
34
34
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
35
35
|
"@eslint/eslintrc": "3.3.1",
|
|
36
|
-
"@eslint/js": "9.
|
|
36
|
+
"@eslint/js": "9.39.0",
|
|
37
37
|
"@eslint/markdown": "7.5.0",
|
|
38
38
|
"@stylistic/eslint-plugin": "^5.3.1",
|
|
39
39
|
"@trivago/prettier-plugin-sort-imports": "5.2.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
46
46
|
"eslint-plugin-react": "7.37.5",
|
|
47
47
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
48
|
-
"globals": "16.
|
|
48
|
+
"globals": "16.5.0",
|
|
49
49
|
"prettier": "3.6.2",
|
|
50
50
|
"typescript-eslint": "8.46.2"
|
|
51
51
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@commitlint/cli": "20.1.0",
|
|
54
54
|
"@commitlint/config-conventional": "20.0.0",
|
|
55
55
|
"@commitlint/types": "20.0.0",
|
|
56
|
-
"eslint": "9.
|
|
56
|
+
"eslint": "9.39.0",
|
|
57
57
|
"husky": "9.1.7",
|
|
58
58
|
"scratch-semantic-release-config": "4.0.0",
|
|
59
59
|
"semantic-release": "24.2.9",
|