@bitfactory/eslint-config 2.0.0 → 3.1.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 +46 -22
- package/package.json +9 -14
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# @bitfactory/eslint-config
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.com/package/@bitfactory/eslint-config)
|
|
3
|
+
[](https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory)
|
|
5
4
|
[](https://lbesson.mit-license.org/)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[](https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory)
|
|
9
|
-

|
|
5
|
+

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

|
|
12
7
|
|
|
13
8
|
This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set. Rules can be overridden if needed.
|
|
14
9
|
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> From ESLint v9 the Flat Config file is the default. Because of this change update the `package.json` npm run scripts!
|
|
12
|
+
>
|
|
13
|
+
> See also the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
|
|
14
|
+
>
|
|
15
|
+
> 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).
|
|
16
|
+
|
|
15
17
|
- [@bitfactory/eslint-config](#bitfactoryeslint-config)
|
|
16
18
|
- [:technologist: Development](#technologist-development)
|
|
17
19
|
- [:package: Installing](#package-installing)
|
|
@@ -26,11 +28,14 @@ This is a shareable config for [ESLint](https://eslint.org). All the rules and c
|
|
|
26
28
|
|
|
27
29
|
## :technologist: Development
|
|
28
30
|
|
|
29
|
-
### Publishing
|
|
31
|
+
### Publishing
|
|
32
|
+
|
|
33
|
+
Before publishing a new version:
|
|
30
34
|
|
|
31
|
-
1.
|
|
32
|
-
2.
|
|
33
|
-
3.
|
|
35
|
+
1. Update the version number in the `package.json` file.
|
|
36
|
+
2. And also update the badges in the `README.md` file, even for patches.
|
|
37
|
+
3. Create a new release, after merging the PR. This will trigger a workflow.
|
|
38
|
+
4. The GitHub action workflow will then automatically create a new NPM package.
|
|
34
39
|
|
|
35
40
|
## :package: Installing
|
|
36
41
|
|
|
@@ -51,7 +56,7 @@ make npx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
```shell
|
|
54
|
-
make
|
|
59
|
+
make pnpm dlx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
In your project, create an `.eslintrc.js` file with the following contents:
|
|
@@ -154,46 +159,65 @@ module.exports = {
|
|
|
154
159
|
|
|
155
160
|
To use ESLint in the command-line, add the following scripts to your projects `package.json`:
|
|
156
161
|
|
|
157
|
-
> For PNPM use `"eslint:fix": "pnpm run eslint --fix"`
|
|
158
|
-
|
|
159
162
|
```json
|
|
160
163
|
"scripts": {
|
|
161
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
164
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
162
165
|
"eslint:fix": "npm run eslint -- --fix"
|
|
163
166
|
}
|
|
164
167
|
```
|
|
165
168
|
|
|
169
|
+
```json
|
|
170
|
+
"scripts": {
|
|
171
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
172
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
166
176
|
To also check Vue.js files:
|
|
167
177
|
|
|
168
178
|
```json
|
|
169
179
|
"scripts": {
|
|
170
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
180
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
171
181
|
"eslint:fix": "npm run eslint -- --fix"
|
|
172
182
|
}
|
|
173
183
|
```
|
|
174
184
|
|
|
185
|
+
```json
|
|
186
|
+
"scripts": {
|
|
187
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
188
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
175
192
|
Or TypeScript files:
|
|
176
193
|
|
|
177
194
|
```json
|
|
178
195
|
"scripts": {
|
|
179
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
196
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
180
197
|
"eslint:fix": "npm run eslint -- --fix"
|
|
181
198
|
}
|
|
182
199
|
```
|
|
183
200
|
|
|
201
|
+
```json
|
|
202
|
+
"scripts": {
|
|
203
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
204
|
+
"eslint:fix": "pnpm run eslint --fix"
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
184
208
|
You can run the commands with:
|
|
185
209
|
|
|
186
210
|
```shell
|
|
187
|
-
npm run eslint
|
|
188
|
-
npm run eslint:fix
|
|
211
|
+
make npm run eslint
|
|
212
|
+
make npm run eslint:fix
|
|
189
213
|
```
|
|
190
214
|
|
|
191
215
|
```shell
|
|
192
|
-
pnpm run eslint
|
|
193
|
-
pnpm run eslint:fix
|
|
216
|
+
make pnpm run eslint
|
|
217
|
+
make pnpm run eslint:fix
|
|
194
218
|
```
|
|
195
219
|
|
|
196
|
-
> With PNPM you can also run
|
|
220
|
+
> With PNPM you can also run scripts without 'run' like `make pnpm eslint`.
|
|
197
221
|
|
|
198
222
|
## :pencil2: Editor / IDE integration
|
|
199
223
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitfactory/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "ESLint sharable config for Bitfactory projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -18,29 +18,24 @@
|
|
|
18
18
|
"vue.js"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"
|
|
22
|
-
"@babel/eslint-parser": "7.25.7",
|
|
23
|
-
"eslint": "8.57.1",
|
|
24
|
-
"eslint-plugin-import": "2.31.0",
|
|
25
|
-
"eslint-plugin-jsdoc": "50.3.1",
|
|
26
|
-
"eslint-plugin-unicorn": "56.0.0",
|
|
21
|
+
"eslint": "9.12.0",
|
|
27
22
|
"lint-staged": "15.2.10",
|
|
28
23
|
"npm-check-updates": "17.1.3",
|
|
29
24
|
"simple-git-hooks": "2.11.1"
|
|
30
25
|
},
|
|
31
26
|
"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": ">=
|
|
27
|
+
"@babel/core": "^7.24.5",
|
|
28
|
+
"@babel/eslint-parser": "^7.24.5",
|
|
29
|
+
"eslint": "^8.56.0 || ^9.0.0",
|
|
30
|
+
"eslint-plugin-import": ">=2.31.0",
|
|
31
|
+
"eslint-plugin-jsdoc": ">=47.0.0",
|
|
32
|
+
"eslint-plugin-unicorn": ">=56.0.0"
|
|
38
33
|
},
|
|
39
34
|
"engines": {
|
|
40
35
|
"node": "^18.18.0 || ^20.9.0"
|
|
41
36
|
},
|
|
42
37
|
"scripts": {
|
|
43
|
-
"eslint": "eslint '**/*.{cjs,js,mjs}'",
|
|
38
|
+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{cjs,js,mjs}'",
|
|
44
39
|
"eslint:fix": "pnpm run eslint --fix",
|
|
45
40
|
"update:interactive": "pnpm exec npm-check-updates -i",
|
|
46
41
|
"update:minor": "pnpm exec npm-check-updates -i -t minor",
|