@kikiutils/eslint-config 0.7.0 → 0.7.2

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 (2) hide show
  1. package/dist/index.mjs +212 -35
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7,57 +7,194 @@ const commonPerfectionistSortOptions = Object.freeze({
7
7
  type: 'natural',
8
8
  });
9
9
  function createConfig(environment = 'node', options) {
10
- return antfu({ typescript: true, ...options }, {
10
+ return antfu({
11
+ typescript: true,
12
+ ...options,
13
+ }, {
11
14
  files: ['**/*.{cjs,js,mjs,ts,vue}'],
12
15
  rules: {
13
16
  'antfu/curly': 'off',
14
17
  'antfu/if-newline': 'off',
15
18
  'antfu/no-top-level-await': 'off',
16
- 'curly': ['error', 'multi-line'],
17
- 'max-classes-per-file': ['error', 1],
18
- 'perfectionist/sort-array-includes': ['error', commonPerfectionistSortOptions],
19
- 'perfectionist/sort-enums': ['error', commonPerfectionistSortOptions],
20
- 'perfectionist/sort-heritage-clauses': ['error', { ignoreCase: false, type: 'natural' }],
19
+ 'curly': [
20
+ 'error',
21
+ 'multi-line',
22
+ ],
23
+ 'max-classes-per-file': [
24
+ 'error',
25
+ 1,
26
+ ],
27
+ 'perfectionist/sort-array-includes': [
28
+ 'error',
29
+ commonPerfectionistSortOptions,
30
+ ],
31
+ 'perfectionist/sort-enums': [
32
+ 'error',
33
+ commonPerfectionistSortOptions,
34
+ ],
35
+ 'perfectionist/sort-heritage-clauses': [
36
+ 'error',
37
+ {
38
+ ignoreCase: false,
39
+ type: 'natural',
40
+ },
41
+ ],
21
42
  'perfectionist/sort-imports': [
22
43
  'error',
23
44
  {
24
45
  environment,
25
46
  groups: [
26
- ['builtin', 'external'],
47
+ [
48
+ 'builtin',
49
+ 'external',
50
+ ],
27
51
  'internal',
28
52
  'parent',
29
53
  'sibling',
30
54
  ],
31
55
  ignoreCase: false,
32
- internalPattern: ['^#.*', '^@/.*', '^~/.*'],
56
+ internalPattern: [
57
+ '^#.*',
58
+ '^@/.*',
59
+ '^~/.*',
60
+ ],
33
61
  type: 'natural',
34
62
  },
35
63
  ],
36
- 'perfectionist/sort-interfaces': ['error', commonPerfectionistSortOptions],
37
- 'perfectionist/sort-intersection-types': ['error', commonPerfectionistSortOptions],
38
- 'perfectionist/sort-maps': ['error', commonPerfectionistSortOptions],
39
- 'perfectionist/sort-object-types': ['error', commonPerfectionistSortOptions],
40
- 'perfectionist/sort-objects': ['error', commonPerfectionistSortOptions],
41
- 'perfectionist/sort-sets': ['error', commonPerfectionistSortOptions],
42
- 'perfectionist/sort-switch-case': ['error', { ignoreCase: false, type: 'natural' }],
43
- 'perfectionist/sort-union-types': ['error', commonPerfectionistSortOptions],
44
- 'perfectionist/sort-variable-declarations': ['error', commonPerfectionistSortOptions],
45
- 'style/array-bracket-newline': ['error', 'consistent'],
46
- 'style/array-element-newline': ['error', 'consistent'],
47
- 'style/arrow-parens': ['error', 'always'],
48
- 'style/brace-style': ['error', '1tbs', { allowSingleLine: false }],
49
- 'style/function-call-spacing': ['error', 'never'],
50
- 'style/indent': ['error', 4],
51
- 'style/member-delimiter-style': ['error', { multiline: { delimiter: 'semi', requireLast: true } }],
52
- 'style/no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false }],
64
+ 'perfectionist/sort-interfaces': [
65
+ 'error',
66
+ commonPerfectionistSortOptions,
67
+ ],
68
+ 'perfectionist/sort-intersection-types': [
69
+ 'error',
70
+ commonPerfectionistSortOptions,
71
+ ],
72
+ 'perfectionist/sort-maps': [
73
+ 'error',
74
+ commonPerfectionistSortOptions,
75
+ ],
76
+ 'perfectionist/sort-object-types': [
77
+ 'error',
78
+ commonPerfectionistSortOptions,
79
+ ],
80
+ 'perfectionist/sort-objects': [
81
+ 'error',
82
+ commonPerfectionistSortOptions,
83
+ ],
84
+ 'perfectionist/sort-sets': [
85
+ 'error',
86
+ commonPerfectionistSortOptions,
87
+ ],
88
+ 'perfectionist/sort-switch-case': [
89
+ 'error',
90
+ {
91
+ ignoreCase: false,
92
+ type: 'natural',
93
+ },
94
+ ],
95
+ 'perfectionist/sort-union-types': [
96
+ 'error',
97
+ commonPerfectionistSortOptions,
98
+ ],
99
+ 'perfectionist/sort-variable-declarations': [
100
+ 'error',
101
+ commonPerfectionistSortOptions,
102
+ ],
103
+ 'style/array-bracket-newline': [
104
+ 'error',
105
+ {
106
+ minItems: 2,
107
+ multiline: true,
108
+ },
109
+ ],
110
+ 'style/array-element-newline': [
111
+ 'error',
112
+ {
113
+ minItems: 2,
114
+ multiline: true,
115
+ },
116
+ ],
117
+ 'style/arrow-parens': [
118
+ 'error',
119
+ 'always',
120
+ ],
121
+ 'style/brace-style': [
122
+ 'error',
123
+ '1tbs',
124
+ { allowSingleLine: false },
125
+ ],
126
+ 'style/function-call-spacing': [
127
+ 'error',
128
+ 'never',
129
+ ],
130
+ 'style/indent': [
131
+ 'error',
132
+ 4,
133
+ ],
134
+ 'style/member-delimiter-style': [
135
+ 'error',
136
+ {
137
+ multiline: {
138
+ delimiter: 'semi',
139
+ requireLast: true,
140
+ },
141
+ },
142
+ ],
143
+ 'style/no-extra-parens': [
144
+ 'error',
145
+ 'all',
146
+ { nestedBinaryExpressions: false },
147
+ ],
53
148
  'style/no-extra-semi': 'error',
149
+ 'style/object-curly-newline': [
150
+ 'error',
151
+ {
152
+ ExportDeclaration: {
153
+ minProperties: 2,
154
+ multiline: true,
155
+ },
156
+ ImportDeclaration: {
157
+ minProperties: 2,
158
+ multiline: true,
159
+ },
160
+ ObjectExpression: {
161
+ minProperties: 2,
162
+ multiline: true,
163
+ },
164
+ ObjectPattern: {
165
+ minProperties: 2,
166
+ multiline: true,
167
+ },
168
+ },
169
+ ],
54
170
  'style/padding-line-between-statements': [
55
171
  'error',
56
- { blankLine: 'always', next: ['class', 'enum', 'function'], prev: '*' },
57
- { blankLine: 'always', next: '*', prev: ['class', 'function'] },
172
+ {
173
+ blankLine: 'always',
174
+ next: [
175
+ 'class',
176
+ 'enum',
177
+ 'function',
178
+ ],
179
+ prev: '*',
180
+ },
181
+ {
182
+ blankLine: 'always',
183
+ next: '*',
184
+ prev: [
185
+ 'class',
186
+ 'function',
187
+ ],
188
+ },
189
+ ],
190
+ 'style/semi': [
191
+ 'error',
192
+ 'always',
193
+ ],
194
+ 'ts/consistent-generic-constructors': [
195
+ 'error',
196
+ 'constructor',
58
197
  ],
59
- 'style/semi': ['error', 'always'],
60
- 'ts/consistent-generic-constructors': ['error', 'constructor'],
61
198
  'ts/no-redeclare': 'off',
62
199
  },
63
200
  }, {
@@ -68,17 +205,57 @@ function createConfig(environment = 'node', options) {
68
205
  'tailwindcss/enforces-negative-arbitrary-values': 'error',
69
206
  'tailwindcss/enforces-shorthand': 'error',
70
207
  'tailwindcss/no-unnecessary-arbitrary-value': 'error',
71
- 'vue/block-order': ['error', { order: ['template', 'script', 'style'] }],
72
- 'vue/html-indent': ['error', 4],
73
- 'vue/max-attributes-per-line': ['error', { multiline: 1, singleline: 6 }],
74
- 'vue/max-len': ['error', { code: 256, template: 192 }],
208
+ 'vue/block-order': [
209
+ 'error',
210
+ {
211
+ order: [
212
+ 'template',
213
+ 'script',
214
+ 'style',
215
+ ],
216
+ },
217
+ ],
218
+ 'vue/html-indent': [
219
+ 'error',
220
+ 4,
221
+ ],
222
+ 'vue/max-attributes-per-line': [
223
+ 'error',
224
+ {
225
+ multiline: 1,
226
+ singleline: 1,
227
+ },
228
+ ],
229
+ 'vue/max-len': [
230
+ 'error',
231
+ {
232
+ code: 256,
233
+ template: 192,
234
+ },
235
+ ],
75
236
  'vue/no-multi-spaces': 'error',
76
237
  },
77
238
  }, {
78
239
  files: ['**/.vscode/*.json'],
79
240
  rules: {
80
- 'jsonc/sort-array-values': ['error', { order: { natural: true, type: 'asc' }, pathPattern: '^.*$' }],
81
- 'jsonc/sort-keys': ['error', 'asc', { caseSensitive: true, natural: true }],
241
+ 'jsonc/sort-array-values': [
242
+ 'error',
243
+ {
244
+ order: {
245
+ natural: true,
246
+ type: 'asc',
247
+ },
248
+ pathPattern: '^.*$',
249
+ },
250
+ ],
251
+ 'jsonc/sort-keys': [
252
+ 'error',
253
+ 'asc',
254
+ {
255
+ caseSensitive: true,
256
+ natural: true,
257
+ },
258
+ ],
82
259
  },
83
260
  });
84
261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kikiutils/eslint-config",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Using antfu/eslint-config as a base for eslint-config, slightly modified the settings and added additional plugins, mainly for my own use.",
5
5
  "author": "kiki-kanri",
6
6
  "license": "MIT",