@quentinhsu/biome-config 0.1.0 → 0.2.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 (33) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -16
  3. package/package.json +13 -4
  4. package/dist/build.mjs +0 -381
  5. package/dist/index.jsonc +0 -146
  6. package/dist/index.mjs +0 -351
  7. package/dist/next.jsonc +0 -163
  8. package/dist/nuxt.jsonc +0 -218
  9. package/dist/react.jsonc +0 -161
  10. package/dist/types/scripts/generate-biome-types.d.ts +0 -1
  11. package/dist/types/src/build.d.ts +0 -1
  12. package/dist/types/src/constants/biome.d.ts +0 -1
  13. package/dist/types/src/generated/biome/index.d.ts +0 -11
  14. package/dist/types/src/generated/biome/no-compare-neg-zero-configuration.d.ts +0 -986
  15. package/dist/types/src/generated/biome/no-global-object-calls-options.d.ts +0 -306
  16. package/dist/types/src/generated/biome/no-nested-ternary-options.d.ts +0 -292
  17. package/dist/types/src/generated/biome/no-octal-escape-options.d.ts +0 -1138
  18. package/dist/types/src/generated/biome/no-shadow-configuration.d.ts +0 -241
  19. package/dist/types/src/generated/biome/nursery.d.ts +0 -1023
  20. package/dist/types/src/generated/biome/rule-with-no-duplicate-custom-properties-options.d.ts +0 -1095
  21. package/dist/types/src/generated/biome/rule-with-no-useless-catch-options.d.ts +0 -1430
  22. package/dist/types/src/generated/biome/rule-with-use-image-size-options.d.ts +0 -1339
  23. package/dist/types/src/generated/biome/schema.d.ts +0 -291
  24. package/dist/types/src/generated/biome/use-valid-lang-configuration.d.ts +0 -163
  25. package/dist/types/src/index.d.ts +0 -15
  26. package/dist/types/src/presets/next.d.ts +0 -1
  27. package/dist/types/src/presets/nuxt.d.ts +0 -1
  28. package/dist/types/src/presets/react.d.ts +0 -1
  29. package/dist/types/src/presets/vue.d.ts +0 -1
  30. package/dist/types/src/source/index.d.ts +0 -2
  31. package/dist/types/src/types.d.ts +0 -1
  32. package/dist/types/src/utils/merge.d.ts +0 -2
  33. package/dist/vue.jsonc +0 -170
