@siberiacancode/eslint 2.0.6 → 2.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/index.d.ts +1 -1
- package/index.js +34 -29
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module '@siberiacancode/eslint' {
|
|
2
2
|
declare type Eslint = (
|
|
3
3
|
options?: import('@antfu/eslint-config').OptionsConfig & {
|
|
4
|
-
'jsx-a11y'
|
|
4
|
+
'jsx-a11y'?: boolean;
|
|
5
5
|
} & import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
6
6
|
...userConfigs: import('@antfu/eslint-config').Awaitable<
|
|
7
7
|
| import('@antfu/eslint-config').TypedFlatConfigItem
|
package/index.js
CHANGED
|
@@ -4,7 +4,9 @@ import pluginReact from 'eslint-plugin-react';
|
|
|
4
4
|
import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
5
5
|
|
|
6
6
|
/** @type {import('@siberiacancode/eslint').Eslint} */
|
|
7
|
-
export const eslint = (options
|
|
7
|
+
export const eslint = (options, ...configs) => {
|
|
8
|
+
const stylistic = options.stylistic ?? false;
|
|
9
|
+
|
|
8
10
|
if (options['jsx-a11y']) {
|
|
9
11
|
configs.unshift({
|
|
10
12
|
plugins: {
|
|
@@ -51,7 +53,38 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
if (stylistic) {
|
|
57
|
+
configs.unshift({
|
|
58
|
+
name: 'siberiacancode/formatter',
|
|
59
|
+
rules: {
|
|
60
|
+
'style/multiline-ternary': 'off',
|
|
61
|
+
'style/jsx-curly-newline': 'off',
|
|
62
|
+
'style/jsx-one-expression-per-line': 'off',
|
|
63
|
+
'style/member-delimiter-style': 'off',
|
|
64
|
+
'style/quote-props': 'off',
|
|
65
|
+
'style/operator-linebreak': 'off',
|
|
66
|
+
'style/brace-style': 'off',
|
|
67
|
+
|
|
68
|
+
'style/max-len': [
|
|
69
|
+
'error',
|
|
70
|
+
100,
|
|
71
|
+
2,
|
|
72
|
+
{ ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
|
|
73
|
+
],
|
|
74
|
+
'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
|
|
75
|
+
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
76
|
+
'style/comma-dangle': ['error', 'never'],
|
|
77
|
+
'style/semi': ['error', 'always'],
|
|
78
|
+
'style/indent': ['error', 2, { SwitchCase: 1 }],
|
|
79
|
+
'style/no-tabs': 'error',
|
|
80
|
+
'style/linebreak-style': ['error', 'unix'],
|
|
81
|
+
'style/arrow-parens': ['error', 'always']
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
54
86
|
return antfu(
|
|
87
|
+
{ ...options, stylistic },
|
|
55
88
|
{
|
|
56
89
|
name: 'siberiacancode/rewrite',
|
|
57
90
|
rules: {
|
|
@@ -66,7 +99,6 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
66
99
|
'no-console': 'warn'
|
|
67
100
|
}
|
|
68
101
|
},
|
|
69
|
-
|
|
70
102
|
{
|
|
71
103
|
name: 'siberiacancode/imports',
|
|
72
104
|
plugins: {
|
|
@@ -93,33 +125,6 @@ export const eslint = (options = {}, ...configs) => {
|
|
|
93
125
|
]
|
|
94
126
|
}
|
|
95
127
|
},
|
|
96
|
-
{
|
|
97
|
-
name: 'siberiacancode/formatter',
|
|
98
|
-
rules: {
|
|
99
|
-
'style/multiline-ternary': 'off',
|
|
100
|
-
'style/jsx-curly-newline': 'off',
|
|
101
|
-
'style/jsx-one-expression-per-line': 'off',
|
|
102
|
-
'style/member-delimiter-style': 'off',
|
|
103
|
-
'style/quote-props': 'off',
|
|
104
|
-
'style/operator-linebreak': 'off',
|
|
105
|
-
'style/brace-style': 'off',
|
|
106
|
-
|
|
107
|
-
'style/max-len': [
|
|
108
|
-
'error',
|
|
109
|
-
100,
|
|
110
|
-
2,
|
|
111
|
-
{ ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
|
|
112
|
-
],
|
|
113
|
-
'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
|
|
114
|
-
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
115
|
-
'style/comma-dangle': ['error', 'never'],
|
|
116
|
-
'style/semi': ['error', 'always'],
|
|
117
|
-
'style/indent': ['error', 2, { SwitchCase: 1 }],
|
|
118
|
-
'style/no-tabs': 'error',
|
|
119
|
-
'style/linebreak-style': ['error', 'unix'],
|
|
120
|
-
'style/arrow-parens': ['error', 'always']
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
128
|
...configs
|
|
124
129
|
);
|
|
125
130
|
};
|