@siberiacancode/eslint 2.4.0 → 2.5.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/index.js +104 -28
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9,10 +9,10 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
9
9
|
|
|
10
10
|
if (next) {
|
|
11
11
|
configs.unshift({
|
|
12
|
+
name: 'siberiacancode/next',
|
|
12
13
|
plugins: {
|
|
13
14
|
'siberiacancode-next': pluginNext
|
|
14
15
|
},
|
|
15
|
-
name: 'siberiacancode/next',
|
|
16
16
|
rules: {
|
|
17
17
|
...Object.entries({ ...pluginNext.configs.recommended.rules }).reduce(
|
|
18
18
|
(acc, [key, value]) => {
|
|
@@ -27,10 +27,10 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
27
27
|
|
|
28
28
|
if (jsxA11y) {
|
|
29
29
|
configs.unshift({
|
|
30
|
+
name: 'siberiacancode/jsx-a11y',
|
|
30
31
|
plugins: {
|
|
31
32
|
'siberiacancode-jsx-a11y': pluginJsxA11y
|
|
32
33
|
},
|
|
33
|
-
name: 'siberiacancode/jsx-a11y',
|
|
34
34
|
rules: {
|
|
35
35
|
...Object.entries(pluginJsxA11y.flatConfigs.recommended.rules).reduce(
|
|
36
36
|
(acc, [key, value]) => {
|
|
@@ -49,25 +49,25 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
49
49
|
plugins: {
|
|
50
50
|
'siberiacancode-react': pluginReact
|
|
51
51
|
},
|
|
52
|
-
settings: {
|
|
53
|
-
react: {
|
|
54
|
-
version: 'detect'
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
52
|
rules: {
|
|
58
53
|
...Object.entries(pluginReact.configs.recommended.rules).reduce((acc, [key, value]) => {
|
|
59
54
|
acc[key.replace('react', 'siberiacancode-react')] = value;
|
|
60
55
|
return acc;
|
|
61
56
|
}, {}),
|
|
62
|
-
'siberiacancode-react/prop-types': 'off',
|
|
63
|
-
'siberiacancode-react/react-in-jsx-scope': 'off',
|
|
64
57
|
'siberiacancode-react/function-component-definition': [
|
|
65
58
|
'error',
|
|
66
59
|
{
|
|
67
60
|
namedComponents: ['arrow-function'],
|
|
68
61
|
unnamedComponents: 'arrow-function'
|
|
69
62
|
}
|
|
70
|
-
]
|
|
63
|
+
],
|
|
64
|
+
'siberiacancode-react/prop-types': 'off',
|
|
65
|
+
'siberiacancode-react/react-in-jsx-scope': 'off'
|
|
66
|
+
},
|
|
67
|
+
settings: {
|
|
68
|
+
react: {
|
|
69
|
+
version: 'detect'
|
|
70
|
+
}
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -76,28 +76,28 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
76
76
|
configs.unshift({
|
|
77
77
|
name: 'siberiacancode/formatter',
|
|
78
78
|
rules: {
|
|
79
|
-
'style/
|
|
79
|
+
'style/arrow-parens': ['error', 'always'],
|
|
80
|
+
'style/brace-style': 'off',
|
|
81
|
+
'style/comma-dangle': ['error', 'never'],
|
|
82
|
+
'style/indent': ['error', 2, { SwitchCase: 1 }],
|
|
80
83
|
'style/jsx-curly-newline': 'off',
|
|
81
84
|
'style/jsx-one-expression-per-line': 'off',
|
|
82
|
-
'style/
|
|
83
|
-
'style/quote-props': 'off',
|
|
84
|
-
'style/operator-linebreak': 'off',
|
|
85
|
-
'style/brace-style': 'off',
|
|
85
|
+
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
86
86
|
|
|
87
|
+
'style/linebreak-style': ['error', 'unix'],
|
|
87
88
|
'style/max-len': [
|
|
88
89
|
'error',
|
|
89
90
|
100,
|
|
90
91
|
2,
|
|
91
92
|
{ ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
|
|
92
93
|
],
|
|
93
|
-
'style/
|
|
94
|
-
'style/
|
|
95
|
-
'style/comma-dangle': ['error', 'never'],
|
|
96
|
-
'style/semi': ['error', 'always'],
|
|
97
|
-
'style/indent': ['error', 2, { SwitchCase: 1 }],
|
|
94
|
+
'style/member-delimiter-style': 'off',
|
|
95
|
+
'style/multiline-ternary': 'off',
|
|
98
96
|
'style/no-tabs': 'error',
|
|
99
|
-
'style/linebreak
|
|
100
|
-
'style/
|
|
97
|
+
'style/operator-linebreak': 'off',
|
|
98
|
+
'style/quote-props': 'off',
|
|
99
|
+
'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
|
|
100
|
+
'style/semi': ['error', 'always']
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -107,16 +107,28 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
107
107
|
{
|
|
108
108
|
name: 'siberiacancode/rewrite',
|
|
109
109
|
rules: {
|
|
110
|
-
'antfu/top-level-function': 'off',
|
|
111
|
-
'antfu/if-newline': 'off',
|
|
112
110
|
'antfu/curly': 'off',
|
|
113
|
-
|
|
114
|
-
'
|
|
115
|
-
|
|
116
|
-
'test/prefer-lowercase-title': 'off',
|
|
111
|
+
'antfu/if-newline': 'off',
|
|
112
|
+
'antfu/top-level-function': 'off',
|
|
117
113
|
|
|
118
114
|
'no-console': 'warn',
|
|
119
115
|
|
|
116
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
117
|
+
|
|
118
|
+
'test/prefer-lowercase-title': 'off'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'siberiacancode/sort',
|
|
123
|
+
rules: {
|
|
124
|
+
'perfectionist/sort-array-includes': [
|
|
125
|
+
'error',
|
|
126
|
+
{
|
|
127
|
+
matcher: 'minimatch',
|
|
128
|
+
order: 'asc',
|
|
129
|
+
type: 'alphabetical'
|
|
130
|
+
}
|
|
131
|
+
],
|
|
120
132
|
'perfectionist/sort-imports': [
|
|
121
133
|
'error',
|
|
122
134
|
{
|
|
@@ -133,10 +145,74 @@ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs
|
|
|
133
145
|
'unknown'
|
|
134
146
|
],
|
|
135
147
|
internalPattern: ['~/**', '@/**'],
|
|
148
|
+
matcher: 'minimatch',
|
|
136
149
|
newlinesBetween: 'ignore',
|
|
137
150
|
order: 'asc',
|
|
138
151
|
type: 'natural'
|
|
139
152
|
}
|
|
153
|
+
],
|
|
154
|
+
'perfectionist/sort-interfaces': [
|
|
155
|
+
'error',
|
|
156
|
+
{
|
|
157
|
+
groups: ['unknown', 'method', 'multiline'],
|
|
158
|
+
matcher: 'minimatch',
|
|
159
|
+
order: 'asc',
|
|
160
|
+
type: 'alphabetical'
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
'perfectionist/sort-jsx-props': [
|
|
164
|
+
'error',
|
|
165
|
+
{
|
|
166
|
+
customGroups: {
|
|
167
|
+
callback: 'on*',
|
|
168
|
+
reserved: ['key', 'ref']
|
|
169
|
+
},
|
|
170
|
+
groups: ['shorthand', 'reserved', 'multiline', 'unknown', 'callback'],
|
|
171
|
+
matcher: 'minimatch',
|
|
172
|
+
order: 'asc',
|
|
173
|
+
type: 'alphabetical'
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
'perfectionist/sort-object-types': [
|
|
177
|
+
'error',
|
|
178
|
+
{
|
|
179
|
+
matcher: 'minimatch',
|
|
180
|
+
order: 'asc',
|
|
181
|
+
specialCharacters: 'keep',
|
|
182
|
+
type: 'alphabetical'
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
'perfectionist/sort-objects': [
|
|
186
|
+
'error',
|
|
187
|
+
{
|
|
188
|
+
matcher: 'minimatch',
|
|
189
|
+
order: 'asc',
|
|
190
|
+
specialCharacters: 'keep',
|
|
191
|
+
type: 'alphabetical'
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
'perfectionist/sort-union-types': [
|
|
195
|
+
'error',
|
|
196
|
+
{
|
|
197
|
+
groups: [
|
|
198
|
+
'conditional',
|
|
199
|
+
'function',
|
|
200
|
+
'import',
|
|
201
|
+
'intersection',
|
|
202
|
+
'keyword',
|
|
203
|
+
'literal',
|
|
204
|
+
'named',
|
|
205
|
+
'object',
|
|
206
|
+
'operator',
|
|
207
|
+
'tuple',
|
|
208
|
+
'union',
|
|
209
|
+
'nullish'
|
|
210
|
+
],
|
|
211
|
+
matcher: 'minimatch',
|
|
212
|
+
order: 'asc',
|
|
213
|
+
specialCharacters: 'keep',
|
|
214
|
+
type: 'alphabetical'
|
|
215
|
+
}
|
|
140
216
|
]
|
|
141
217
|
}
|
|
142
218
|
},
|