package/dist/index.jsonc DELETED
@@ -1,146 +0,0 @@
1
- {
2
- "$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
3
- "root": true,
4
- "vcs": {
5
- "enabled": true,
6
- "clientKind": "git",
7
- "useIgnoreFile": true,
8
- "defaultBranch": "main"
9
- },
10
- "files": {
11
- "ignoreUnknown": true,
12
- "includes": [
13
- "**",
14
- "!**/build",
15
- "!**/dist",
16
- "!**/.next"
17
- ]
18
- },
19
- "formatter": {
20
- "enabled": true,
21
- "indentStyle": "space",
22
- "lineWidth": 140,
23
- "formatWithErrors": true
24
- },
25
- "assist": {
26
- "actions": {
27
- "source": {
28
- "organizeImports": {
29
- "level": "on",
30
- "options": {
31
- "groups": [
32
- [
33
- ":NODE:",
34
- ":BUN:",
35
- ":PACKAGE_WITH_PROTOCOL:",
36
- ":PACKAGE:"
37
- ],
38
- ":BLANK_LINE:",
39
- ":ALIAS:",
40
- ":BLANK_LINE:",
41
- ":PATH:"
42
- ]
43
- }
44
- }
45
- }
46
- }
47
- },
48
- "linter": {
49
- "enabled": true,
50
- "rules": {
51
- "recommended": true,
52
- "complexity": {
53
- "noUselessStringConcat": "error",
54
- "noUselessUndefinedInitialization": "error",
55
- "noVoid": "error",
56
- "useDateNow": "error"
57
- },
58
- "correctness": {
59
- "noConstantMathMinMaxClamp": "error",
60
- "noUndeclaredVariables": "error",
61
- "noUnusedImports": "error",
62
- "noUnusedFunctionParameters": "error",
63
- "noUnusedPrivateClassMembers": "error",
64
- "useExhaustiveDependencies": {
65
- "level": "error",
66
- "options": {
67
- "reportUnnecessaryDependencies": false
68
- }
69
- },
70
- "noUnusedVariables": "error"
71
- },
72
- "style": {
73
- "noParameterProperties": "error",
74
- "noYodaExpression": "error",
75
- "useConsistentBuiltinInstantiation": "error",
76
- "useFragmentSyntax": "error",
77
- "useImportType": {
78
- "level": "error",
79
- "fix": "safe",
80
- "options": {
81
- "style": "separatedType"
82
- }
83
- },
84
- "useSelfClosingElements": {
85
- "level": "error",
86
- "fix": "safe",
87
- "options": {}
88
- },
89
- "useShorthandAssign": "error",
90
- "useArrayLiterals": "error"
91
- },
92
- "nursery": {
93
- "useSortedClasses": {
94
- "level": "error",
95
- "fix": "safe",
96
- "options": {
97
- "functions": [
98
- "clsx",
99
- "cn"
100
- ]
101
- }
102
- }
103
- },
104
- "suspicious": {
105
- "useAwait": "error",
106
- "noEvolvingTypes": "error"
107
- }
108
- }
109
- },
110
- "javascript": {
111
- "formatter": {
112
- "quoteStyle": "single",
113
- "jsxQuoteStyle": "single",
114
- "arrowParentheses": "asNeeded",
115
- "trailingCommas": "all"
116
- }
117
- },
118
- "overrides": [
119
- {
120
- "includes": [
121
- "**/*.jsx",
122
- "**/*.tsx"
123
- ],
124
- "linter": {
125
- "rules": {
126
- "style": {
127
- "noParameterAssign": "error"
128
- }
129
- }
130
- }
131
- },
132
- {
133
- "includes": [
134
- "**/*.ts",
135
- "**/*.tsx"
136
- ],
137
- "linter": {
138
- "rules": {
139
- "correctness": {
140
- "noUnusedVariables": "off"
141
- }
142
- }
143
- }
144
- }
145
- ]
146
- }
package/dist/index.mjs DELETED
@@ -1,351 +0,0 @@
1
- const isPlainObject = (value)=>null !== value && 'object' == typeof value && !Array.isArray(value);
2
- const mergeArrays = (a, b)=>{
3
- const result = [
4
- ...a
5
- ];
6
- for (const item of b)if (!result.some((existing)=>deepEqual(existing, item))) result.push(item);
7
- return result;
8
- };
9
- const deepEqual = (a, b)=>{
10
- if (a === b) return true;
11
- if (Array.isArray(a) && Array.isArray(b)) return a.length === b.length && a.every((item, index)=>deepEqual(item, b[index]));
12
- if (isPlainObject(a) && isPlainObject(b)) {
13
- const keysA = Object.keys(a);
14
- const keysB = Object.keys(b);
15
- return keysA.length === keysB.length && keysA.every((key)=>deepEqual(a[key], b[key]));
16
- }
17
- return false;
18
- };
19
- const deepMerge = (target, source)=>{
20
- for (const [key, value] of Object.entries(source)){
21
- const current = target[key];
22
- if (Array.isArray(value)) {
23
- if (Array.isArray(current)) target[key] = mergeArrays(current, value);
24
- else target[key] = [
25
- ...value
26
- ];
27
- continue;
28
- }
29
- if (isPlainObject(value)) {
30
- const nextTarget = isPlainObject(current) ? {
31
- ...current
32
- } : {};
33
- target[key] = deepMerge(nextTarget, value);
34
- continue;
35
- }
36
- target[key] = value;
37
- }
38
- return target;
39
- };
40
- const mergeConfigs = (...configs)=>{
41
- const merged = configs.reduce((accumulator, config)=>deepMerge(accumulator, config), {});
42
- return merged;
43
- };
44
- const BIOME_SCHEMA_URL = 'https://biomejs.dev/schemas/2.2.6/schema.json';
45
- const indexConfig = {
46
- $schema: BIOME_SCHEMA_URL,
47
- root: true,
48
- vcs: {
49
- enabled: true,
50
- clientKind: 'git',
51
- useIgnoreFile: true,
52
- defaultBranch: 'main'
53
- },
54
- files: {
55
- ignoreUnknown: true,
56
- includes: [
57
- '**',
58
- '!**/build',
59
- '!**/dist',
60
- '!**/.next'
61
- ]
62
- },
63
- formatter: {
64
- enabled: true,
65
- indentStyle: 'space',
66
- lineWidth: 140,
67
- formatWithErrors: true
68
- },
69
- assist: {
70
- actions: {
71
- source: {
72
- organizeImports: {
73
- level: 'on',
74
- options: {
75
- groups: [
76
- [
77
- ':NODE:',
78
- ':BUN:',
79
- ':PACKAGE_WITH_PROTOCOL:',
80
- ':PACKAGE:'
81
- ],
82
- ':BLANK_LINE:',
83
- ':ALIAS:',
84
- ':BLANK_LINE:',
85
- ':PATH:'
86
- ]
87
- }
88
- }
89
- }
90
- }
91
- },
92
- linter: {
93
- enabled: true,
94
- rules: {
95
- recommended: true,
96
- complexity: {
97
- noUselessStringConcat: 'error',
98
- noUselessUndefinedInitialization: 'error',
99
- noVoid: 'error',
100
- useDateNow: 'error'
101
- },
102
- correctness: {
103
- noConstantMathMinMaxClamp: 'error',
104
- noUndeclaredVariables: 'error',
105
- noUnusedImports: 'error',
106
- noUnusedFunctionParameters: 'error',
107
- noUnusedPrivateClassMembers: 'error',
108
- useExhaustiveDependencies: {
109
- level: 'error',
110
- options: {
111
- reportUnnecessaryDependencies: false
112
- }
113
- },
114
- noUnusedVariables: 'error'
115
- },
116
- style: {
117
- noParameterProperties: 'error',
118
- noYodaExpression: 'error',
119
- useConsistentBuiltinInstantiation: 'error',
120
- useFragmentSyntax: 'error',
121
- useImportType: {
122
- level: 'error',
123
- fix: 'safe',
124
- options: {
125
- style: 'separatedType'
126
- }
127
- },
128
- useSelfClosingElements: {
129
- level: 'error',
130
- fix: 'safe',
131
- options: {}
132
- },
133
- useShorthandAssign: 'error',
134
- useArrayLiterals: 'error'
135
- },
136
- nursery: {
137
- useSortedClasses: {
138
- level: 'error',
139
- fix: 'safe',
140
- options: {
141
- functions: [
142
- 'clsx',
143
- 'cn'
144
- ]
145
- }
146
- }
147
- },
148
- suspicious: {
149
- useAwait: 'error',
150
- noEvolvingTypes: 'error'
151
- }
152
- }
153
- },
154
- javascript: {
155
- formatter: {
156
- quoteStyle: 'single',
157
- jsxQuoteStyle: 'single',
158
- arrowParentheses: 'asNeeded',
159
- trailingCommas: 'all'
160
- }
161
- },
162
- overrides: [
163
- {
164
- includes: [
165
- '**/*.jsx',
166
- '**/*.tsx'
167
- ],
168
- linter: {
169
- rules: {
170
- style: {
171
- noParameterAssign: 'error'
172
- }
173
- }
174
- }
175
- },
176
- {
177
- includes: [
178
- '**/*.ts',
179
- '**/*.tsx'
180
- ],
181
- linter: {
182
- rules: {
183
- correctness: {
184
- noUnusedVariables: 'off'
185
- }
186
- }
187
- }
188
- }
189
- ]
190
- };
191
- const reactOverlay = {
192
- files: {
193
- includes: [
194
- '!**/.storybook'
195
- ]
196
- },
197
- javascript: {
198
- jsxRuntime: 'reactClassic'
199
- },
200
- linter: {
201
- rules: {
202
- style: {
203
- useFragmentSyntax: 'error'
204
- }
205
- }
206
- },
207
- overrides: [
208
- {
209
- includes: [
210
- '**/__tests__/**',
211
- '**/*.{test,spec}.{ts,tsx,js,jsx}'
212
- ],
213
- linter: {
214
- rules: {
215
- correctness: {
216
- noUnusedVariables: 'off'
217
- }
218
- }
219
- }
220
- }
221
- ]
222
- };
223
- const reactConfig = mergeConfigs(indexConfig, reactOverlay);
224
- const nextOverlay = {
225
- files: {
226
- includes: [
227
- '!**/.next',
228
- '!**/.vercel',
229
- '!**/out'
230
- ]
231
- },
232
- javascript: {
233
- jsxRuntime: 'transparent'
234
- },
235
- linter: {
236
- rules: {
237
- correctness: {
238
- useExhaustiveDependencies: {
239
- level: 'error',
240
- options: {
241
- reportUnnecessaryDependencies: true
242
- }
243
- }
244
- }
245
- }
246
- }
247
- };
248
- const nextConfig = mergeConfigs(reactConfig, nextOverlay);
249
- const vueOverlay = {
250
- files: {
251
- includes: [
252
- '!**/.vitepress',
253
- '!**/.output'
254
- ]
255
- },
256
- javascript: {
257
- parser: {
258
- jsxEverywhere: false
259
- }
260
- },
261
- html: {
262
- formatter: {
263
- indentScriptAndStyle: true,
264
- selfCloseVoidElements: 'always'
265
- }
266
- },
267
- overrides: [
268
- {
269
- includes: [
270
- '**/*.vue'
271
- ],
272
- formatter: {
273
- lineWidth: 120
274
- },
275
- javascript: {
276
- formatter: {
277
- quoteStyle: 'single'
278
- }
279
- }
280
- }
281
- ]
282
- };
283
- const vueConfig = mergeConfigs(indexConfig, vueOverlay);
284
- const nuxtOverlay = {
285
- files: {
286
- includes: [
287
- '!**/.nuxt',
288
- '!**/.nitro',
289
- '!**/.output'
290
- ]
291
- },
292
- javascript: {
293
- globals: [
294
- 'defineNuxtConfig',
295
- 'defineAppConfig',
296
- 'defineNuxtPlugin',
297
- 'defineNuxtRouteMiddleware',
298
- 'defineNuxtServerPlugin',
299
- 'defineNitroPlugin',
300
- 'defineEventHandler',
301
- 'defineLazyEventHandler',
302
- 'definePayloadPlugin',
303
- 'defineRouteRules',
304
- 'definePageMeta',
305
- 'useRuntimeConfig',
306
- 'useNuxtApp',
307
- 'useAsyncData',
308
- 'useLazyAsyncData',
309
- 'useFetch',
310
- 'useLazyFetch',
311
- 'useState',
312
- 'useCookie',
313
- 'useHead',
314
- 'useSeoMeta',
315
- 'useError',
316
- 'clearError',
317
- 'showError',
318
- 'navigateTo',
319
- 'abortNavigation',
320
- 'refreshNuxtData',
321
- 'onNuxtReady',
322
- 'useRouter',
323
- 'useRoute',
324
- 'useRequestEvent',
325
- 'useRequestHeaders'
326
- ]
327
- },
328
- overrides: [
329
- {
330
- includes: [
331
- '**/*.ts'
332
- ],
333
- linter: {
334
- rules: {
335
- correctness: {
336
- noUndeclaredVariables: 'error'
337
- }
338
- }
339
- }
340
- }
341
- ]
342
- };
343
- const nuxtConfig = mergeConfigs(vueConfig, nuxtOverlay);
344
- const allPresets = Object.freeze({
345
- index: indexConfig,
346
- react: reactConfig,
347
- next: nextConfig,
348
- vue: vueConfig,
349
- nuxt: nuxtConfig
350
- });
351
- export { BIOME_SCHEMA_URL, allPresets, indexConfig, nextConfig, nuxtConfig, reactConfig, vueConfig };
package/dist/next.jsonc DELETED
@@ -1,163 +0,0 @@
1
- {
2
- "$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
3
- "root": true,
4
- "vcs": {
5
- "enabled": true,
6
- "clientKind": "git",
7
- "useIgnoreFile": true,
8
- "defaultBranch": "main"
9
- },
10
- "files": {
11
- "ignoreUnknown": true,
12
- "includes": [
13
- "**",
14
- "!**/build",
15
- "!**/dist",
16
- "!**/.next",
17
- "!**/.storybook",
18
- "!**/.vercel",
19
- "!**/out"
20
- ]
21
- },
22
- "formatter": {
23
- "enabled": true,
24
- "indentStyle": "space",
25
- "lineWidth": 140,
26
- "formatWithErrors": true
27
- },
28
- "assist": {
29
- "actions": {
30
- "source": {
31
- "organizeImports": {
32
- "level": "on",
33
- "options": {
34
- "groups": [
35
- [
36
- ":NODE:",
37
- ":BUN:",
38
- ":PACKAGE_WITH_PROTOCOL:",
39
- ":PACKAGE:"
40
- ],
41
- ":BLANK_LINE:",
42
- ":ALIAS:",
43
- ":BLANK_LINE:",
44
- ":PATH:"
45
- ]
46
- }
47
- }
48
- }
49
- }
50
- },
51
- "linter": {
52
- "enabled": true,
53
- "rules": {
54
- "recommended": true,
55
- "complexity": {
56
- "noUselessStringConcat": "error",
57
- "noUselessUndefinedInitialization": "error",
58
- "noVoid": "error",
59
- "useDateNow": "error"
60
- },
61
- "correctness": {
62
- "noConstantMathMinMaxClamp": "error",
63
- "noUndeclaredVariables": "error",
64
- "noUnusedImports": "error",
65
- "noUnusedFunctionParameters": "error",
66
- "noUnusedPrivateClassMembers": "error",
67
- "useExhaustiveDependencies": {
68
- "level": "error",
69
- "options": {
70
- "reportUnnecessaryDependencies": true
71
- }
72
- },
73
- "noUnusedVariables": "error"
74
- },
75
- "style": {
76
- "noParameterProperties": "error",
77
- "noYodaExpression": "error",
78
- "useConsistentBuiltinInstantiation": "error",
79
- "useFragmentSyntax": "error",
80
- "useImportType": {
81
- "level": "error",
82
- "fix": "safe",
83
- "options": {
84
- "style": "separatedType"
85
- }
86
- },
87
- "useSelfClosingElements": {
88
- "level": "error",
89
- "fix": "safe",
90
- "options": {}
91
- },
92
- "useShorthandAssign": "error",
93
- "useArrayLiterals": "error"
94
- },
95
- "nursery": {
96
- "useSortedClasses": {
97
- "level": "error",
98
- "fix": "safe",
99
- "options": {
100
- "functions": [
101
- "clsx",
102
- "cn"
103
- ]
104
- }
105
- }
106
- },
107
- "suspicious": {
108
- "useAwait": "error",
109
- "noEvolvingTypes": "error"
110
- }
111
- }
112
- },
113
- "javascript": {
114
- "formatter": {
115
- "quoteStyle": "single",
116
- "jsxQuoteStyle": "single",
117
- "arrowParentheses": "asNeeded",
118
- "trailingCommas": "all"
119
- },
120
- "jsxRuntime": "transparent"
121
- },
122
- "overrides": [
123
- {
124
- "includes": [
125
- "**/*.jsx",
126
- "**/*.tsx"
127
- ],
128
- "linter": {
129
- "rules": {
130
- "style": {
131
- "noParameterAssign": "error"
132
- }
133
- }
134
- }
135
- },
136
- {
137
- "includes": [
138
- "**/*.ts",
139
- "**/*.tsx"
140
- ],
141
- "linter": {
142
- "rules": {
143
- "correctness": {
144
- "noUnusedVariables": "off"
145
- }
146
- }
147
- }
148
- },
149
- {
150
- "includes": [
151
- "**/__tests__/**",
152
- "**/*.{test,spec}.{ts,tsx,js,jsx}"
153
- ],
154
- "linter": {
155
- "rules": {
156
- "correctness": {
157
- "noUnusedVariables": "off"
158
- }
159
- }
160
- }
161
- }
162
- ]
163
- }