@quentinhsu/biome-config 0.2.0 → 0.3.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.
Files changed (33) hide show
  1. package/README.md +44 -0
  2. package/package.json +7 -4
  3. package/dist/build.mjs +0 -387
  4. package/dist/index.jsonc +0 -152
  5. package/dist/index.mjs +0 -357
  6. package/dist/next.jsonc +0 -169
  7. package/dist/nuxt.jsonc +0 -224
  8. package/dist/react.jsonc +0 -167
  9. package/dist/types/scripts/generate-biome-types.d.ts +0 -1
  10. package/dist/types/scripts/generate-changelog.d.ts +0 -6
  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 -176
package/dist/index.mjs DELETED
@@ -1,357 +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
- useSortedAttributes: {
90
- level: 'on',
91
- options: {
92
- sortOrder: 'natural'
93
- }
94
- }
95
- }
96
- }
97
- },
98
- linter: {
99
- enabled: true,
100
- rules: {
101
- recommended: true,
102
- complexity: {
103
- noUselessStringConcat: 'error',
104
- noUselessUndefinedInitialization: 'error',
105
- noVoid: 'error',
106
- useDateNow: 'error'
107
- },
108
- correctness: {
109
- noConstantMathMinMaxClamp: 'error',
110
- noUndeclaredVariables: 'error',
111
- noUnusedImports: 'error',
112
- noUnusedFunctionParameters: 'error',
113
- noUnusedPrivateClassMembers: 'error',
114
- useExhaustiveDependencies: {
115
- level: 'error',
116
- options: {
117
- reportUnnecessaryDependencies: false
118
- }
119
- },
120
- noUnusedVariables: 'error'
121
- },
122
- style: {
123
- noParameterProperties: 'error',
124
- noYodaExpression: 'error',
125
- useConsistentBuiltinInstantiation: 'error',
126
- useFragmentSyntax: 'error',
127
- useImportType: {
128
- level: 'error',
129
- fix: 'safe',
130
- options: {
131
- style: 'separatedType'
132
- }
133
- },
134
- useSelfClosingElements: {
135
- level: 'error',
136
- fix: 'safe',
137
- options: {}
138
- },
139
- useShorthandAssign: 'error',
140
- useArrayLiterals: 'error'
141
- },
142
- nursery: {
143
- useSortedClasses: {
144
- level: 'error',
145
- fix: 'safe',
146
- options: {
147
- functions: [
148
- 'clsx',
149
- 'cn'
150
- ]
151
- }
152
- }
153
- },
154
- suspicious: {
155
- useAwait: 'error',
156
- noEvolvingTypes: 'error'
157
- }
158
- }
159
- },
160
- javascript: {
161
- formatter: {
162
- quoteStyle: 'single',
163
- jsxQuoteStyle: 'single',
164
- arrowParentheses: 'asNeeded',
165
- trailingCommas: 'all'
166
- }
167
- },
168
- overrides: [
169
- {
170
- includes: [
171
- '**/*.jsx',
172
- '**/*.tsx'
173
- ],
174
- linter: {
175
- rules: {
176
- style: {
177
- noParameterAssign: 'error'
178
- }
179
- }
180
- }
181
- },
182
- {
183
- includes: [
184
- '**/*.ts',
185
- '**/*.tsx'
186
- ],
187
- linter: {
188
- rules: {
189
- correctness: {
190
- noUnusedVariables: 'off'
191
- }
192
- }
193
- }
194
- }
195
- ]
196
- };
197
- const reactOverlay = {
198
- files: {
199
- includes: [
200
- '!**/.storybook'
201
- ]
202
- },
203
- javascript: {
204
- jsxRuntime: 'reactClassic'
205
- },
206
- linter: {
207
- rules: {
208
- style: {
209
- useFragmentSyntax: 'error'
210
- }
211
- }
212
- },
213
- overrides: [
214
- {
215
- includes: [
216
- '**/__tests__/**',
217
- '**/*.{test,spec}.{ts,tsx,js,jsx}'
218
- ],
219
- linter: {
220
- rules: {
221
- correctness: {
222
- noUnusedVariables: 'off'
223
- }
224
- }
225
- }
226
- }
227
- ]
228
- };
229
- const reactConfig = mergeConfigs(indexConfig, reactOverlay);
230
- const nextOverlay = {
231
- files: {
232
- includes: [
233
- '!**/.next',
234
- '!**/.vercel',
235
- '!**/out'
236
- ]
237
- },
238
- javascript: {
239
- jsxRuntime: 'transparent'
240
- },
241
- linter: {
242
- rules: {
243
- correctness: {
244
- useExhaustiveDependencies: {
245
- level: 'error',
246
- options: {
247
- reportUnnecessaryDependencies: true
248
- }
249
- }
250
- }
251
- }
252
- }
253
- };
254
- const nextConfig = mergeConfigs(reactConfig, nextOverlay);
255
- const vueOverlay = {
256
- files: {
257
- includes: [
258
- '!**/.vitepress',
259
- '!**/.output'
260
- ]
261
- },
262
- javascript: {
263
- parser: {
264
- jsxEverywhere: false
265
- }
266
- },
267
- html: {
268
- formatter: {
269
- indentScriptAndStyle: true,
270
- selfCloseVoidElements: 'always'
271
- }
272
- },
273
- overrides: [
274
- {
275
- includes: [
276
- '**/*.vue'
277
- ],
278
- formatter: {
279
- lineWidth: 120
280
- },
281
- javascript: {
282
- formatter: {
283
- quoteStyle: 'single'
284
- }
285
- }
286
- }
287
- ]
288
- };
289
- const vueConfig = mergeConfigs(indexConfig, vueOverlay);
290
- const nuxtOverlay = {
291
- files: {
292
- includes: [
293
- '!**/.nuxt',
294
- '!**/.nitro',
295
- '!**/.output'
296
- ]
297
- },
298
- javascript: {
299
- globals: [
300
- 'defineNuxtConfig',
301
- 'defineAppConfig',
302
- 'defineNuxtPlugin',
303
- 'defineNuxtRouteMiddleware',
304
- 'defineNuxtServerPlugin',
305
- 'defineNitroPlugin',
306
- 'defineEventHandler',
307
- 'defineLazyEventHandler',
308
- 'definePayloadPlugin',
309
- 'defineRouteRules',
310
- 'definePageMeta',
311
- 'useRuntimeConfig',
312
- 'useNuxtApp',
313
- 'useAsyncData',
314
- 'useLazyAsyncData',
315
- 'useFetch',
316
- 'useLazyFetch',
317
- 'useState',
318
- 'useCookie',
319
- 'useHead',
320
- 'useSeoMeta',
321
- 'useError',
322
- 'clearError',
323
- 'showError',
324
- 'navigateTo',
325
- 'abortNavigation',
326
- 'refreshNuxtData',
327
- 'onNuxtReady',
328
- 'useRouter',
329
- 'useRoute',
330
- 'useRequestEvent',
331
- 'useRequestHeaders'
332
- ]
333
- },
334
- overrides: [
335
- {
336
- includes: [
337
- '**/*.ts'
338
- ],
339
- linter: {
340
- rules: {
341
- correctness: {
342
- noUndeclaredVariables: 'error'
343
- }
344
- }
345
- }
346
- }
347
- ]
348
- };
349
- const nuxtConfig = mergeConfigs(vueConfig, nuxtOverlay);
350
- const allPresets = Object.freeze({
351
- index: indexConfig,
352
- react: reactConfig,
353
- next: nextConfig,
354
- vue: vueConfig,
355
- nuxt: nuxtConfig
356
- });
357
- export { BIOME_SCHEMA_URL, allPresets, indexConfig, nextConfig, nuxtConfig, reactConfig, vueConfig };
package/dist/next.jsonc DELETED
@@ -1,169 +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
- "useSortedAttributes": {
49
- "level": "on",
50
- "options": {
51
- "sortOrder": "natural"
52
- }
53
- }
54
- }
55
- }
56
- },
57
- "linter": {
58
- "enabled": true,
59
- "rules": {
60
- "recommended": true,
61
- "complexity": {
62
- "noUselessStringConcat": "error",
63
- "noUselessUndefinedInitialization": "error",
64
- "noVoid": "error",
65
- "useDateNow": "error"
66
- },
67
- "correctness": {
68
- "noConstantMathMinMaxClamp": "error",
69
- "noUndeclaredVariables": "error",
70
- "noUnusedImports": "error",
71
- "noUnusedFunctionParameters": "error",
72
- "noUnusedPrivateClassMembers": "error",
73
- "useExhaustiveDependencies": {
74
- "level": "error",
75
- "options": {
76
- "reportUnnecessaryDependencies": true
77
- }
78
- },
79
- "noUnusedVariables": "error"
80
- },
81
- "style": {
82
- "noParameterProperties": "error",
83
- "noYodaExpression": "error",
84
- "useConsistentBuiltinInstantiation": "error",
85
- "useFragmentSyntax": "error",
86
- "useImportType": {
87
- "level": "error",
88
- "fix": "safe",
89
- "options": {
90
- "style": "separatedType"
91
- }
92
- },
93
- "useSelfClosingElements": {
94
- "level": "error",
95
- "fix": "safe",
96
- "options": {}
97
- },
98
- "useShorthandAssign": "error",
99
- "useArrayLiterals": "error"
100
- },
101
- "nursery": {
102
- "useSortedClasses": {
103
- "level": "error",
104
- "fix": "safe",
105
- "options": {
106
- "functions": [
107
- "clsx",
108
- "cn"
109
- ]
110
- }
111
- }
112
- },
113
- "suspicious": {
114
- "useAwait": "error",
115
- "noEvolvingTypes": "error"
116
- }
117
- }
118
- },
119
- "javascript": {
120
- "formatter": {
121
- "quoteStyle": "single",
122
- "jsxQuoteStyle": "single",
123
- "arrowParentheses": "asNeeded",
124
- "trailingCommas": "all"
125
- },
126
- "jsxRuntime": "transparent"
127
- },
128
- "overrides": [
129
- {
130
- "includes": [
131
- "**/*.jsx",
132
- "**/*.tsx"
133
- ],
134
- "linter": {
135
- "rules": {
136
- "style": {
137
- "noParameterAssign": "error"
138
- }
139
- }
140
- }
141
- },
142
- {
143
- "includes": [
144
- "**/*.ts",
145
- "**/*.tsx"
146
- ],
147
- "linter": {
148
- "rules": {
149
- "correctness": {
150
- "noUnusedVariables": "off"
151
- }
152
- }
153
- }
154
- },
155
- {
156
- "includes": [
157
- "**/__tests__/**",
158
- "**/*.{test,spec}.{ts,tsx,js,jsx}"
159
- ],
160
- "linter": {
161
- "rules": {
162
- "correctness": {
163
- "noUnusedVariables": "off"
164
- }
165
- }
166
- }
167
- }
168
- ]
169
- }