@putout/eslint-config 7.3.0 → 8.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 +1 -4
- package/eslintrc.js +88 -63
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -17,9 +17,7 @@ Create file `.eslintrc.json` in root of your project with content:
|
|
|
17
17
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
|
20
|
-
"extends": [
|
|
21
|
-
"@putout"
|
|
22
|
-
]
|
|
20
|
+
"extends": ["@putout"]
|
|
23
21
|
}
|
|
24
22
|
```
|
|
25
23
|
|
|
@@ -48,7 +46,6 @@ export default {
|
|
|
48
46
|
```sh
|
|
49
47
|
$ npm run lint
|
|
50
48
|
$ npm run fix:lint
|
|
51
|
-
|
|
52
49
|
```
|
|
53
50
|
|
|
54
51
|
## License
|
package/eslintrc.js
CHANGED
|
@@ -1,50 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const js = require('@eslint/js');
|
|
4
|
+
|
|
3
5
|
module.exports = {
|
|
4
6
|
env: {
|
|
5
7
|
es6: true,
|
|
6
8
|
node: true,
|
|
7
9
|
},
|
|
8
10
|
parserOptions: {
|
|
9
|
-
ecmaVersion:
|
|
11
|
+
ecmaVersion: 2023,
|
|
10
12
|
sourceType: 'module',
|
|
11
13
|
ecmaFeatures: {
|
|
12
14
|
jsx: true,
|
|
13
15
|
globalReturn: true,
|
|
14
16
|
},
|
|
15
17
|
},
|
|
18
|
+
plugins: [
|
|
19
|
+
'@stylistic',
|
|
20
|
+
'@stylistic/js',
|
|
21
|
+
],
|
|
16
22
|
rules: {
|
|
17
|
-
|
|
18
|
-
'arrow-parens': [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'comma-spacing': 'error',
|
|
23
|
+
...js.configs.recommended.rules,
|
|
24
|
+
'arrow-parens': [
|
|
25
|
+
'error',
|
|
26
|
+
'always',
|
|
27
|
+
],
|
|
23
28
|
'dot-notation': 'error',
|
|
24
|
-
'
|
|
25
|
-
'func-call-spacing': 'error',
|
|
26
|
-
'operator-linebreak': ['error', 'after', {
|
|
27
|
-
overrides: {
|
|
28
|
-
'=': 'none',
|
|
29
|
-
'|': 'before',
|
|
30
|
-
'||': 'before',
|
|
31
|
-
':': 'before',
|
|
32
|
-
'?': 'before',
|
|
33
|
-
},
|
|
34
|
-
}],
|
|
35
|
-
'function-paren-newline': ['error', 'multiline-arguments'],
|
|
36
|
-
'key-spacing': 'error',
|
|
37
|
-
'newline-per-chained-call': 'error',
|
|
38
|
-
'space-infix-ops': ['error', {
|
|
39
|
-
int32Hint: false,
|
|
40
|
-
}],
|
|
41
|
-
'space-in-parens': 'error',
|
|
42
|
-
'space-before-blocks': 'error',
|
|
43
|
-
'space-before-function-paren': ['error', {
|
|
44
|
-
anonymous: 'never',
|
|
45
|
-
named: 'never',
|
|
46
|
-
asyncArrow: 'always',
|
|
47
|
-
}],
|
|
29
|
+
'object-shorthand': 'error',
|
|
48
30
|
'prefer-arrow-callback': 'error',
|
|
49
31
|
'prefer-const': ['error', {
|
|
50
32
|
destructuring: 'all',
|
|
@@ -55,15 +37,14 @@ module.exports = {
|
|
|
55
37
|
object: false,
|
|
56
38
|
},
|
|
57
39
|
}],
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
'quotes': ['error', 'single', {
|
|
61
|
-
allowTemplateLiterals: true,
|
|
40
|
+
'no-else-return': ['error', {
|
|
41
|
+
allowElseIf: false,
|
|
62
42
|
}],
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
|
|
66
|
-
|
|
43
|
+
'no-var': 'error',
|
|
44
|
+
'no-unneeded-ternary': ['error', {
|
|
45
|
+
defaultAssignment: false,
|
|
46
|
+
}],
|
|
47
|
+
'no-useless-return': 'error',
|
|
67
48
|
'no-implicit-coercion': ['error', {
|
|
68
49
|
allow: ['~'],
|
|
69
50
|
}],
|
|
@@ -75,36 +56,81 @@ module.exports = {
|
|
|
75
56
|
'no-useless-rename': 'error',
|
|
76
57
|
'no-use-before-define': 'off',
|
|
77
58
|
'no-process-exit': 'off',
|
|
78
|
-
'
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
59
|
+
'nonblock-statement-body-position': [
|
|
60
|
+
'error',
|
|
61
|
+
'below',
|
|
62
|
+
],
|
|
63
|
+
'lines-around-directive': 'error',
|
|
64
|
+
'@stylistic/js/array-bracket-spacing': 'error',
|
|
65
|
+
'@stylistic/js/arrow-spacing': 'error',
|
|
66
|
+
'@stylistic/js/brace-style': 'error',
|
|
67
|
+
'@stylistic/js/comma-dangle': ['error', 'always-multiline'],
|
|
68
|
+
'@stylistic/js/comma-spacing': 'error',
|
|
69
|
+
'@stylistic/js/eol-last': [
|
|
70
|
+
'error',
|
|
71
|
+
'always',
|
|
72
|
+
],
|
|
73
|
+
'@stylistic/js/func-call-spacing': 'error',
|
|
74
|
+
'@stylistic/js/operator-linebreak': ['error', 'after', {
|
|
75
|
+
overrides: {
|
|
76
|
+
'=': 'none',
|
|
77
|
+
'|': 'before',
|
|
78
|
+
'||': 'before',
|
|
79
|
+
':': 'before',
|
|
80
|
+
'?': 'before',
|
|
81
|
+
},
|
|
82
|
+
}],
|
|
83
|
+
'@stylistic/js/function-paren-newline': ['error', 'multiline-arguments'],
|
|
84
|
+
'@stylistic/js/key-spacing': 'error',
|
|
85
|
+
'@stylistic/js/newline-per-chained-call': 'error',
|
|
86
|
+
'@stylistic/js/space-infix-ops': ['error', {
|
|
87
|
+
int32Hint: false,
|
|
83
88
|
}],
|
|
84
|
-
'
|
|
89
|
+
'@stylistic/js/indent': [
|
|
90
|
+
'error',
|
|
91
|
+
4,
|
|
92
|
+
],
|
|
93
|
+
'@stylistic/js/space-in-parens': 'error',
|
|
94
|
+
'@stylistic/js/space-before-blocks': 'error',
|
|
95
|
+
'@stylistic/js/space-before-function-paren': ['error', {
|
|
96
|
+
anonymous: 'never',
|
|
97
|
+
named: 'never',
|
|
98
|
+
asyncArrow: 'always',
|
|
99
|
+
}],
|
|
100
|
+
'@stylistic/js/implicit-arrow-linebreak': 'error',
|
|
101
|
+
'@stylistic/js/quotes': ['error', 'single', {
|
|
102
|
+
allowTemplateLiterals: true,
|
|
103
|
+
}],
|
|
104
|
+
'@stylistic/js/quote-props': ['error', 'consistent-as-needed'],
|
|
105
|
+
'@stylistic/js/semi': 'error',
|
|
106
|
+
'@stylistic/js/no-extra-semi': 'error',
|
|
107
|
+
'@stylistic/js/object-curly-spacing': 'error',
|
|
108
|
+
'@stylistic/js/no-extra-parens': 'error',
|
|
109
|
+
'@stylistic/js/no-multi-spaces': 'error',
|
|
110
|
+
'@stylistic/js/no-trailing-spaces': ['error', {
|
|
85
111
|
skipBlankLines: true,
|
|
86
112
|
}],
|
|
87
|
-
'no-multiple-empty-lines': ['error', {
|
|
113
|
+
'@stylistic/js/no-multiple-empty-lines': ['error', {
|
|
88
114
|
max: 1,
|
|
89
115
|
maxBOF: 0,
|
|
90
116
|
}],
|
|
91
|
-
'
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
'
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
'padding-line-between-statements': [
|
|
117
|
+
'@stylistic/js/lines-between-class-members': 'off',
|
|
118
|
+
'@stylistic/js/linebreak-style': [
|
|
119
|
+
'error',
|
|
120
|
+
'unix',
|
|
121
|
+
],
|
|
122
|
+
'@stylistic/js/padded-blocks': [
|
|
123
|
+
'error',
|
|
124
|
+
'never',
|
|
125
|
+
],
|
|
126
|
+
'@stylistic/js/padding-line-between-statements': [
|
|
127
|
+
'error',
|
|
101
128
|
...getPaddingExport(),
|
|
102
129
|
...getPaddingCjsExport(),
|
|
103
130
|
...getPaddingImport(),
|
|
104
131
|
...getPaddingCjsImport(),
|
|
105
132
|
...getPaddingIf(),
|
|
106
|
-
...getPaddingFor(),
|
|
107
|
-
{
|
|
133
|
+
...getPaddingFor(), {
|
|
108
134
|
blankLine: 'always',
|
|
109
135
|
prev: 'while',
|
|
110
136
|
next: 'return',
|
|
@@ -124,9 +150,6 @@ module.exports = {
|
|
|
124
150
|
'require-atomic-updates': 'off',
|
|
125
151
|
'yoda': 'off',
|
|
126
152
|
},
|
|
127
|
-
extends: [
|
|
128
|
-
'eslint:recommended',
|
|
129
|
-
],
|
|
130
153
|
};
|
|
131
154
|
|
|
132
155
|
function getPaddingExport() {
|
|
@@ -200,7 +223,10 @@ function getPaddingFor() {
|
|
|
200
223
|
next: 'for',
|
|
201
224
|
}, {
|
|
202
225
|
blankLine: 'always',
|
|
203
|
-
prev: [
|
|
226
|
+
prev: [
|
|
227
|
+
'const',
|
|
228
|
+
'let',
|
|
229
|
+
],
|
|
204
230
|
next: 'for',
|
|
205
231
|
}, {
|
|
206
232
|
blankLine: 'always',
|
|
@@ -226,4 +252,3 @@ function addCJS({blankLine, prev, next}) {
|
|
|
226
252
|
next,
|
|
227
253
|
};
|
|
228
254
|
}
|
|
229
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout config for ESLint",
|
|
@@ -23,7 +23,10 @@
|
|
|
23
23
|
"fix:lint": "madrun fix:lint",
|
|
24
24
|
"prepublishOnly": "madrun prepublishOnly"
|
|
25
25
|
},
|
|
26
|
-
"dependencies": {
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@eslint/js": "^8.35.0",
|
|
28
|
+
"@stylistic/eslint-plugin": "^0.1.1"
|
|
29
|
+
},
|
|
27
30
|
"peerDependencies": {
|
|
28
31
|
"eslint": ">=8.0.0"
|
|
29
32
|
},
|
|
@@ -34,8 +37,9 @@
|
|
|
34
37
|
"eslint-config"
|
|
35
38
|
],
|
|
36
39
|
"devDependencies": {
|
|
37
|
-
"@putout/test": "^
|
|
38
|
-
"c8": "^
|
|
40
|
+
"@putout/test": "^7.0.0",
|
|
41
|
+
"c8": "^8.0.0",
|
|
42
|
+
"eslint-plugin-n": "^16.0.0",
|
|
39
43
|
"madrun": "^9.0.0",
|
|
40
44
|
"putout": "*"
|
|
41
45
|
},
|