@bitfactory/eslint-config 2.0.0 → 3.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 +37 -8
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
[](https://lbesson.mit-license.org/)
|
|
6
6
|
[](https://npmjs.com/package/@bitfactory/eslint-config)
|
|
7
7
|
|
|
8
|
-
[](https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory)
|
|
9
|
+

|
|
10
10
|
[](https://nodejs.org/)
|
|
11
11
|

|
|
12
12
|
|
|
13
|
-
This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set.
|
|
13
|
+
This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set.
|
|
14
|
+
Rules can be overridden if needed.
|
|
15
|
+
|
|
16
|
+
> [!IMPORTANT]
|
|
17
|
+
> From ESLint v9 the Flat Config file is the default. Because of this change update the `package.json` npm run scripts!
|
|
18
|
+
>
|
|
19
|
+
> See also the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
|
|
20
|
+
>
|
|
21
|
+
> For now the `eslint` scripts can only be run with the `ESLINT_USE_FLAT_CONFIG=false` environment variable set like this. For examples how to add this to the `package.json`, please check out the [CLI usage documentation](#rocket-cli-usage).
|
|
14
22
|
|
|
15
23
|
- [@bitfactory/eslint-config](#bitfactoryeslint-config)
|
|
16
24
|
- [:technologist: Development](#technologist-development)
|
|
@@ -51,7 +59,7 @@ make npx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
|
51
59
|
```
|
|
52
60
|
|
|
53
61
|
```shell
|
|
54
|
-
make
|
|
62
|
+
make pnpm dlx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
55
63
|
```
|
|
56
64
|
|
|
57
65
|
In your project, create an `.eslintrc.js` file with the following contents:
|
|
@@ -158,29 +166,50 @@ To use ESLint in the command-line, add the following scripts to your projects `p
|
|
|
158
166
|
|
|
159
167
|
```json
|
|
160
168
|
"scripts": {
|
|
161
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
169
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
162
170
|
"eslint:fix": "npm run eslint -- --fix"
|
|
163
171
|
}
|
|
164
172
|
```
|
|
165
173
|
|
|
174
|
+
```json
|
|
175
|
+
"scripts": {
|
|
176
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
177
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
166
181
|
To also check Vue.js files:
|
|
167
182
|
|
|
168
183
|
```json
|
|
169
184
|
"scripts": {
|
|
170
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
185
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
171
186
|
"eslint:fix": "npm run eslint -- --fix"
|
|
172
187
|
}
|
|
173
188
|
```
|
|
174
189
|
|
|
190
|
+
```json
|
|
191
|
+
"scripts": {
|
|
192
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
193
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
175
197
|
Or TypeScript files:
|
|
176
198
|
|
|
177
199
|
```json
|
|
178
200
|
"scripts": {
|
|
179
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
201
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
180
202
|
"eslint:fix": "npm run eslint -- --fix"
|
|
181
203
|
}
|
|
182
204
|
```
|
|
183
205
|
|
|
206
|
+
```json
|
|
207
|
+
"scripts": {
|
|
208
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
209
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
184
213
|
You can run the commands with:
|
|
185
214
|
|
|
186
215
|
```shell
|
|
@@ -193,7 +222,7 @@ pnpm run eslint
|
|
|
193
222
|
pnpm run eslint:fix
|
|
194
223
|
```
|
|
195
224
|
|
|
196
|
-
> With PNPM you can also run
|
|
225
|
+
> With PNPM you can also run scripts without 'run' like `pnpm eslint`.
|
|
197
226
|
|
|
198
227
|
## :pencil2: Editor / IDE integration
|
|
199
228
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitfactory/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "ESLint sharable config for Bitfactory projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -18,29 +18,30 @@
|
|
|
18
18
|
"vue.js"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babel/core": "7.25.
|
|
22
|
-
"@babel/eslint-parser": "7.25.
|
|
23
|
-
"eslint": "
|
|
21
|
+
"@babel/core": "7.25.8",
|
|
22
|
+
"@babel/eslint-parser": "7.25.8",
|
|
23
|
+
"eslint": "9.12.0",
|
|
24
24
|
"eslint-plugin-import": "2.31.0",
|
|
25
|
-
"eslint-plugin-jsdoc": "50.3.
|
|
25
|
+
"eslint-plugin-jsdoc": "50.3.2",
|
|
26
26
|
"eslint-plugin-unicorn": "56.0.0",
|
|
27
27
|
"lint-staged": "15.2.10",
|
|
28
28
|
"npm-check-updates": "17.1.3",
|
|
29
29
|
"simple-git-hooks": "2.11.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/eslint-parser": "^7.
|
|
34
|
-
"eslint": "^8.56.0",
|
|
35
|
-
"eslint-plugin-import": "
|
|
36
|
-
"eslint-plugin-jsdoc": ">=
|
|
37
|
-
"eslint-plugin-unicorn": ">=
|
|
32
|
+
"@babel/core": "^7.24.5",
|
|
33
|
+
"@babel/eslint-parser": "^7.24.5",
|
|
34
|
+
"eslint": "^8.56.0 || ^9.0.0",
|
|
35
|
+
"eslint-plugin-import": ">=2.31.0",
|
|
36
|
+
"eslint-plugin-jsdoc": ">=47.0.0",
|
|
37
|
+
"eslint-plugin-unicorn": ">=56.0.0"
|
|
38
38
|
},
|
|
39
|
+
"packageManager": "pnpm@8.15.9",
|
|
39
40
|
"engines": {
|
|
40
41
|
"node": "^18.18.0 || ^20.9.0"
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
|
-
"eslint": "eslint '**/*.{cjs,js,mjs}'",
|
|
44
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{cjs,js,mjs}'",
|
|
44
45
|
"eslint:fix": "pnpm run eslint --fix",
|
|
45
46
|
"update:interactive": "pnpm exec npm-check-updates -i",
|
|
46
47
|
"update:minor": "pnpm exec npm-check-updates -i -t minor",
|