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

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

|
|
8
12
|
|
|
9
13
|
This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set. Rules can be overridden if needed.
|
|
10
14
|
|
|
11
15
|
- [@bitfactory/eslint-config](#bitfactoryeslint-config)
|
|
16
|
+
- [:technologist: Development](#technologist-development)
|
|
12
17
|
- [:package: Installing](#package-installing)
|
|
13
18
|
- [Vue.js projects](#vuejs-projects)
|
|
14
19
|
- [TypeScript projects](#typescript-projects)
|
|
@@ -19,18 +24,34 @@ This is a shareable config for [ESLint](https://eslint.org). All the rules and c
|
|
|
19
24
|
- [Additional Extensions](#additional-extensions)
|
|
20
25
|
- [PhpStorm](#phpstorm)
|
|
21
26
|
|
|
27
|
+
## :technologist: Development
|
|
28
|
+
|
|
29
|
+
### Publishing a new version
|
|
30
|
+
|
|
31
|
+
1. 💡 Before publishing a new version, make sure to update the version number in the `package.json` file.
|
|
32
|
+
2. Make sure to run `pnpm i` to update the `pnpm-lock.yaml` file afterwards.
|
|
33
|
+
3. In case of a minor/major update, make sure to also update the badge in the `README.md` file.
|
|
34
|
+
|
|
22
35
|
## :package: Installing
|
|
23
36
|
|
|
24
37
|
Include the config into your project:
|
|
25
38
|
|
|
26
39
|
```shell
|
|
27
|
-
npm
|
|
40
|
+
make npm "i @bitfactory/eslint-config --save-dev --save-exact"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
make pnpm "i @bitfactory/eslint-config --save-dev --save-exact"
|
|
28
45
|
```
|
|
29
46
|
|
|
30
47
|
Then install the dependencies that the config needs:
|
|
31
48
|
|
|
32
49
|
```shell
|
|
33
|
-
npx install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config
|
|
50
|
+
make npx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
make pnpx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
34
55
|
```
|
|
35
56
|
|
|
36
57
|
In your project, create an `.eslintrc.js` file with the following contents:
|
|
@@ -41,22 +62,16 @@ module.exports = {
|
|
|
41
62
|
};
|
|
42
63
|
```
|
|
43
64
|
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Publishing a new version
|
|
47
|
-
|
|
48
|
-
1. 💡 Before publishing a new version, make sure to update the version number in the `package.json` file. Make sure to run `npm install` to update the `package-lock.json` file afterwards.
|
|
49
|
-
2. In case of a minor/major update, make sure to also update the badge in the `README.md` file.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
65
|
### Vue.js projects
|
|
55
66
|
|
|
56
67
|
To use this config with a Vue.js project also install the following packages:
|
|
57
68
|
|
|
58
69
|
```shell
|
|
59
|
-
npm
|
|
70
|
+
make npm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility --save-dev --save-exact"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```shell
|
|
74
|
+
make pnpm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility --save-dev --save-exact"
|
|
60
75
|
```
|
|
61
76
|
|
|
62
77
|
And set the following extend in `.eslintrc.js`:
|
|
@@ -70,7 +85,11 @@ module.exports = {
|
|
|
70
85
|
> **_NOTE:_** Vue3 needs some extra configuration
|
|
71
86
|
|
|
72
87
|
```shell
|
|
73
|
-
npm
|
|
88
|
+
make npm "i @vue/eslint-config-typescript --save-exact --save-dev"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```shell
|
|
92
|
+
make pnpm "i @vue/eslint-config-typescript --save-exact --save-dev"
|
|
74
93
|
```
|
|
75
94
|
|
|
76
95
|
And set the following extend in `.eslintrc.js`:
|
|
@@ -86,14 +105,16 @@ module.exports = {
|
|
|
86
105
|
};
|
|
87
106
|
```
|
|
88
107
|
|
|
89
|
-
---
|
|
90
|
-
|
|
91
108
|
### TypeScript projects
|
|
92
109
|
|
|
93
110
|
To use this config with a TypeScript project also install the following packages
|
|
94
111
|
|
|
95
112
|
```shell
|
|
96
|
-
npm
|
|
113
|
+
make npm "i @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import --save-dev --save-exact"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
make pnpm "i @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import --save-dev --save-exact"
|
|
97
118
|
```
|
|
98
119
|
|
|
99
120
|
And set the following extend in `.eslintrc.js`:
|
|
@@ -104,14 +125,16 @@ module.exports = {
|
|
|
104
125
|
};
|
|
105
126
|
```
|
|
106
127
|
|
|
107
|
-
---
|
|
108
|
-
|
|
109
128
|
### Vue.js, TypeScript and regular JavaScript together
|
|
110
129
|
|
|
111
130
|
To use this config with a Vue.js, TypeScript and regular JavaScript project also install the following packages
|
|
112
131
|
|
|
113
132
|
```shell
|
|
114
|
-
npm
|
|
133
|
+
make npm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import @vue/eslint-config-typescript --save-dev --save-exact"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```shell
|
|
137
|
+
make pnpm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import @vue/eslint-config-typescript --save-dev --save-exact"
|
|
115
138
|
```
|
|
116
139
|
|
|
117
140
|
And set the following extend in `.eslintrc.js`:
|
|
@@ -131,9 +154,11 @@ module.exports = {
|
|
|
131
154
|
|
|
132
155
|
To use ESLint in the command-line, add the following scripts to your projects `package.json`:
|
|
133
156
|
|
|
157
|
+
> For PNPM use `"eslint:fix": "pnpm run eslint --fix"`
|
|
158
|
+
|
|
134
159
|
```json
|
|
135
160
|
"scripts": {
|
|
136
|
-
"eslint": "eslint 'path/to/your/assets/**/*.js'",
|
|
161
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
137
162
|
"eslint:fix": "npm run eslint -- --fix"
|
|
138
163
|
}
|
|
139
164
|
```
|
|
@@ -142,7 +167,7 @@ To also check Vue.js files:
|
|
|
142
167
|
|
|
143
168
|
```json
|
|
144
169
|
"scripts": {
|
|
145
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{js,vue}'",
|
|
170
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
146
171
|
"eslint:fix": "npm run eslint -- --fix"
|
|
147
172
|
}
|
|
148
173
|
```
|
|
@@ -151,7 +176,7 @@ Or TypeScript files:
|
|
|
151
176
|
|
|
152
177
|
```json
|
|
153
178
|
"scripts": {
|
|
154
|
-
"eslint": "eslint 'path/to/your/assets/**/*.{js,ts,tsx}'",
|
|
179
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
155
180
|
"eslint:fix": "npm run eslint -- --fix"
|
|
156
181
|
}
|
|
157
182
|
```
|
|
@@ -163,6 +188,13 @@ npm run eslint
|
|
|
163
188
|
npm run eslint:fix
|
|
164
189
|
```
|
|
165
190
|
|
|
191
|
+
```shell
|
|
192
|
+
pnpm run eslint
|
|
193
|
+
pnpm run eslint:fix
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> With PNPM you can also run script without run like `pnpm eslint`.
|
|
197
|
+
|
|
166
198
|
## :pencil2: Editor / IDE integration
|
|
167
199
|
|
|
168
200
|
For ESLint to work, you need to set up your editor / IDE.
|
|
@@ -182,6 +214,7 @@ For ESLint to work, you need to set up your editor / IDE.
|
|
|
182
214
|
```
|
|
183
215
|
|
|
184
216
|
#### Additional Extensions
|
|
217
|
+
|
|
185
218
|
- [Error Lens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) to get inline error messages
|
|
186
219
|
|
|
187
220
|
> :warning: If you have the [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extension enabled, make sure to **disable** the extension for your project's workspace. This is because Prettier's rules will conflict with ours.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitfactory/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "ESLint sharable config for Bitfactory projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -17,27 +17,33 @@
|
|
|
17
17
|
"typescript.js",
|
|
18
18
|
"vue.js"
|
|
19
19
|
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"eslint": "eslint '**/*.js'",
|
|
22
|
-
"eslint:fix": "npm run eslint -- --fix",
|
|
23
|
-
"update:interactive": "npx npm-check -uE"
|
|
24
|
-
},
|
|
25
20
|
"devDependencies": {
|
|
26
|
-
"@babel/core": "7.
|
|
27
|
-
"@babel/eslint-parser": "7.
|
|
28
|
-
"eslint": "8.
|
|
29
|
-
"eslint-plugin-import": "2.
|
|
30
|
-
"eslint-plugin-jsdoc": "
|
|
31
|
-
"eslint-plugin-unicorn": "
|
|
32
|
-
"lint-staged": "
|
|
33
|
-
"
|
|
21
|
+
"@babel/core": "7.25.7",
|
|
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": "52.0.0",
|
|
27
|
+
"lint-staged": "15.2.10",
|
|
28
|
+
"npm-check-updates": "17.1.3",
|
|
29
|
+
"simple-git-hooks": "2.11.1"
|
|
34
30
|
},
|
|
35
31
|
"peerDependencies": {
|
|
36
|
-
"@babel/core": "^7.
|
|
37
|
-
"@babel/eslint-parser": "^7.
|
|
38
|
-
"eslint": "^8.
|
|
32
|
+
"@babel/core": "^7.11.0",
|
|
33
|
+
"@babel/eslint-parser": "^7.11.0",
|
|
34
|
+
"eslint": "^8.56.0",
|
|
39
35
|
"eslint-plugin-import": "^2.25.0",
|
|
40
36
|
"eslint-plugin-jsdoc": ">=39.0.0",
|
|
41
|
-
"eslint-plugin-unicorn": ">=
|
|
37
|
+
"eslint-plugin-unicorn": ">=50.0.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "^18.12.0 || ^20.9.0"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"eslint": "eslint '**/*.{cjs,js,mjs}'",
|
|
44
|
+
"eslint:fix": "pnpm run eslint --fix",
|
|
45
|
+
"update:interactive": "pnpm exec npm-check-updates -i",
|
|
46
|
+
"update:minor": "pnpm exec npm-check-updates -i -t minor",
|
|
47
|
+
"update:patch": "pnpm exec npm-check-updates -t patch"
|
|
42
48
|
}
|
|
43
|
-
}
|
|
49
|
+
}
|