@siberiacancode/eslint 2.0.4 → 2.0.5
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 +25 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import antfu from '@antfu/eslint-config';
|
|
2
2
|
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
3
3
|
import pluginReact from 'eslint-plugin-react';
|
|
4
|
-
import
|
|
4
|
+
import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
5
5
|
|
|
6
6
|
/** @type {import('@siberiacancode/eslint').Eslint} */
|
|
7
7
|
export const eslint = (options = {}, ...configs) => {
|
|
8
8
|
if (options['jsx-a11y']) {
|
|
9
9
|
configs.push({
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
plugins: {
|
|
11
|
+
'siberiacancode-jsx-a11y': pluginJsxA11y
|
|
12
|
+
},
|
|
13
|
+
name: 'siberiacancode/jsx-a11y',
|
|
14
|
+
rules: {
|
|
15
|
+
...Object.entries(pluginJsxA11y.flatConfigs.recommended.rules).reduce(
|
|
16
|
+
(acc, [key, value]) => {
|
|
17
|
+
acc[key.replace('jsx-a11y', 'siberiacancode-jsx-a11y')] = value;
|
|
18
|
+
return acc;
|
|
19
|
+
},
|
|
20
|
+
{}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
12
23
|
});
|
|
13
24
|
}
|
|
14
25
|
|
|
@@ -16,7 +27,7 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
16
27
|
configs.push({
|
|
17
28
|
name: 'siberiacancode/react',
|
|
18
29
|
plugins: {
|
|
19
|
-
'
|
|
30
|
+
'siberiacancode-react': pluginReact
|
|
20
31
|
},
|
|
21
32
|
settings: {
|
|
22
33
|
react: {
|
|
@@ -24,7 +35,11 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
24
35
|
}
|
|
25
36
|
},
|
|
26
37
|
rules: {
|
|
27
|
-
|
|
38
|
+
...Object.entries(pluginReact.configs.recommended.rules).reduce((acc, [key, value]) => {
|
|
39
|
+
acc[key.replace('react', 'siberiacancode-react')] = value;
|
|
40
|
+
return acc;
|
|
41
|
+
}, {}),
|
|
42
|
+
'siberiacancode-react/function-component-definition': [
|
|
28
43
|
'error',
|
|
29
44
|
{
|
|
30
45
|
namedComponents: ['arrow-function'],
|
|
@@ -54,14 +69,14 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
54
69
|
{
|
|
55
70
|
name: 'siberiacancode/imports',
|
|
56
71
|
plugins: {
|
|
57
|
-
'simple-import-sort':
|
|
72
|
+
'plugin-simple-import-sort': pluginSimpleImportSort
|
|
58
73
|
},
|
|
59
74
|
rules: {
|
|
60
75
|
'sort-imports': 'off',
|
|
61
76
|
'import/order': 'off',
|
|
62
77
|
'import/extensions': 'off',
|
|
63
|
-
'simple-import-sort/exports': 'error',
|
|
64
|
-
'simple-import-sort/imports': [
|
|
78
|
+
'plugin-simple-import-sort/exports': 'error',
|
|
79
|
+
'plugin-simple-import-sort/imports': [
|
|
65
80
|
'error',
|
|
66
81
|
{
|
|
67
82
|
groups: [
|
|
@@ -80,6 +95,8 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
80
95
|
{
|
|
81
96
|
name: 'siberiacancode/formatter',
|
|
82
97
|
rules: {
|
|
98
|
+
'style/multiline-ternary': 'off',
|
|
99
|
+
'style/jsx-curly-newline': 'off',
|
|
83
100
|
'style/jsx-one-expression-per-line': 'off',
|
|
84
101
|
'style/member-delimiter-style': 'off',
|
|
85
102
|
'style/quote-props': 'off',
|