@egs33/eslint-config 4.0.1 → 4.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/base.js +13 -1
- package/package.json +1 -1
- package/plugin-rules/stylistic.js +28 -79
package/base.js
CHANGED
|
@@ -32,7 +32,19 @@ export default [
|
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
|
-
stylistic.configs.customize(
|
|
35
|
+
stylistic.configs.customize({
|
|
36
|
+
arrowParens: false,
|
|
37
|
+
blockSpacing: true,
|
|
38
|
+
braceStyle: '1tbs',
|
|
39
|
+
commaDangle: 'always-multiline',
|
|
40
|
+
flat: true,
|
|
41
|
+
indent: 2,
|
|
42
|
+
jsx: true,
|
|
43
|
+
pluginName: '@stylistic',
|
|
44
|
+
quoteProps: 'as-needed',
|
|
45
|
+
quotes: 'single',
|
|
46
|
+
semi: true,
|
|
47
|
+
}),
|
|
36
48
|
eslintJs.configs.recommended,
|
|
37
49
|
array.configs.all,
|
|
38
50
|
regexpConfig['flat/recommended'],
|
package/package.json
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export const rules = {
|
|
2
|
-
'@stylistic/dot-location': ['error', 'property'],
|
|
3
|
-
|
|
4
|
-
'@stylistic/no-floating-decimal': 'error',
|
|
5
2
|
'@stylistic/no-multi-spaces': [
|
|
6
3
|
'error', {
|
|
7
4
|
ignoreEOLComments: false,
|
|
@@ -9,38 +6,6 @@ export const rules = {
|
|
|
9
6
|
],
|
|
10
7
|
'@stylistic/wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
|
|
11
8
|
'@stylistic/arrow-parens': ['error', 'always'],
|
|
12
|
-
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
13
|
-
'@stylistic/block-spacing': ['error', 'always'],
|
|
14
|
-
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
15
|
-
'@stylistic/comma-dangle': [
|
|
16
|
-
'error', {
|
|
17
|
-
arrays: 'always-multiline',
|
|
18
|
-
objects: 'always-multiline',
|
|
19
|
-
imports: 'always-multiline',
|
|
20
|
-
exports: 'always-multiline',
|
|
21
|
-
functions: 'always-multiline',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
|
|
25
|
-
'@stylistic/comma-style': [
|
|
26
|
-
'error', 'last', {
|
|
27
|
-
exceptions: {
|
|
28
|
-
ArrayExpression: false,
|
|
29
|
-
ArrayPattern: false,
|
|
30
|
-
ArrowFunctionExpression: false,
|
|
31
|
-
CallExpression: false,
|
|
32
|
-
FunctionDeclaration: false,
|
|
33
|
-
FunctionExpression: false,
|
|
34
|
-
ImportDeclaration: false,
|
|
35
|
-
ObjectExpression: false,
|
|
36
|
-
ObjectPattern: false,
|
|
37
|
-
VariableDeclaration: false,
|
|
38
|
-
NewExpression: false,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
'@stylistic/computed-property-spacing': ['error', 'never'],
|
|
43
|
-
'@stylistic/eol-last': ['error', 'always'],
|
|
44
9
|
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
45
10
|
'@stylistic/func-call-spacing': ['error', 'never'],
|
|
46
11
|
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
|
|
@@ -67,23 +32,34 @@ export const rules = {
|
|
|
67
32
|
ImportDeclaration: 1,
|
|
68
33
|
flatTernaryExpressions: false,
|
|
69
34
|
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
|
|
70
|
-
ignoredNodes: [
|
|
35
|
+
ignoredNodes: [
|
|
36
|
+
'JSXElement',
|
|
37
|
+
'JSXElement > *',
|
|
38
|
+
'JSXAttribute',
|
|
39
|
+
'JSXIdentifier',
|
|
40
|
+
'JSXNamespacedName',
|
|
41
|
+
'JSXMemberExpression',
|
|
42
|
+
'JSXSpreadAttribute',
|
|
43
|
+
'JSXExpressionContainer',
|
|
44
|
+
'JSXOpeningElement',
|
|
45
|
+
'JSXClosingElement',
|
|
46
|
+
'JSXFragment',
|
|
47
|
+
'JSXOpeningFragment',
|
|
48
|
+
'JSXClosingFragment',
|
|
49
|
+
'JSXText',
|
|
50
|
+
'JSXEmptyExpression',
|
|
51
|
+
'JSXSpreadChild',
|
|
52
|
+
'TSUnionType',
|
|
53
|
+
// stylistic plugin customize config ignores
|
|
54
|
+
'TSIntersectionType',
|
|
55
|
+
'TSTypeParameterInstantiation',
|
|
56
|
+
'FunctionExpression > .params[decorators.length > 0]',
|
|
57
|
+
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
|
|
58
|
+
],
|
|
71
59
|
ignoreComments: false,
|
|
72
60
|
},
|
|
73
61
|
],
|
|
74
|
-
'@stylistic/jsx-quotes': ['
|
|
75
|
-
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
76
|
-
'@stylistic/keyword-spacing': [
|
|
77
|
-
'error', {
|
|
78
|
-
before: true,
|
|
79
|
-
after: true,
|
|
80
|
-
overrides: {
|
|
81
|
-
return: { after: true },
|
|
82
|
-
throw: { after: true },
|
|
83
|
-
case: { after: true },
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
62
|
+
'@stylistic/jsx-quotes': ['error', 'prefer-double'],
|
|
87
63
|
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
88
64
|
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
|
|
89
65
|
'@stylistic/lines-around-comment': 'off',
|
|
@@ -96,9 +72,8 @@ export const rules = {
|
|
|
96
72
|
ignoreTemplateLiterals: true,
|
|
97
73
|
},
|
|
98
74
|
],
|
|
99
|
-
'@stylistic/max-statements-per-line': ['
|
|
75
|
+
'@stylistic/max-statements-per-line': ['error'],
|
|
100
76
|
'@stylistic/multiline-comment-style': ['off', 'starred-block'],
|
|
101
|
-
'@stylistic/new-parens': 'error',
|
|
102
77
|
'@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
|
|
103
78
|
'@stylistic/no-mixed-operators': [
|
|
104
79
|
'error', {
|
|
@@ -112,24 +87,19 @@ export const rules = {
|
|
|
112
87
|
['%', '/'],
|
|
113
88
|
['/', '*'],
|
|
114
89
|
['&', '|', '<<', '>>', '>>>'],
|
|
115
|
-
['==', '!=', '===', '!=='],
|
|
90
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
116
91
|
['&&', '||'],
|
|
117
92
|
],
|
|
118
93
|
allowSamePrecedence: false,
|
|
119
94
|
},
|
|
120
95
|
],
|
|
121
|
-
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
122
|
-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
123
|
-
'@stylistic/no-tabs': 'error',
|
|
124
96
|
'@stylistic/no-trailing-spaces': [
|
|
125
97
|
'error', {
|
|
126
98
|
skipBlankLines: false,
|
|
127
99
|
ignoreComments: false,
|
|
128
100
|
},
|
|
129
101
|
],
|
|
130
|
-
'@stylistic/no-whitespace-before-property': 'error',
|
|
131
102
|
'@stylistic/nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
|
|
132
|
-
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
133
103
|
'@stylistic/object-curly-newline': [
|
|
134
104
|
'error', {
|
|
135
105
|
ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
|
|
@@ -145,27 +115,7 @@ export const rules = {
|
|
|
145
115
|
],
|
|
146
116
|
'@stylistic/quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
|
|
147
117
|
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
|
148
|
-
'@stylistic/semi': ['error', 'always'],
|
|
149
|
-
'@stylistic/semi-spacing': ['error', { before: false, after: true }],
|
|
150
118
|
'@stylistic/semi-style': ['error', 'last'],
|
|
151
|
-
'@stylistic/space-before-blocks': 'error',
|
|
152
|
-
'@stylistic/space-before-function-paren': [
|
|
153
|
-
'error', {
|
|
154
|
-
anonymous: 'always',
|
|
155
|
-
named: 'never',
|
|
156
|
-
asyncArrow: 'always',
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
'@stylistic/space-in-parens': ['error', 'never'],
|
|
160
|
-
'@stylistic/space-infix-ops': 'error',
|
|
161
|
-
'@stylistic/space-unary-ops': [
|
|
162
|
-
'error', {
|
|
163
|
-
words: true,
|
|
164
|
-
nonwords: false,
|
|
165
|
-
overrides: {
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
119
|
'@stylistic/spaced-comment': [
|
|
170
120
|
'error', 'always', {
|
|
171
121
|
line: {
|
|
@@ -180,8 +130,7 @@ export const rules = {
|
|
|
180
130
|
},
|
|
181
131
|
],
|
|
182
132
|
'@stylistic/switch-colon-spacing': ['error', { after: true, before: false }],
|
|
183
|
-
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
184
133
|
'@stylistic/wrap-regex': 'off',
|
|
185
134
|
'@stylistic/array-bracket-newline': 'error',
|
|
186
|
-
'@stylistic/no-extra-parens': ['error', '
|
|
135
|
+
'@stylistic/no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false, enforceForArrowConditionals: false }],
|
|
187
136
|
};
|