@adamhl8/configs 0.14.6 → 0.15.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.
package/README.md CHANGED
@@ -23,12 +23,46 @@ bun add -D @adamhl8/configs
23
23
  }
24
24
  ```
25
25
 
26
+ #### Notes
27
+
28
+ ```jsonc
29
+ "json": {
30
+ "formatter": {
31
+ // this is 'auto' by default, except that biome uses 'always' for package.json
32
+ // setting it to 'auto' explicitly makes it consistent across all files, including package.json
33
+ "expand": "auto"
34
+ }
35
+ },
36
+ ```
37
+
38
+ ```jsonc
39
+ // https://github.com/biomejs/biome/issues/6676 - Plugins are resolved relative to the *root* config, not the config specifying the plugin
40
+ // Extending this config from the root config of this project causes an error because the plugin files do not exist in 'node_modules'. i.e. the whole 'node_modules/@adamhl8/configs' directory doesn't exist because that's *this* project (we don't install this project in itself)
41
+ // As a workaround, we use the prepare script to manually copy the './src/biome-plugins/' directory to the correct location in 'node_modules'.
42
+ "plugins": ["./node_modules/@adamhl8/configs/dist/biome-plugins/import-paths.grit"],
43
+ ```
44
+
45
+ ### knip
46
+
47
+ ```ts
48
+ import { knipConfig } from "@adamhl8/configs"
49
+
50
+ export default knipConfig({ ... })
51
+ ```
52
+
53
+ ### tsdown
54
+
55
+ ```ts
56
+ import { tsdownConfig } from "@adamhl8/configs"
57
+ import { defineConfig } from "tsdown"
58
+
59
+ export default defineConfig(tsdownConfig({ ... }))
60
+ ```
61
+
26
62
  ### prettier
27
63
 
28
64
  ```js
29
- import { config } from "@adamhl8/configs/prettier"
65
+ import { prettierConfig } from "@adamhl8/configs"
30
66
 
