@kikiutils/eslint-config 0.7.0 → 0.7.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 (2) hide show
  1. package/dist/index.mjs +206 -35
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7,57 +7,188 @@ 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
+ { minItems: 2 },
106
+ ],
107
+ 'style/array-element-newline': [
108
+ 'error',
109
+ { minItems: 2 },
110
+ ],
111
+ 'style/arrow-parens': [
112
+ 'error',
113
+ 'always',
114
+ ],
115
+ 'style/brace-style': [
116
+ 'error',
117
+ '1tbs',
118
+ { allowSingleLine: false },
119
+ ],
120
+ 'style/function-call-spacing': [
121
+ 'error',
122
+ 'never',
123
+ ],
124
+ 'style/indent': [
125
+ 'error',
126
+ 4,
127
+ ],
128
+ 'style/member-delimiter-style': [
129
+ 'error',
130
+ {
131
+ multiline: {
132
+ delimiter: 'semi',
133
+ requireLast: true,
134
+ },
135
+ },
136
+ ],
137
+ 'style/no-extra-parens': [
138
+ 'error',
139
+ 'all',
140
+ { nestedBinaryExpressions: false },
141
+ ],
53
142
  'style/no-extra-semi': 'error',
143
+ 'style/object-curly-newline': [
144
+ 'error',
145
+ {
146
+ ExportDeclaration: {
147
+ minProperties: 2,
148
+ multiline: true,
149
+ },
150
+ ImportDeclaration: {
151
+ minProperties: 2,
152
+ multiline: true,
153
+ },
154
+ ObjectExpression: {
155
+ minProperties: 2,
156
+ multiline: true,
157
+ },
158
+ ObjectPattern: {
159
+ minProperties: 2,
160
+ multiline: true,
161
+ },
162
+ },
163
+ ],
54
164
  'style/padding-line-between-statements': [
55
165
  'error',
56
- { blankLine: 'always', next: ['class', 'enum', 'function'], prev: '*' },
57
- { blankLine: 'always', next: '*', prev: ['class', 'function'] },
166
+ {
167
+ blankLine: 'always',
168
+ next: [
169
+ 'class',
170
+ 'enum',
171
+ 'function',
172
+ ],
173
+ prev: '*',
174
+ },
175
+ {
176
+ blankLine: 'always',
177
+ next: '*',
178
+ prev: [
179
+ 'class',
180
+ 'function',
181
+ ],
182
+ },
183
+ ],
184
+ 'style/semi': [
185
+ 'error',
186
+ 'always',
187
+ ],
188
+ 'ts/consistent-generic-constructors': [
189
+ 'error',
190
+ 'constructor',
58
191
  ],
59
- 'style/semi': ['error', 'always'],
60
- 'ts/consistent-generic-constructors': ['error', 'constructor'],
61
192
  'ts/no-redeclare': 'off',
62
193
  },
63
194
  }, {
@@ -68,17 +199,57 @@ function createConfig(environment = 'node', options) {
68
199
  'tailwindcss/enforces-negative-arbitrary-values': 'error',
69
200
  'tailwindcss/enforces-shorthand': 'error',
70
201
  '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 }],
202
+ 'vue/block-order': [
203
+ 'error',
204
+ {
205
+ order: [
206
+ 'template',
207
+ 'script',
208
+ 'style',
209
+ ],
210
+ },
211
+ ],
212
+ 'vue/html-indent': [
213
+ 'error',
214
+ 4,
215
+ ],
216
+ 'vue/max-attributes-per-line': [
217
+ 'error',
218
+ {
219
+ multiline: 1,
220
+ singleline: 1,
221
+ },
222
+ ],
223
+ 'vue/max-len': [
224
+ 'error',
225
+ {
226
+ code: 256,
227
+ template: 192,
228
+ },
229
+ ],
75
230
  'vue/no-multi-spaces': 'error',
76
231
  },
77
232
  }, {
78
233
  files: ['**/.vscode/*.json'],
79
234
  rules: {
80
- 'jsonc/sort-array-values': ['error', { order: { natural: true, type: 'asc' }, pathPattern: '^.*$' }],
81
- 'jsonc/sort-keys': ['error', 'asc', { caseSensitive: true, natural: true }],
235
+ 'jsonc/sort-array-values': [
236
+ 'error',
237
+ {
238
+ order: {
239
+ natural: true,
240
+ type: 'asc',
241
+ },
242
+ pathPattern: '^.*$',
243
+ },
244
+ ],
245
+ 'jsonc/sort-keys': [
246
+ 'error',
247
+ 'asc',
248
+ {
249
+ caseSensitive: true,
250
+ natural: true,
251
+ },
252
+ ],
82
253
  },
83
254
  });
84
255
  }
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.1",
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",