@bitfactory/eslint-config 5.1.3 → 6.0.1
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 +75 -58
- package/package.json +38 -12
- package/index.js +0 -53
- package/rules/errors.js +0 -9
- package/rules/es6.js +0 -42
- package/rules/jsdoc.js +0 -9
- package/rules/practices.js +0 -66
- package/rules/style.js +0 -53
- package/rules/stylistic.js +0 -118
- package/rules/variables.js +0 -11
- package/rules/vue.js +0 -30
- package/typescript.js +0 -27
- package/vue.js +0 -22
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @bitfactory/eslint-config
|
|
2
2
|
|
|
3
|
-
[](https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory)
|
|
4
4
|
[](https://lbesson.mit-license.org/)
|
|
5
|
-
[](https://eslint.org/)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/actions/workflows/npm-publish.yml)
|
|
8
8
|
[](https://npmjs.com/package/@bitfactory/eslint-config)
|
|
@@ -10,12 +10,9 @@
|
|
|
10
10
|
This is a shareable config for [ESLint](https://eslint.org). All the rules and configurations are already set. Rules can be overridden if needed.
|
|
11
11
|
|
|
12
12
|
> [!IMPORTANT]
|
|
13
|
-
> **ESLint v9+
|
|
13
|
+
> **This package now supports only ESLint v9+ Flat Config (ESM).** Legacy `.eslintrc.*` configurations are no longer supported as of v6.0.0. See [:rocket: ESLint v9+ Flat Config Usage](#rocket-eslint-v9-flat-config-usage) for usage examples.
|
|
14
14
|
>
|
|
15
|
-
>
|
|
16
|
-
>
|
|
17
|
-
> Choose the method that matches your ESLint version and project setup. Legacy will be deprecated in a next major version.
|
|
18
|
-
> See also the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
|
|
15
|
+
> For legacy `.eslintrc.*` support, use v5.x. See the Release Roadmap <https://github.com/bitfactory-nl/shared-npm-eslint-config-bitfactory/issues/83>
|
|
19
16
|
|
|
20
17
|
- [@bitfactory/eslint-config](#bitfactoryeslint-config)
|
|
21
18
|
- [:technologist: Development](#technologist-development)
|
|
@@ -93,12 +90,12 @@ make npx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
|
93
90
|
make pnpm dlx "install-peerdeps --dev --extra-args="-E" @bitfactory/eslint-config"
|
|
94
91
|
```
|
|
95
92
|
|
|
96
|
-
|
|
93
|
+
Create an `eslint.config.js` file in your project root with the following contents:
|
|
97
94
|
|
|
98
95
|
```js
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
import base from '@bitfactory/eslint-config';
|
|
97
|
+
|
|
98
|
+
export default [...base];
|
|
102
99
|
```
|
|
103
100
|
|
|
104
101
|
### Vue.js projects
|
|
@@ -113,12 +110,12 @@ make npm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility --save-dev --sav
|
|
|
113
110
|
make pnpm "i eslint-plugin-vue eslint-plugin-vuejs-accessibility --save-dev --save-exact"
|
|
114
111
|
```
|
|
115
112
|
|
|
116
|
-
|
|
113
|
+
Create an `eslint.config.js` file with the Vue config:
|
|
117
114
|
|
|
118
115
|
```js
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
117
|
+
|
|
118
|
+
export default [...vue];
|
|
122
119
|
```
|
|
123
120
|
|
|
124
121
|
#### Vue 3 extra configuration
|
|
@@ -126,16 +123,18 @@ module.exports = {
|
|
|
126
123
|
> [!IMPORTANT]
|
|
127
124
|
> For Vue 3 TypeScript is mandatory, so [install the TS packages](#typescript-projects) as described in the TypeScript section.
|
|
128
125
|
|
|
129
|
-
|
|
126
|
+
For Vue 3 projects, combine Vue and TypeScript configs:
|
|
130
127
|
|
|
131
128
|
```js
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
130
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
131
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
132
|
+
|
|
133
|
+
export default [
|
|
134
|
+
...vue,
|
|
135
|
+
...vuePlugin.configs['flat/vue3-recommended'],
|
|
136
|
+
...ts,
|
|
137
|
+
];
|
|
139
138
|
```
|
|
140
139
|
|
|
141
140
|
### TypeScript projects
|
|
@@ -146,19 +145,19 @@ To use this config with a TypeScript project _also_ install the following packag
|
|
|
146
145
|
> Check and make sure a compatible TypeScript version is installed. Can be added with: `make [p]npm i typescript`.
|
|
147
146
|
|
|
148
147
|
```shell
|
|
149
|
-
make npm "i @typescript-eslint/eslint-plugin @typescript-eslint/
|
|
148
|
+
make npm "i @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev --save-exact"
|
|
150
149
|
```
|
|
151
150
|
|
|
152
151
|
```shell
|
|
153
152
|
make pnpm "i @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev --save-exact"
|
|
154
153
|
```
|
|
155
154
|
|
|
156
|
-
|
|
155
|
+
Create an `eslint.config.js` file with the TypeScript config:
|
|
157
156
|
|
|
158
157
|
```js
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
159
|
+
|
|
160
|
+
export default [...ts];
|
|
162
161
|
```
|
|
163
162
|
|
|
164
163
|
### Vue.js, TypeScript and regular JavaScript together
|
|
@@ -169,36 +168,34 @@ To use this config with a Vue.js, TypeScript and regular JavaScript together in
|
|
|
169
168
|
- [Vue.js projects](#vuejs-projects)
|
|
170
169
|
- [TypeScript projects](#typescript-projects)
|
|
171
170
|
|
|
172
|
-
|
|
171
|
+
Create an `eslint.config.js` file combining all configs:
|
|
173
172
|
|
|
174
173
|
```js
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
175
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
176
|
+
// import vuePlugin from 'eslint-plugin-vue'; // <-- add this only for Vue 3
|
|
177
|
+
|
|
178
|
+
export default [
|
|
179
|
+
...vue,
|
|
180
|
+
// ...vuePlugin.configs['flat/vue3-recommended'], // <-- add this only for Vue 3
|
|
181
|
+
...ts,
|
|
182
|
+
];
|
|
182
183
|
```
|
|
183
184
|
|
|
184
185
|
## :rocket: CLI usage
|
|
185
186
|
|
|
186
|
-
> [!WARNING]
|
|
187
|
-
> **You only need to set `ESLINT_USE_FLAT_CONFIG=false` in your scripts if you are using the legacy config (`.eslintrc.js`).**
|
|
188
|
-
> For Flat Config (`eslint.config.js` and `*.flat.js`), do not set this variable—ESLint v9+ uses Flat Config by default.
|
|
189
|
-
|
|
190
187
|
To use ESLint in the command-line, add the following scripts to your projects `package.json`:
|
|
191
188
|
|
|
192
189
|
```json
|
|
193
190
|
"scripts": {
|
|
194
|
-
"eslint": "
|
|
191
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
195
192
|
"eslint:fix": "npm run eslint -- --fix"
|
|
196
193
|
}
|
|
197
194
|
```
|
|
198
195
|
|
|
199
196
|
```json
|
|
200
197
|
"scripts": {
|
|
201
|
-
"eslint": "
|
|
198
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs}'",
|
|
202
199
|
"eslint:fix": "pnpm run eslint --fix"
|
|
203
200
|
}
|
|
204
201
|
```
|
|
@@ -207,14 +204,14 @@ To also check Vue.js files:
|
|
|
207
204
|
|
|
208
205
|
```json
|
|
209
206
|
"scripts": {
|
|
210
|
-
"eslint": "
|
|
207
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
211
208
|
"eslint:fix": "npm run eslint -- --fix"
|
|
212
209
|
}
|
|
213
210
|
```
|
|
214
211
|
|
|
215
212
|
```json
|
|
216
213
|
"scripts": {
|
|
217
|
-
"eslint": "
|
|
214
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,vue}'",
|
|
218
215
|
"eslint:fix": "pnpm run eslint --fix"
|
|
219
216
|
}
|
|
220
217
|
```
|
|
@@ -223,14 +220,14 @@ Or TypeScript files:
|
|
|
223
220
|
|
|
224
221
|
```json
|
|
225
222
|
"scripts": {
|
|
226
|
-
"eslint": "
|
|
223
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
227
224
|
"eslint:fix": "npm run eslint -- --fix"
|
|
228
225
|
}
|
|
229
226
|
```
|
|
230
227
|
|
|
231
228
|
```json
|
|
232
229
|
"scripts": {
|
|
233
|
-
"eslint": "
|
|
230
|
+
"eslint": "eslint 'path/to/your/assets/**/*.{cjs,js,mjs,ts,tsx}'",
|
|
234
231
|
"eslint:fix": "pnpm run eslint --fix"
|
|
235
232
|
}
|
|
236
233
|
```
|
|
@@ -326,20 +323,40 @@ Or import the following xml file:
|
|
|
326
323
|
## :rocket: ESLint v9+ Flat Config Usage
|
|
327
324
|
|
|
328
325
|
> [!IMPORTANT]
|
|
329
|
-
> ESLint v9+ uses Flat Config by default. This package now provides ESM-based Flat Config entry points for modern usage
|
|
326
|
+
> ESLint v9+ uses Flat Config by default. This package now provides ESM-based Flat Config entry points for modern usage.
|
|
327
|
+
|
|
328
|
+
### Available Exports
|
|
329
|
+
|
|
330
|
+
This package provides clean import paths for all configurations:
|
|
331
|
+
|
|
332
|
+
```js
|
|
333
|
+
// Main entry point (base JavaScript rules)
|
|
334
|
+
import base from '@bitfactory/eslint-config';
|
|
335
|
+
|
|
336
|
+
// TypeScript configuration
|
|
337
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
338
|
+
|
|
339
|
+
// Vue.js configuration
|
|
340
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
> **Legacy paths**: For backward compatibility, the full file paths are still supported:
|
|
344
|
+
>
|
|
345
|
+
> - `@bitfactory/eslint-config/typescript.flat.js`
|
|
346
|
+
> - `@bitfactory/eslint-config/vue.flat.js`
|
|
330
347
|
|
|
331
348
|
### Flat Config Entry Points
|
|
332
349
|
|
|
333
|
-
- **Base JS config:** `index.flat.js`
|
|
334
|
-
- **TypeScript config:** `typescript.flat.js`
|
|
335
|
-
- **Vue config:** `vue.flat.js`
|
|
350
|
+
- **Base JS config:** Clean path `@bitfactory/eslint-config` or legacy `index.flat.js`
|
|
351
|
+
- **TypeScript config:** Clean path `@bitfactory/eslint-config/typescript` or legacy `typescript.flat.js`
|
|
352
|
+
- **Vue config:** Clean path `@bitfactory/eslint-config/vue` or legacy `vue.flat.js`
|
|
336
353
|
|
|
337
354
|
### Example: Using Only the Base Config
|
|
338
355
|
|
|
339
356
|
Create an `eslint.config.js` in your project root:
|
|
340
357
|
|
|
341
358
|
```js
|
|
342
|
-
import base from '@bitfactory/eslint-config
|
|
359
|
+
import base from '@bitfactory/eslint-config';
|
|
343
360
|
|
|
344
361
|
export default [
|
|
345
362
|
...base,
|
|
@@ -349,8 +366,8 @@ export default [
|
|
|
349
366
|
### Example: TypeScript Project
|
|
350
367
|
|
|
351
368
|
```js
|
|
352
|
-
import base from '@bitfactory/eslint-config
|
|
353
|
-
import ts from '@bitfactory/eslint-config/typescript
|
|
369
|
+
import base from '@bitfactory/eslint-config';
|
|
370
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
354
371
|
|
|
355
372
|
export default [
|
|
356
373
|
...base,
|
|
@@ -361,8 +378,8 @@ export default [
|
|
|
361
378
|
### Example: Vue Project
|
|
362
379
|
|
|
363
380
|
```js
|
|
364
|
-
import base from '@bitfactory/eslint-config
|
|
365
|
-
import vue from '@bitfactory/eslint-config/vue
|
|
381
|
+
import base from '@bitfactory/eslint-config';
|
|
382
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
366
383
|
|
|
367
384
|
export default [
|
|
368
385
|
...base,
|
|
@@ -373,9 +390,9 @@ export default [
|
|
|
373
390
|
### Example: Combined Vue + TypeScript + JS
|
|
374
391
|
|
|
375
392
|
```js
|
|
376
|
-
import base from '@bitfactory/eslint-config
|
|
377
|
-
import ts from '@bitfactory/eslint-config/typescript
|
|
378
|
-
import vue from '@bitfactory/eslint-config/vue
|
|
393
|
+
import base from '@bitfactory/eslint-config';
|
|
394
|
+
import ts from '@bitfactory/eslint-config/typescript';
|
|
395
|
+
import vue from '@bitfactory/eslint-config/vue';
|
|
379
396
|
|
|
380
397
|
export default [
|
|
381
398
|
...base,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitfactory/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "ESLint sharable config for Bitfactory projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -9,14 +9,19 @@
|
|
|
9
9
|
"repository": "https://github.com/Bitfactory-NL/shared-npm-eslint-config-bitfactory",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "Bitfactory",
|
|
12
|
-
"
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./index.flat.js",
|
|
15
|
+
"./typescript": "./typescript.flat.js",
|
|
16
|
+
"./vue": "./vue.flat.js",
|
|
17
|
+
"./typescript.flat.js": "./typescript.flat.js",
|
|
18
|
+
"./vue.flat.js": "./vue.flat.js"
|
|
19
|
+
},
|
|
20
|
+
"main": "index.flat.js",
|
|
13
21
|
"files": [
|
|
14
22
|
"rules",
|
|
15
|
-
"index.js",
|
|
16
23
|
"index.flat.js",
|
|
17
|
-
"typescript.js",
|
|
18
24
|
"typescript.flat.js",
|
|
19
|
-
"vue.js",
|
|
20
25
|
"vue.flat.js",
|
|
21
26
|
"README.md"
|
|
22
27
|
],
|
|
@@ -29,12 +34,35 @@
|
|
|
29
34
|
"peerDependencies": {
|
|
30
35
|
"@babel/core": ">=7.26.10",
|
|
31
36
|
"@babel/eslint-parser": ">=7.26.10",
|
|
37
|
+
"@eslint/js": "^9.0.0",
|
|
32
38
|
"@stylistic/eslint-plugin": ">=2.6.0 <4.0.0",
|
|
33
|
-
"eslint": "
|
|
39
|
+
"@typescript-eslint/eslint-plugin": ">=7.0.0",
|
|
40
|
+
"@typescript-eslint/parser": ">=7.0.0",
|
|
41
|
+
"eslint": "^9.0.0",
|
|
34
42
|
"eslint-plugin-import": ">=2.31.0",
|
|
35
43
|
"eslint-plugin-jsdoc": ">=47.0.0",
|
|
36
|
-
"eslint-plugin-unicorn": ">=56.0.1 <
|
|
37
|
-
"
|
|
44
|
+
"eslint-plugin-unicorn": ">=56.0.1 <59.0.0",
|
|
45
|
+
"eslint-plugin-vue": ">=9.0.0",
|
|
46
|
+
"eslint-plugin-vuejs-accessibility": ">=0.5.0",
|
|
47
|
+
"globals": ">=16.2.0",
|
|
48
|
+
"vue-eslint-parser": ">=9.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@typescript-eslint/eslint-plugin": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"@typescript-eslint/parser": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"eslint-plugin-vue": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"eslint-plugin-vuejs-accessibility": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"vue-eslint-parser": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
38
66
|
},
|
|
39
67
|
"engines": {
|
|
40
68
|
"node": "^20.9.0 || ^22.11.0"
|
|
@@ -42,10 +70,8 @@
|
|
|
42
70
|
"scripts": {
|
|
43
71
|
"eslint": "eslint '**/*.{cjs,js,mjs}'",
|
|
44
72
|
"eslint:fix": "pnpm run eslint --fix",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"lint": "pnpm run eslint && pnpm run eslint:legacy",
|
|
48
|
-
"lint:fix": "pnpm run eslint:fix && pnpm run eslint:legacy:fix",
|
|
73
|
+
"lint": "pnpm run eslint",
|
|
74
|
+
"lint:fix": "pnpm run eslint:fix",
|
|
49
75
|
"update:interactive": "pnpm exec npm-check-updates -i",
|
|
50
76
|
"update:minor": "pnpm exec npm-check-updates -i -t minor",
|
|
51
77
|
"update:patch": "pnpm exec npm-check-updates -t patch"
|
package/index.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
env: {
|
|
5
|
-
browser: true,
|
|
6
|
-
es2021: true,
|
|
7
|
-
node: true,
|
|
8
|
-
},
|
|
9
|
-
extends: [
|
|
10
|
-
'eslint:recommended',
|
|
11
|
-
'plugin:@stylistic/recommended-extends',
|
|
12
|
-
'plugin:jsdoc/recommended',
|
|
13
|
-
'plugin:unicorn/recommended',
|
|
14
|
-
'./rules/errors',
|
|
15
|
-
'./rules/es6',
|
|
16
|
-
'./rules/jsdoc',
|
|
17
|
-
'./rules/practices',
|
|
18
|
-
'./rules/style',
|
|
19
|
-
'./rules/stylistic',
|
|
20
|
-
'./rules/variables',
|
|
21
|
-
],
|
|
22
|
-
ignorePatterns: [
|
|
23
|
-
'!.stylelintrc.js',
|
|
24
|
-
'/.nuxt/**',
|
|
25
|
-
'/dist/**',
|
|
26
|
-
'/static/sw.*',
|
|
27
|
-
],
|
|
28
|
-
overrides: [
|
|
29
|
-
{
|
|
30
|
-
files: ['**/*.cjs'],
|
|
31
|
-
env: {
|
|
32
|
-
node: true,
|
|
33
|
-
},
|
|
34
|
-
parserOptions: {
|
|
35
|
-
sourceType: 'script',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
files: ['**/*.js'],
|
|
40
|
-
parser: '@babel/eslint-parser',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
parserOptions: {
|
|
44
|
-
ecmaVersion: 2021,
|
|
45
|
-
requireConfigFile: false,
|
|
46
|
-
sourceType: 'module',
|
|
47
|
-
},
|
|
48
|
-
plugins: [
|
|
49
|
-
'@stylistic',
|
|
50
|
-
'jsdoc',
|
|
51
|
-
'unicorn',
|
|
52
|
-
],
|
|
53
|
-
};
|
package/rules/errors.js
DELETED
package/rules/es6.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
plugins: [
|
|
5
|
-
'import',
|
|
6
|
-
],
|
|
7
|
-
rules: {
|
|
8
|
-
'arrow-body-style': ['error', 'as-needed'],
|
|
9
|
-
'import/no-duplicates': ['error'],
|
|
10
|
-
'no-duplicate-imports': [
|
|
11
|
-
'error',
|
|
12
|
-
{
|
|
13
|
-
includeExports: true,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
'no-useless-computed-key': 'error',
|
|
17
|
-
'no-useless-rename': 'error',
|
|
18
|
-
'no-var': 'error',
|
|
19
|
-
'object-shorthand': [
|
|
20
|
-
'error',
|
|
21
|
-
'always',
|
|
22
|
-
{
|
|
23
|
-
avoidQuotes: true,
|
|
24
|
-
ignoreConstructors: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
'prefer-arrow-callback': 'error',
|
|
28
|
-
'prefer-const': 'error',
|
|
29
|
-
'prefer-destructuring': [
|
|
30
|
-
'error',
|
|
31
|
-
{
|
|
32
|
-
array: false,
|
|
33
|
-
object: true,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
'prefer-numeric-literals': 'error',
|
|
37
|
-
'prefer-rest-params': 'error',
|
|
38
|
-
'prefer-spread': 'error',
|
|
39
|
-
'prefer-template': 'error',
|
|
40
|
-
'symbol-description': 'error',
|
|
41
|
-
},
|
|
42
|
-
};
|
package/rules/jsdoc.js
DELETED
package/rules/practices.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
'array-callback-return': 'error',
|
|
6
|
-
'block-scoped-var': 'error',
|
|
7
|
-
'complexity': ['error', 10],
|
|
8
|
-
'consistent-return': 'error',
|
|
9
|
-
'curly': ['error', 'all'],
|
|
10
|
-
'dot-notation': 'error',
|
|
11
|
-
'eqeqeq': 'error',
|
|
12
|
-
'guard-for-in': 'error',
|
|
13
|
-
'max-classes-per-file': 'error',
|
|
14
|
-
'no-alert': 'error',
|
|
15
|
-
'no-caller': 'error',
|
|
16
|
-
'no-div-regex': 'error',
|
|
17
|
-
'no-else-return': 'error',
|
|
18
|
-
'no-empty-function': 'error',
|
|
19
|
-
'no-eval': 'error',
|
|
20
|
-
'no-extend-native': 'error',
|
|
21
|
-
'no-extra-bind': 'error',
|
|
22
|
-
'no-extra-label': 'error',
|
|
23
|
-
'no-implicit-coercion': 'error',
|
|
24
|
-
'no-implicit-globals': 'error',
|
|
25
|
-
'no-implied-eval': 'error',
|
|
26
|
-
'no-iterator': 'error',
|
|
27
|
-
'no-labels': 'error',
|
|
28
|
-
'no-lone-blocks': 'error',
|
|
29
|
-
'no-loop-func': 'error',
|
|
30
|
-
'no-multi-str': 'error',
|
|
31
|
-
'no-new-func': 'error',
|
|
32
|
-
'no-new-wrappers': 'error',
|
|
33
|
-
'no-octal-escape': 'error',
|
|
34
|
-
'no-param-reassign': 'error',
|
|
35
|
-
'no-proto': 'error',
|
|
36
|
-
'no-return-assign': 'warn',
|
|
37
|
-
'no-return-await': 'error',
|
|
38
|
-
'no-script-url': 'error',
|
|
39
|
-
'no-self-compare': 'error',
|
|
40
|
-
'no-sequences': 'error',
|
|
41
|
-
'no-throw-literal': 'error',
|
|
42
|
-
'no-unmodified-loop-condition': 'error',
|
|
43
|
-
'no-unused-expressions': 'error',
|
|
44
|
-
'no-useless-call': 'error',
|
|
45
|
-
'no-useless-concat': 'error',
|
|
46
|
-
'no-useless-return': 'error',
|
|
47
|
-
'no-void': 'error',
|
|
48
|
-
'no-warning-comments': 'error',
|
|
49
|
-
'prefer-promise-reject-errors': 'error',
|
|
50
|
-
'radix': 'error',
|
|
51
|
-
'require-await': 'error',
|
|
52
|
-
'unicorn/filename-case': [
|
|
53
|
-
'error',
|
|
54
|
-
{
|
|
55
|
-
cases: {
|
|
56
|
-
kebabCase: true,
|
|
57
|
-
pascalCase: true,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
'unicorn/no-null': 0,
|
|
62
|
-
'unicorn/no-reduce': 0,
|
|
63
|
-
'vars-on-top': 'error',
|
|
64
|
-
'yoda': 'error',
|
|
65
|
-
},
|
|
66
|
-
};
|
package/rules/style.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
'camelcase': 'error',
|
|
6
|
-
'consistent-this': 'error',
|
|
7
|
-
'func-name-matching': 'error',
|
|
8
|
-
'func-names': ['error', 'never'],
|
|
9
|
-
'func-style': 'error',
|
|
10
|
-
'max-depth': 'error',
|
|
11
|
-
'max-lines': 'warn',
|
|
12
|
-
'max-lines-per-function': [
|
|
13
|
-
'warn',
|
|
14
|
-
{
|
|
15
|
-
skipBlankLines: true,
|
|
16
|
-
skipComments: true,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
'max-params': 'error',
|
|
20
|
-
'max-statements': 'warn',
|
|
21
|
-
'new-cap': 'error',
|
|
22
|
-
'no-array-constructor': 'error',
|
|
23
|
-
'no-lonely-if': 'error',
|
|
24
|
-
'no-multi-assign': 'error',
|
|
25
|
-
'no-negated-condition': 'error',
|
|
26
|
-
'no-new-object': 'error',
|
|
27
|
-
'no-plusplus': [
|
|
28
|
-
'error',
|
|
29
|
-
{
|
|
30
|
-
allowForLoopAfterthoughts: true,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
'no-underscore-dangle': [
|
|
34
|
-
'error',
|
|
35
|
-
{
|
|
36
|
-
enforceInMethodNames: true,
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
'no-unneeded-ternary': [
|
|
40
|
-
'error',
|
|
41
|
-
{
|
|
42
|
-
defaultAssignment: false,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
'one-var': ['error', 'never'],
|
|
46
|
-
'operator-assignment': 'error',
|
|
47
|
-
'prefer-object-spread': 'error',
|
|
48
|
-
'sort-imports': ['error', {
|
|
49
|
-
ignoreDeclarationSort: true,
|
|
50
|
-
}],
|
|
51
|
-
'sort-vars': 'error',
|
|
52
|
-
},
|
|
53
|
-
};
|
package/rules/stylistic.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
6
|
-
'@stylistic/array-bracket-spacing': 'error',
|
|
7
|
-
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
8
|
-
'@stylistic/arrow-parens': ['error', 'as-needed'],
|
|
9
|
-
'@stylistic/arrow-spacing': 'error',
|
|
10
|
-
'@stylistic/block-spacing': 'error',
|
|
11
|
-
'@stylistic/brace-style': ['error', '1tbs'],
|
|
12
|
-
'@stylistic/comma-dangle': ['error', 'always-multiline'],
|
|
13
|
-
'@stylistic/comma-spacing': 'error',
|
|
14
|
-
'@stylistic/comma-style': 'error',
|
|
15
|
-
'@stylistic/computed-property-spacing': 'error',
|
|
16
|
-
'@stylistic/eol-last': 'error',
|
|
17
|
-
'@stylistic/generator-star-spacing': ['error', 'after'],
|
|
18
|
-
'@stylistic/implicit-arrow-linebreak': 'error',
|
|
19
|
-
'@stylistic/indent': ['error', 4, {
|
|
20
|
-
SwitchCase: 1,
|
|
21
|
-
}],
|
|
22
|
-
'@stylistic/indent-binary-ops': ['error', 4],
|
|
23
|
-
'@stylistic/key-spacing': 'error',
|
|
24
|
-
'@stylistic/keyword-spacing': 'error',
|
|
25
|
-
'@stylistic/line-comment-position': 'error',
|
|
26
|
-
'@stylistic/linebreak-style': 'error',
|
|
27
|
-
'@stylistic/lines-between-class-members': 'error',
|
|
28
|
-
'@stylistic/max-len': ['warn', {
|
|
29
|
-
code: 120,
|
|
30
|
-
}],
|
|
31
|
-
'@stylistic/max-statements-per-line': 'error',
|
|
32
|
-
'@stylistic/member-delimiter-style': ['error', {
|
|
33
|
-
multiline: {
|
|
34
|
-
delimiter: 'semi',
|
|
35
|
-
requireLast: true,
|
|
36
|
-
},
|
|
37
|
-
singleline: {
|
|
38
|
-
delimiter: 'semi',
|
|
39
|
-
requireLast: false,
|
|
40
|
-
},
|
|
41
|
-
multilineDetection: 'brackets',
|
|
42
|
-
}],
|
|
43
|
-
'@stylistic/multiline-comment-style': ['error', 'separate-lines'],
|
|
44
|
-
'@stylistic/multiline-ternary': ['error', 'never'],
|
|
45
|
-
'@stylistic/new-parens': 'error',
|
|
46
|
-
'@stylistic/newline-per-chained-call': 'error',
|
|
47
|
-
'@stylistic/no-confusing-arrow': 'error',
|
|
48
|
-
'@stylistic/no-extra-parens': ['error', 'functions'],
|
|
49
|
-
'@stylistic/no-floating-decimal': 'error',
|
|
50
|
-
'@stylistic/no-mixed-operators': 'error',
|
|
51
|
-
'@stylistic/no-multi-spaces': 'error',
|
|
52
|
-
'@stylistic/no-multiple-empty-lines': ['error', {
|
|
53
|
-
max: 1,
|
|
54
|
-
}],
|
|
55
|
-
'@stylistic/no-tabs': 'error',
|
|
56
|
-
'@stylistic/no-trailing-spaces': 'error',
|
|
57
|
-
'@stylistic/no-whitespace-before-property': 'error',
|
|
58
|
-
'@stylistic/object-curly-newline': ['error', {
|
|
59
|
-
ExportDeclaration: {
|
|
60
|
-
minProperties: 2,
|
|
61
|
-
multiline: true,
|
|
62
|
-
},
|
|
63
|
-
ImportDeclaration: {
|
|
64
|
-
minProperties: 4,
|
|
65
|
-
multiline: true,
|
|
66
|
-
},
|
|
67
|
-
ObjectExpression: {
|
|
68
|
-
minProperties: 1,
|
|
69
|
-
multiline: true,
|
|
70
|
-
},
|
|
71
|
-
ObjectPattern: {
|
|
72
|
-
minProperties: 4,
|
|
73
|
-
multiline: true,
|
|
74
|
-
},
|
|
75
|
-
}],
|
|
76
|
-
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
77
|
-
'@stylistic/object-property-newline': 'error',
|
|
78
|
-
'@stylistic/one-var-declaration-per-line': ['error', 'always'],
|
|
79
|
-
'@stylistic/operator-linebreak': ['error', 'after'],
|
|
80
|
-
'@stylistic/padding-line-between-statements': ['error', {
|
|
81
|
-
blankLine: 'always',
|
|
82
|
-
next: 'return',
|
|
83
|
-
prev: '*',
|
|
84
|
-
}],
|
|
85
|
-
'@stylistic/rest-spread-spacing': 'error',
|
|
86
|
-
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
87
|
-
'@stylistic/quotes': ['error', 'single', {
|
|
88
|
-
allowTemplateLiterals: false,
|
|
89
|
-
avoidEscape: true,
|
|
90
|
-
}],
|
|
91
|
-
'@stylistic/semi': ['error', 'always'],
|
|
92
|
-
'@stylistic/semi-style': 'error',
|
|
93
|
-
'@stylistic/space-before-blocks': 'error',
|
|
94
|
-
'@stylistic/space-before-function-paren': ['error', 'never'],
|
|
95
|
-
'@stylistic/space-in-parens': 'error',
|
|
96
|
-
'@stylistic/space-infix-ops': 'error',
|
|
97
|
-
'@stylistic/space-unary-ops': ['error', {
|
|
98
|
-
nonwords: false,
|
|
99
|
-
words: true,
|
|
100
|
-
}],
|
|
101
|
-
'@stylistic/spaced-comment': 'error',
|
|
102
|
-
'@stylistic/switch-colon-spacing': 'error',
|
|
103
|
-
'@stylistic/template-curly-spacing': 'error',
|
|
104
|
-
'@stylistic/template-tag-spacing': 'error',
|
|
105
|
-
'@stylistic/type-annotation-spacing': ['error', {
|
|
106
|
-
before: false,
|
|
107
|
-
after: true,
|
|
108
|
-
overrides: {
|
|
109
|
-
arrow: {
|
|
110
|
-
before: true,
|
|
111
|
-
after: true,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
}],
|
|
115
|
-
'@stylistic/wrap-regex': 'error',
|
|
116
|
-
'@stylistic/yield-star-spacing': ['error', 'after'],
|
|
117
|
-
},
|
|
118
|
-
};
|
package/rules/variables.js
DELETED
package/rules/vue.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
'vuejs-accessibility/media-has-caption': 'off',
|
|
6
|
-
'vue/block-tag-newline': [
|
|
7
|
-
'error',
|
|
8
|
-
{
|
|
9
|
-
multiline: 'always',
|
|
10
|
-
singleline: 'always',
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
'vue/component-name-in-template-casing': [
|
|
14
|
-
'error',
|
|
15
|
-
'PascalCase',
|
|
16
|
-
{
|
|
17
|
-
registeredComponentsOnly: false,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
'vue/attributes-order': ['error', {
|
|
21
|
-
alphabetical: true,
|
|
22
|
-
}],
|
|
23
|
-
'vue/html-indent': ['error', 4],
|
|
24
|
-
'vue/no-empty-component-block': 'error',
|
|
25
|
-
'vue/no-template-target-blank': 'error',
|
|
26
|
-
'vue/padding-line-between-blocks': ['error', 'always'],
|
|
27
|
-
'vue/singleline-html-element-content-newline': 'off',
|
|
28
|
-
'vue/v-on-function-call': 'error',
|
|
29
|
-
},
|
|
30
|
-
};
|
package/typescript.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
const base = require('.');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
...base,
|
|
7
|
-
overrides: [
|
|
8
|
-
...base.overrides,
|
|
9
|
-
{
|
|
10
|
-
extends: [
|
|
11
|
-
'plugin:@typescript-eslint/recommended',
|
|
12
|
-
],
|
|
13
|
-
files: ['**/*.ts'],
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
rules: {
|
|
16
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
17
|
-
'warn',
|
|
18
|
-
{
|
|
19
|
-
fixStyle: 'inline-type-imports',
|
|
20
|
-
prefer: 'type-imports',
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
'no-duplicate-imports': 'off',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
};
|
package/vue.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
|
|
3
|
-
const base = require('.');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
...base,
|
|
7
|
-
overrides: [
|
|
8
|
-
...base.overrides,
|
|
9
|
-
{
|
|
10
|
-
extends: [
|
|
11
|
-
'plugin:vue/recommended',
|
|
12
|
-
'plugin:vuejs-accessibility/recommended',
|
|
13
|
-
'./rules/vue',
|
|
14
|
-
],
|
|
15
|
-
files: ['**/*.vue'],
|
|
16
|
-
parser: 'vue-eslint-parser',
|
|
17
|
-
parserOptions: {
|
|
18
|
-
parser: '@babel/eslint-parser',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|