31
- export default {
32
- ...config,
33
- }
67
+ export default prettierConfig({ ... })
34
68
  ```
@@ -0,0 +1,437 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
3
+ "root": false,
4
+ "plugins": ["./node_modules/@adamhl8/configs/dist/biome-plugins/import-paths.grit"],
5
+ "vcs": {
6
+ "enabled": true,
7
+ "clientKind": "git",
8
+ "useIgnoreFile": true
9
+ },
10
+ "formatter": {
11
+ "indentStyle": "space",
12
+ "lineWidth": 120
13
+ },
14
+ "javascript": {
15
+ "formatter": {
16
+ "semicolons": "asNeeded"
17
+ }
18
+ },
19
+ "json": {
20
+ "formatter": {
21
+ "expand": "auto"
22
+ }
23
+ },
24
+ "assist": {
25
+ "enabled": true,
26
+ "actions": {
27
+ "source": {
28
+ "organizeImports": {
29
+ "level": "on",
30
+ "options": {
31
+ "groups": [
32
+ [":NODE:", ":BUN:", ":URL:", ":PACKAGE_WITH_PROTOCOL:", ":PACKAGE:"],
33
+ ":BLANK_LINE:",
34
+ [":ALIAS:", ":PATH:"]
35
+ ]
36
+ }
37
+ }
38
+ }
39
+ }
40
+ },
41
+ "overrides": [
42
+ {
43
+ "includes": ["**/*.tsx", "./knip.ts", "./prettier.config.js", "tsdown.config.ts"],
44
+ "linter": {
45
+ "rules": {
46
+ "style": {
47
+ "noDefaultExport": "off"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ],
53
+ "linter": {
54
+ "rules": {
55
+ "a11y": {
56
+ "noAccessKey": "on",
57
+ "noAriaHiddenOnFocusable": "on",
58
+ "noAriaUnsupportedElements": "on",
59
+ "noAutofocus": "on",
60
+ "noDistractingElements": "on",
61
+ "noHeaderScope": "on",
62
+ "noInteractiveElementToNoninteractiveRole": "on",
63
+ "noLabelWithoutControl": "on",
64
+ "noNoninteractiveElementInteractions": "on",
65
+ "noNoninteractiveElementToInteractiveRole": "on",
66
+ "noNoninteractiveTabindex": "on",
67
+ "noPositiveTabindex": "on",
68
+ "noRedundantAlt": "on",
69
+ "noRedundantRoles": "on",
70
+ "noStaticElementInteractions": "on",
71
+ "noSvgWithoutTitle": "on",
72
+ "useAltText": "on",
73
+ "useAnchorContent": "on",
74
+ "useAriaActivedescendantWithTabindex": "on",
75
+ "useAriaPropsForRole": "on",
76
+ "useAriaPropsSupportedByRole": "on",
77
+ "useButtonType": "on",
78
+ "useFocusableInteractive": "on",
79
+ "useGenericFontNames": "on",
80
+ "useHeadingContent": "on",
81
+ "useHtmlLang": "on",
82
+ "useIframeTitle": "on",
83
+ "useKeyWithClickEvents": "on",
84
+ "useKeyWithMouseEvents": "on",
85
+ "useMediaCaption": "on",
86
+ "useSemanticElements": "on",
87
+ "useValidAnchor": "on",
88
+ "useValidAriaProps": "on",
89
+ "useValidAriaRole": "on",
90
+ "useValidAriaValues": "on",
91
+ "useValidAutocomplete": "on",
92
+ "useValidLang": "on"
93
+ },
94
+ "complexity": {
95
+ "noAdjacentSpacesInRegex": "on",
96
+ "noArguments": "on",
97
+ "noBannedTypes": "on",
98
+ "noCommaOperator": "on",
99
+ "noEmptyTypeParameters": "on",
100
+ "noExcessiveCognitiveComplexity": "off",
101
+ "noExcessiveLinesPerFunction": "off",
102
+ "noExcessiveNestedTestSuites": "on",
103
+ "noExtraBooleanCast": "on",
104
+ "noFlatMapIdentity": "on",
105
+ "noForEach": "on",
106
+ "noImplicitCoercions": "on",
107
+ "noImportantStyles": "on",
108
+ "noStaticOnlyClass": "on",
109
+ "noThisInStatic": "on",
110
+ "noUselessCatch": "on",
111
+ "noUselessConstructor": "on",
112
+ "noUselessContinue": "on",
113
+ "noUselessEmptyExport": "on",
114
+ "noUselessEscapeInRegex": "on",
115
+ "noUselessFragments": "on",
116
+ "noUselessLabel": "on",
117
+ "noUselessLoneBlockStatements": "on",
118
+ "noUselessRename": "on",
119
+ "noUselessStringConcat": "on",
120
+ "noUselessStringRaw": "on",
121
+ "noUselessSwitchCase": "on",
122
+ "noUselessTernary": "on",
123
+ "noUselessThisAlias": "on",
124
+ "noUselessTypeConstraint": "on",
125
+ "noUselessUndefinedInitialization": "on",
126
+ "noVoid": "off",
127
+ "useArrowFunction": "on",
128
+ "useDateNow": "on",
129
+ "useFlatMap": "on",
130
+ "useIndexOf": "on",
131
+ "useLiteralKeys": "off",
132
+ "useNumericLiterals": "on",
133
+ "useOptionalChain": "on",
134
+ "useRegexLiterals": "on",
135
+ "useSimpleNumberKeys": "on",
136
+ "useSimplifiedLogicExpression": "on",
137
+ "useWhile": "on"
138
+ },
139
+ "correctness": {
140
+ "noChildrenProp": "on",
141
+ "noConstAssign": "on",
142
+ "noConstantCondition": "on",
143
+ "noConstantMathMinMaxClamp": "on",
144
+ "noConstructorReturn": "on",
145
+ "noEmptyCharacterClassInRegex": "on",
146
+ "noEmptyPattern": "on",
147
+ "noGlobalDirnameFilename": "on",
148
+ "noGlobalObjectCalls": "on",
149
+ "noInnerDeclarations": "on",
150
+ "noInvalidBuiltinInstantiation": "on",
151
+ "noInvalidConstructorSuper": "on",
152
+ "noInvalidDirectionInLinearGradient": "on",
153
+ "noInvalidGridAreas": "on",
154
+ "noInvalidPositionAtImportRule": "on",
155
+ "noInvalidUseBeforeDeclaration": "on",
156
+ "noMissingVarFunction": "on",
157
+ "noNestedComponentDefinitions": "on",
158
+ "noNodejsModules": "off",
159
+ "noNonoctalDecimalEscape": "on",
160
+ "noPrecisionLoss": "on",
161
+ "noPrivateImports": "on",
162
+ "noProcessGlobal": "on",
163
+ "noReactPropAssignments": "on",
164
+ "noRenderReturnValue": "on",
165
+ "noRestrictedElements": "on",
166
+ "noSelfAssign": "on",
167
+ "noSetterReturn": "on",
168
+ "noSolidDestructuredProps": "off",
169
+ "noStringCaseMismatch": "on",
170
+ "noSwitchDeclarations": "on",
171
+ "noUndeclaredDependencies": "off",
172
+ "noUndeclaredVariables": "off",
173
+ "noUnknownFunction": "on",
174
+ "noUnknownMediaFeatureName": "on",
175
+ "noUnknownProperty": "on",
176
+ "noUnknownPseudoClass": "on",
177
+ "noUnknownPseudoElement": "on",
178
+ "noUnknownTypeSelector": "on",
179
+ "noUnknownUnit": "on",
180
+ "noUnmatchableAnbSelector": "on",
181
+ "noUnreachable": "on",
182
+ "noUnreachableSuper": "on",
183
+ "noUnsafeFinally": "on",
184
+ "noUnsafeOptionalChaining": "on",
185
+ "noUnusedFunctionParameters": "on",
186
+ "noUnusedImports": "on",
187
+ "noUnusedLabels": "on",
188
+ "noUnusedPrivateClassMembers": "on",
189
+ "noUnusedVariables": "on",
190
+ "noVoidElementsWithChildren": "on",
191
+ "noVoidTypeReturn": "on",
192
+ "useExhaustiveDependencies": "on",
193
+ "useGraphqlNamedOperations": "on",
194
+ "useHookAtTopLevel": "on",
195
+ "useImportExtensions": "on",
196
+ "useIsNan": "on",
197
+ "useJsonImportAttributes": "on",
198
+ "useJsxKeyInIterable": "on",
199
+ "useParseIntRadix": "on",
200
+ "useSingleJsDocAsterisk": "on",
201
+ "useUniqueElementIds": "on",
202
+ "useValidForDirection": "on",
203
+ "useValidTypeof": "on",
204
+ "useYield": "on"
205
+ },
206
+ "nursery": {
207
+ "noDuplicateDependencies": "on",
208
+ "noFloatingPromises": "on",
209
+ "noImportCycles": "on",
210
+ "noJsxLiterals": "on",
211
+ "noMisusedPromises": "on",
212
+ "noNextAsyncClientComponent": "on",
213
+ "noNonNullAssertedOptionalChain": "on",
214
+ "noQwikUseVisibleTask": "on",
215
+ "noSecrets": "off",
216
+ "noShadow": "on",
217
+ "noUnnecessaryConditions": "on",
218
+ "noUnresolvedImports": "off",
219
+ "noUselessCatchBinding": "on",
220
+ "noUselessUndefined": "on",
221
+ "noVueDataObjectDeclaration": "on",
222
+ "noVueReservedKeys": "on",
223
+ "noVueReservedProps": "on",
224
+ "useAnchorHref": "on",
225
+ "useConsistentArrowReturn": "on",
226
+ "useConsistentTypeDefinitions": "on",
227
+ "useExhaustiveSwitchCases": "on",
228
+ "useExplicitType": "off",
229
+ "useImageSize": "on",
230
+ "useMaxParams": "on",
231
+ "useQwikClasslist": "on",
232
+ "useReactFunctionComponents": "on",
233
+ "useSortedClasses": "on",
234
+ "useVueMultiWordComponentNames": "on"
235
+ },
236
+ "performance": {
237
+ "noAccumulatingSpread": "on",
238
+ "noAwaitInLoops": "on",
239
+ "noBarrelFile": "off",
240
+ "noDelete": "on",
241
+ "noDynamicNamespaceImportAccess": "on",
242
+ "noImgElement": "on",
243
+ "noNamespaceImport": "off",
244
+ "noReExportAll": "on",
245
+ "noUnwantedPolyfillio": "on",
246
+ "useGoogleFontPreconnect": "on",
247
+ "useSolidForComponent": "on",
248
+ "useTopLevelRegex": "on"
249
+ },
250
+ "security": {
251
+ "noBlankTarget": "on",
252
+ "noDangerouslySetInnerHtml": "on",
253
+ "noDangerouslySetInnerHtmlWithChildren": "on",
254
+ "noGlobalEval": "on"
255
+ },
256
+ "style": {
257
+ "noCommonJs": "on",
258
+ "noDefaultExport": "on",
259
+ "noDescendingSpecificity": "on",
260
+ "noDoneCallback": "on",
261
+ "noEnum": "off",
262
+ "noExportedImports": "on",
263
+ "noHeadElement": "on",
264
+ "noImplicitBoolean": "on",
265
+ "noInferrableTypes": "on",
266
+ "noMagicNumbers": "on",
267
+ "noNamespace": "on",
268
+ "noNegationElse": "on",
269
+ "noNestedTernary": "on",
270
+ "noNonNullAssertion": "on",
271
+ "noParameterAssign": "on",
272
+ "noParameterProperties": "on",
273
+ "noProcessEnv": "off",
274
+ "noRestrictedGlobals": "on",
275
+ "noRestrictedImports": "on",
276
+ "noRestrictedTypes": "on",
277
+ "noShoutyConstants": "on",
278
+ "noSubstr": "on",
279
+ "noUnusedTemplateLiteral": "on",
280
+ "noUselessElse": "on",
281
+ "noValueAtRule": "on",
282
+ "noYodaExpression": "on",
283
+ "useArrayLiterals": "on",
284
+ "useAsConstAssertion": "on",
285
+ "useAtIndex": "on",
286
+ "useBlockStatements": "off",
287
+ "useCollapsedElseIf": "on",
288
+ "useCollapsedIf": "on",
289
+ "useComponentExportOnlyModules": "on",
290
+ "useConsistentArrayType": "on",
291
+ "useConsistentBuiltinInstantiation": "on",
292
+ "useConsistentCurlyBraces": "on",
293
+ "useConsistentMemberAccessibility": {
294
+ "level": "on",
295
+ "options": {
296
+ "accessibility": "explicit"
297
+ }
298
+ },
299
+ "useConsistentObjectDefinitions": "on",
300
+ "useConst": "on",
301
+ "useDefaultParameterLast": "on",
302
+ "useDefaultSwitchClause": "on",
303
+ "useDeprecatedReason": "on",
304
+ "useEnumInitializers": "on",
305
+ "useExplicitLengthCheck": "on",
306
+ "useExponentiationOperator": "on",
307
+ "useExportType": "on",
308
+ "useExportsLast": "off",
309
+ "useFilenamingConvention": "off",
310
+ "useForOf": "on",
311
+ "useFragmentSyntax": "on",
312
+ "useGraphqlNamingConvention": "on",
313
+ "useGroupedAccessorPairs": "on",
314
+ "useImportType": {
315
+ "level": "on",
316
+ "options": {
317
+ "style": "separatedType"
318
+ }
319
+ },
320
+ "useLiteralEnumMembers": "on",
321
+ "useNamingConvention": "off",
322
+ "useNodeAssertStrict": "on",
323
+ "useNodejsImportProtocol": "on",
324
+ "useNumberNamespace": "on",
325
+ "useNumericSeparators": "on",
326
+ "useObjectSpread": "on",
327
+ "useReadonlyClassProperties": "on",
328
+ "useSelfClosingElements": "on",
329
+ "useShorthandAssign": "on",
330
+ "useShorthandFunctionType": "on",
331
+ "useSingleVarDeclarator": "on",
332
+ "useSymbolDescription": "on",
333
+ "useTemplate": "on",
334
+ "useThrowNewError": "on",
335
+ "useThrowOnlyError": "on",
336
+ "useTrimStartEnd": "on",
337
+ "useUnifiedTypeSignatures": "on"
338
+ },
339
+ "suspicious": {
340
+ "noAlert": "on",
341
+ "noApproximativeNumericConstant": "on",
342
+ "noArrayIndexKey": "on",
343
+ "noAssignInExpressions": "on",
344
+ "noAsyncPromiseExecutor": "on",
345
+ "noBiomeFirstException": "on",
346
+ "noBitwiseOperators": "on",
347
+ "noCatchAssign": "on",
348
+ "noClassAssign": "on",
349
+ "noCommentText": "on",
350
+ "noCompareNegZero": "on",
351
+ "noConfusingLabels": "on",
352
+ "noConfusingVoidType": "on",
353
+ "noConsole": "off",
354
+ "noConstEnum": "on",
355
+ "noConstantBinaryExpressions": "on",
356
+ "noControlCharactersInRegex": "on",
357
+ "noDebugger": "on",
358
+ "noDocumentCookie": "on",
359
+ "noDocumentImportInPage": "on",
360
+ "noDoubleEquals": "on",
361
+ "noDuplicateAtImportRules": "on",
362
+ "noDuplicateCase": "on",
363
+ "noDuplicateClassMembers": "on",
364
+ "noDuplicateCustomProperties": "on",
365
+ "noDuplicateElseIf": "on",
366
+ "noDuplicateFields": "on",
367
+ "noDuplicateFontNames": "on",
368
+ "noDuplicateJsxProps": "on",
369
+ "noDuplicateObjectKeys": "on",
370
+ "noDuplicateParameters": "on",
371
+ "noDuplicateProperties": "on",
372
+ "noDuplicateSelectorsKeyframeBlock": "on",
373
+ "noDuplicateTestHooks": "on",
374
+ "noEmptyBlock": "on",
375
+ "noEmptyBlockStatements": "on",
376
+ "noEmptyInterface": "on",
377
+ "noEvolvingTypes": "on",
378
+ "noExplicitAny": "on",
379
+ "noExportsInTest": "on",
380
+ "noExtraNonNullAssertion": "on",
381
+ "noFallthroughSwitchClause": "on",
382
+ "noFocusedTests": "on",
383
+ "noFunctionAssign": "on",
384
+ "noGlobalAssign": "on",
385
+ "noGlobalIsFinite": "on",
386
+ "noGlobalIsNan": "on",
387
+ "noHeadImportInDocument": "on",
388
+ "noImplicitAnyLet": "on",
389
+ "noImportAssign": "on",
390
+ "noImportantInKeyframe": "on",
391
+ "noIrregularWhitespace": "on",
392
+ "noLabelVar": "on",
393
+ "noMisleadingCharacterClass": "on",
394
+ "noMisleadingInstantiator": "on",
395
+ "noMisplacedAssertion": "on",
396
+ "noMisrefactoredShorthandAssign": "on",
397
+ "noOctalEscape": "on",
398
+ "noPrototypeBuiltins": "on",
399
+ "noQuickfixBiome": "on",
400
+ "noReactSpecificProps": "off",
401
+ "noRedeclare": "on",
402
+ "noRedundantUseStrict": "on",
403
+ "noSelfCompare": "on",
404
+ "noShadowRestrictedNames": "on",
405
+ "noShorthandPropertyOverrides": "on",
406
+ "noSkippedTests": "on",
407
+ "noSparseArray": "on",
408
+ "noSuspiciousSemicolonInJsx": "on",
409
+ "noTemplateCurlyInString": "on",
410
+ "noThenProperty": "on",
411
+ "noTsIgnore": "on",
412
+ "noUnassignedVariables": "on",
413
+ "noUnknownAtRules": "on",
414
+ "noUnsafeDeclarationMerging": "on",
415
+ "noUnsafeNegation": "on",
416
+ "noUselessEscapeInString": "on",
417
+ "noUselessRegexBackrefs": "on",
418
+ "noVar": "on",
419
+ "noWith": "on",
420
+ "useAdjacentOverloadSignatures": "on",
421
+ "useAwait": "on",
422
+ "useBiomeIgnoreFolder": "on",
423
+ "useDefaultSwitchClauseLast": "on",
424
+ "useErrorMessage": "on",
425
+ "useGetterReturn": "on",
426
+ "useGoogleFontDisplay": "on",
427
+ "useGuardForIn": "on",
428
+ "useIsArray": "on",
429
+ "useIterableCallbackReturn": "on",
430
+ "useNamespaceKeyword": "on",
431
+ "useNumberToFixedDigitsArgument": "on",
432
+ "useStaticResponseMethods": "on",
433
+ "useStrictMode": "on"
434
+ }
435
+ }
436
+ }
437
+ }