@siberiacancode/eslint 2.4.0 → 2.5.1

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.
Files changed (3) hide show
  1. package/index.d.ts +19 -19
  2. package/index.js +86 -28
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- declare module '@siberiacancode/eslint' {
2
- declare type Eslint = (
3
- options?: import('@antfu/eslint-config').OptionsConfig & {
4
- jsxA11y?: boolean;
5
- next?: boolean;
6
- } & import('@antfu/eslint-config').TypedFlatConfigItem,
7
- ...userConfigs: import('@antfu/eslint-config').Awaitable<
8
- | import('@antfu/eslint-config').TypedFlatConfigItem
9
- | import('@antfu/eslint-config').TypedFlatConfigItem[]
10
- | import('@antfu/eslint-config').FlatConfigComposer<any, any>
11
- | Linter.Config[]
12
- >[]
13
- ) => import('@antfu/eslint-config').FlatConfigComposer<
14
- import('@antfu/eslint-config').TypedFlatConfigItem,
15
- import('@antfu/eslint-config').ConfigNames
16
- >;
17
-
18
- export const eslint: Eslint;
19
- }
1
+ declare module '@siberiacancode/eslint' {
2
+ declare type Eslint = (
3
+ options?: import('@antfu/eslint-config').OptionsConfig & {
4
+ jsxA11y?: boolean;
5
+ next?: boolean;
6
+ } & import('@antfu/eslint-config').TypedFlatConfigItem,
7
+ ...userConfigs: import('@antfu/eslint-config').Awaitable<
8
+ | import('@antfu/eslint-config').FlatConfigComposer<any, any>
9
+ | import('@antfu/eslint-config').TypedFlatConfigItem
10
+ | import('@antfu/eslint-config').TypedFlatConfigItem[]
11
+ | Linter.Config[]
12
+ >[]
13
+ ) => import('@antfu/eslint-config').FlatConfigComposer<
14
+ import('@antfu/eslint-config').TypedFlatConfigItem,
15
+ import('@antfu/eslint-config').ConfigNames
16
+ >;
17
+
18
+ export const eslint: Eslint;
19
+ }
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/multiline-ternary': 'off',
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/member-delimiter-style': 'off',
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/quotes': ['error', 'single', { allowTemplateLiterals: true }],
94
- 'style/jsx-quotes': ['error', 'prefer-single'],
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-style': ['error', 'unix'],
100
- 'style/arrow-parens': ['error', 'always']
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
- 'react-hooks/exhaustive-deps': 'off',
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,56 @@ 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-union-types': [
177
+ 'error',
178
+ {
179
+ groups: [
180
+ 'conditional',
181
+ 'function',
182
+ 'import',
183
+ 'intersection',
184
+ 'keyword',
185
+ 'literal',
186
+ 'named',
187
+ 'object',
188
+ 'operator',
189
+ 'tuple',
190
+ 'union',
191
+ 'nullish'
192
+ ],
193
+ matcher: 'minimatch',
194
+ order: 'asc',
195
+ specialCharacters: 'keep',
196
+ type: 'alphabetical'
197
+ }
140
198
  ]
141
199
  }
142
200
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siberiacancode/eslint",
3
3
  "type": "module",
4
- "version": "2.4.0",
4
+ "version": "2.5.1",
5
5
  "description": "eslint configs",
6
6
  "author": {
7
7
  "name": "SIBERIA CAN CODE 🧊",