adamantite 0.0.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 ADDED
@@ -0,0 +1,3 @@
1
+ # Adamantite
2
+
3
+ An opinionated set of presets for modern TypeScript applications.
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "adamantite",
3
+ "version": "0.0.1",
4
+ "description": "An strict and opinionated set of presets for modern TypeScript applications",
5
+ "keywords": [
6
+ "adamantite",
7
+ "biome",
8
+ "preset",
9
+ "formatter",
10
+ "linter",
11
+ "typescript"
12
+ ],
13
+ "homepage": "https://github.com/adelrodriguez/adamantite",
14
+ "bugs": {
15
+ "url": "https://github.com/adelrodriguez/adamantite/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/adelrodriguez/adamantite.git"
20
+ },
21
+ "license": "MIT",
22
+ "author": "Adel Rodriguez <hello@adelrodriguez.com>",
23
+ "type": "module",
24
+ "exports": {
25
+ ".": "./config/biome.jsonc",
26
+ "./tsconfig": "./tsconfig.base.json"
27
+ },
28
+ "files": [
29
+ "src/config/biome.jsonc",
30
+ "src/config/tsconfig.json"
31
+ ],
32
+ "scripts": {
33
+ "test": "bun test",
34
+ "test:watch": "bun --watch test"
35
+ },
36
+ "dependencies": {
37
+ "@biomejs/biome": "2.1.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/bun": "1.2.19"
41
+ },
42
+ "peerDependencies": {
43
+ "typescript": "5.8.3"
44
+ },
45
+ "packageManager": "bun@1.2.18"
46
+ }
@@ -0,0 +1,447 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
3
+ // ----------------------------- FORMATTER -----------------------------
4
+ // These are the generic settings that apply to all files in the project.
5
+ "formatter": {
6
+ "enabled": true,
7
+ // Format the code even if there are errors.
8
+ "formatWithErrors": true,
9
+ // Use spaces for indentation.
10
+ "indentStyle": "space",
11
+ // Use 2 spaces for indentation.
12
+ "indentWidth": 2,
13
+ // Use LF line endings.
14
+ "lineEnding": "lf",
15
+ // Good middle ground between readability and line length.
16
+ "lineWidth": 100,
17
+ // Don't force attributes to be on the same line as the element.
18
+ "attributePosition": "auto",
19
+ "bracketSpacing": true
20
+ },
21
+ // ----------------------------- ASSIST -----------------------------
22
+ // This is used to help with code completion and other IDE features.
23
+ "assist": {
24
+ "actions": {
25
+ "source": {
26
+ // Sort imports in a certain order. We prioritize runtime imports
27
+ // first (Bun, Node, etc.). Then external packages, and finally
28
+ // aliased imports.
29
+ "organizeImports": {
30
+ "level": "on",
31
+ "options": {
32
+ "groups": [":BUN:", ":NODE:", ":PACKAGE:", ":ALIAS:"]
33
+ }
34
+ },
35
+ "useSortedAttributes": "on",
36
+ "useSortedProperties": "on",
37
+ // Don't sort the keys of an object.
38
+ "useSortedKeys": "off"
39
+ }
40
+ }
41
+ },
42
+ // ----------------------------- LINTER -----------------------------
43
+ "linter": {
44
+ "enabled": true,
45
+ "rules": {
46
+ "a11y": {
47
+ "noAccessKey": "error",
48
+ "noAriaHiddenOnFocusable": "error",
49
+ "noAriaUnsupportedElements": "error",
50
+ "noDistractingElements": "error",
51
+ "noHeaderScope": "error",
52
+ "noInteractiveElementToNoninteractiveRole": "error",
53
+ "noLabelWithoutControl": "error",
54
+ "noNoninteractiveElementToInteractiveRole": "error",
55
+ "noNoninteractiveTabindex": "error",
56
+ "noPositiveTabindex": "error",
57
+ "noRedundantAlt": "error",
58
+ "noRedundantRoles": "error",
59
+ "noStaticElementInteractions": "error",
60
+ "noSvgWithoutTitle": "error",
61
+ "useAltText": "error",
62
+ "useAnchorContent": "error",
63
+ "useAriaActivedescendantWithTabindex": "error",
64
+ "useAriaPropsForRole": "error",
65
+ "useAriaPropsSupportedByRole": "error",
66
+ "useButtonType": "error",
67
+ "useFocusableInteractive": "error",
68
+ "useHeadingContent": "error",
69
+ "useHtmlLang": "error",
70
+ "useIframeTitle": "error",
71
+ "useKeyWithClickEvents": "error",
72
+ "useKeyWithMouseEvents": "error",
73
+ "useMediaCaption": "error",
74
+ "useSemanticElements": "error",
75
+ "useValidAnchor": "error",
76
+ "useValidAriaProps": "error",
77
+ "useValidAriaRole": "error",
78
+ "useValidAriaValues": "error",
79
+ "useValidAutocomplete": "error",
80
+ "useValidLang": "error",
81
+ "noAutofocus": "off",
82
+ "useGenericFontNames": "error"
83
+ },
84
+ "complexity": {
85
+ "noAdjacentSpacesInRegex": "error",
86
+ "noArguments": "error",
87
+ "noBannedTypes": "error",
88
+ "noCommaOperator": "error",
89
+ "noEmptyTypeParameters": "error",
90
+ "noExcessiveCognitiveComplexity": {
91
+ "level": "error",
92
+ "options": {
93
+ "maxAllowedComplexity": 18
94
+ }
95
+ },
96
+ "noExcessiveNestedTestSuites": "error",
97
+ "useSimplifiedLogicExpression": "error",
98
+ "useWhile": "error"
99
+ },
100
+ "correctness": {
101
+ // --------- JavaScript ---------
102
+
103
+ "noChildrenProp": "error",
104
+ "noConstantCondition": "error",
105
+ "noConstantMathMinMaxClamp": "error",
106
+ "noConstAssign": "error",
107
+ "noConstructorReturn": "error",
108
+ "noEmptyCharacterClassInRegex": "error",
109
+ "noEmptyPattern": "error",
110
+ "noGlobalObjectCalls": "error",
111
+ "noInnerDeclarations": "error",
112
+ "noInvalidBuiltinInstantiation": "error",
113
+ "noInvalidConstructorSuper": "error",
114
+ "noInvalidUseBeforeDeclaration": "error",
115
+ "noNodejsModules": "off",
116
+ "noNonoctalDecimalEscape": "error",
117
+ "noPrecisionLoss": "error",
118
+ "noPrivateImports": "error",
119
+ "noRenderReturnValue": "error",
120
+ "noSelfAssign": "error",
121
+ "noSetterReturn": "error",
122
+ "noStringCaseMismatch": "error",
123
+ "noSwitchDeclarations": "error",
124
+ "noUndeclaredDependencies": "off",
125
+ "noUndeclaredVariables": "error",
126
+ "noUnreachable": "error",
127
+ "noUnreachableSuper": "error",
128
+ "noUnsafeFinally": "error",
129
+ "noUnsafeOptionalChaining": "error",
130
+ "noUnusedFunctionParameters": "error",
131
+ "noUnusedImports": "error",
132
+ "noUnusedLabels": "error",
133
+ "noUnusedPrivateClassMembers": "error",
134
+ "noUnusedVariables": "error",
135
+ "noVoidElementsWithChildren": "error",
136
+ "noVoidTypeReturn": "error",
137
+ "useExhaustiveDependencies": "error",
138
+ "useHookAtTopLevel": "error",
139
+ "useImportExtensions": "off",
140
+ "useIsNan": "error",
141
+ "useJsxKeyInIterable": "error",
142
+ "useValidForDirection": "error",
143
+ "useValidTypeof": "error",
144
+ "useYield": "error",
145
+
146
+ // --------- CSS ---------
147
+ "noInvalidDirectionInLinearGradient": "error",
148
+ "noInvalidGridAreas": "error",
149
+ "noInvalidPositionAtImportRule": "error",
150
+ "noMissingVarFunction": "error",
151
+ "noUnknownFunction": "error",
152
+ "noUnknownMediaFeatureName": "error",
153
+ "noUnknownProperty": "error",
154
+ "noUnknownPseudoClass": "error",
155
+ "noUnknownPseudoElement": "error",
156
+ "noUnknownTypeSelector": "error",
157
+ "noUnknownUnit": "error",
158
+ "noUnmatchableAnbSelector": "error"
159
+ },
160
+ "nursery": {
161
+ // --------- JavaScript ---------
162
+
163
+ "noAwaitInLoop": "error",
164
+ "noBitwiseOperators": "error",
165
+ "noConstantBinaryExpression": "error",
166
+ "noGlobalDirnameFilename": "error",
167
+ "noNestedComponentDefinitions": "error",
168
+ "noNoninteractiveElementInteractions": "error",
169
+ "noReactPropAssign": "error",
170
+ "noRestrictedElements": "error",
171
+ "noShadow": "error",
172
+ "noTsIgnore": "error",
173
+ "noUnwantedPolyfillio": "error",
174
+ "noUselessBackrefInRegex": "error",
175
+ "noUselessEscapeInString": "error",
176
+ "noUselessUndefined": "error",
177
+ "useAdjacentGetterSetter": "error",
178
+ "useConsistentObjectDefinition": "error",
179
+ "useConsistentResponse": "error",
180
+ "useExhaustiveSwitchCases": "error",
181
+ "useGoogleFontPreconnect": "error",
182
+ "useIndexOf": "error",
183
+ "useIterableCallbackReturn": "error",
184
+ "useJsonImportAttribute": "error",
185
+ "useNumericSeparators": "error",
186
+ "useObjectSpread": "error",
187
+ "useParseIntRadix": "error",
188
+ "useSingleJsDocAsterisk": "error",
189
+ "useSymbolDescription": "error",
190
+
191
+ "useExplicitType": "off",
192
+
193
+ "noProcessGlobal": "off",
194
+ "noSecrets": "off",
195
+ "useExportsLast": "off",
196
+ "useSortedClasses": {
197
+ "fix": "safe",
198
+ "level": "error",
199
+ "options": {
200
+ "attributes": ["className"],
201
+ "functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
202
+ }
203
+ },
204
+ "useUniqueElementIds": "off",
205
+
206
+ // These rules should be enabled eventually
207
+ "noFloatingPromises": "off",
208
+ "noImportCycles": "off",
209
+ "noUnresolvedImports": "off",
210
+
211
+ // --------- CSS ---------
212
+ "noImportantStyles": "error",
213
+ // Disabling this rule since we need custom at-rules for Tailwind
214
+ "noUnknownAtRule": "off"
215
+ },
216
+ "performance": {
217
+ // --------- JavaScript ---------
218
+
219
+ "noAccumulatingSpread": "error",
220
+ "noBarrelFile": "off",
221
+ "noDelete": "error",
222
+ "noDynamicNamespaceImportAccess": "error",
223
+ "noImgElement": "error",
224
+ "noNamespaceImport": "off",
225
+ "noReExportAll": "off",
226
+ "useTopLevelRegex": "error"
227
+ },
228
+ "security": {
229
+ // --------- JavaScript ---------
230
+
231
+ "noBlankTarget": "error",
232
+ "noDangerouslySetInnerHtml": "error",
233
+ "noDangerouslySetInnerHtmlWithChildren": "error",
234
+ "noGlobalEval": "error"
235
+ },
236
+ "style": {
237
+ // --------- JavaScript ---------
238
+ "noCommonJs": "off",
239
+ "noDefaultExport": "off",
240
+ "noDoneCallback": "error",
241
+ "noEnum": "error",
242
+ "noExportedImports": "error",
243
+ "noHeadElement": "error",
244
+ "noImplicitBoolean": "off",
245
+ "noInferrableTypes": "error",
246
+ "noNamespace": "error",
247
+ "noNegationElse": "error",
248
+ "noNestedTernary": "off",
249
+ "noNonNullAssertion": "error",
250
+ "noParameterAssign": "error",
251
+ "noParameterProperties": "error",
252
+ "noProcessEnv": "off",
253
+ "noRestrictedGlobals": "error",
254
+ "noRestrictedImports": "error",
255
+ "noRestrictedTypes": "error",
256
+ "noShoutyConstants": "error",
257
+ "noSubstr": "error",
258
+ "noUnusedTemplateLiteral": "error",
259
+ "noUselessElse": "error",
260
+ "noYodaExpression": "error",
261
+ "useArrayLiterals": "error",
262
+ "useAsConstAssertion": "error",
263
+ "useAtIndex": "error",
264
+ "useBlockStatements": "error",
265
+ "useCollapsedElseIf": "error",
266
+ "useCollapsedIf": "error",
267
+ "useComponentExportOnlyModules": "off",
268
+ "useConsistentArrayType": "error",
269
+ "useConsistentBuiltinInstantiation": "error",
270
+ "useConsistentCurlyBraces": "off",
271
+ "useConsistentMemberAccessibility": "error",
272
+ "useConst": "error",
273
+ "useDefaultParameterLast": "error",
274
+ "useDefaultSwitchClause": "error",
275
+ "useEnumInitializers": "error",
276
+ "useExplicitLengthCheck": "off",
277
+ "useExponentiationOperator": "error",
278
+ "useExportType": "error",
279
+ "useFilenamingConvention": {
280
+ "level": "error",
281
+ "options": {
282
+ "filenameCases": ["kebab-case"],
283
+ "requireAscii": true,
284
+ "match": "[-?%+]?(.+?)[.](.+)"
285
+ }
286
+ },
287
+ "useForOf": "error",
288
+ "useFragmentSyntax": "error",
289
+ "useImportType": "error",
290
+ "useLiteralEnumMembers": "error",
291
+ "useNamingConvention": "off",
292
+ "useNodeAssertStrict": "error",
293
+ "useNodejsImportProtocol": "error",
294
+ "useNumberNamespace": "error",
295
+ "useSelfClosingElements": "error",
296
+ "useShorthandAssign": "error",
297
+ "useShorthandFunctionType": "error",
298
+ "useSingleVarDeclarator": "off",
299
+ "useTemplate": "error",
300
+ "useThrowNewError": "error",
301
+ "useThrowOnlyError": "error",
302
+ "useTrimStartEnd": "error",
303
+
304
+ // --------- CSS ---------
305
+ "noDescendingSpecificity": "error",
306
+ "noValueAtRule": "error"
307
+ },
308
+ "suspicious": {
309
+ "noApproximativeNumericConstant": "error",
310
+ "noArrayIndexKey": "error",
311
+ "noAssignInExpressions": "error",
312
+ "noAsyncPromiseExecutor": "error",
313
+ "noCatchAssign": "error",
314
+ "noClassAssign": "error",
315
+ "noCommentText": "error",
316
+ "noCompareNegZero": "error",
317
+ "noConfusingLabels": "error",
318
+ "noConfusingVoidType": "error",
319
+ // Warn for the use of console to avoid accidental logging. Prefer a dedicated logger.
320
+ "noConsole": "warn",
321
+ "noConstEnum": "error",
322
+ "noControlCharactersInRegex": "error",
323
+ "noDebugger": "error",
324
+ "noDocumentCookie": "error",
325
+ "noDocumentImportInPage": "error",
326
+ "noDoubleEquals": "error",
327
+ "noDuplicateCase": "error",
328
+ "noDuplicateClassMembers": "error",
329
+ "noDuplicateElseIf": "error",
330
+ "noDuplicateJsxProps": "error",
331
+ "noDuplicateObjectKeys": "error",
332
+ "noDuplicateParameters": "error",
333
+ "noDuplicateTestHooks": "error",
334
+ "noEmptyBlockStatements": "error",
335
+ "noEmptyInterface": "error",
336
+ "noEvolvingTypes": "error",
337
+ "noExplicitAny": "error",
338
+ "noExportsInTest": "error",
339
+ "noExtraNonNullAssertion": "error",
340
+ "noFallthroughSwitchClause": "error",
341
+ "noFocusedTests": "error",
342
+ "noFunctionAssign": "error",
343
+ "noGlobalAssign": "error",
344
+ "noGlobalIsFinite": "error",
345
+ "noGlobalIsNan": "error",
346
+ "noHeadImportInDocument": "error",
347
+ "noImplicitAnyLet": "error",
348
+ "noImportAssign": "error",
349
+ "noIrregularWhitespace": "error",
350
+ "noLabelVar": "error",
351
+ "noMisleadingCharacterClass": "error",
352
+ "noMisleadingInstantiator": "error",
353
+ "noMisplacedAssertion": "error",
354
+ "noMisrefactoredShorthandAssign": "error",
355
+ "noOctalEscape": "error",
356
+ "noPrototypeBuiltins": "error",
357
+ "noReactSpecificProps": "off",
358
+ "noRedeclare": "error",
359
+ "noRedundantUseStrict": "error",
360
+ "noSelfCompare": "error",
361
+ "noShadowRestrictedNames": "error",
362
+ "noSkippedTests": "error",
363
+ "noSparseArray": "error",
364
+ "noSuspiciousSemicolonInJsx": "error",
365
+ "noTemplateCurlyInString": "error",
366
+ "noThenProperty": "error",
367
+ "noUnsafeDeclarationMerging": "error",
368
+ "noUnsafeNegation": "error",
369
+ "noVar": "error",
370
+ "noWith": "error",
371
+ "useAdjacentOverloadSignatures": "error",
372
+ "useAwait": "error",
373
+ "useDefaultSwitchClauseLast": "error",
374
+ "useErrorMessage": "error",
375
+ "useGetterReturn": "error",
376
+ "useGoogleFontDisplay": "error",
377
+ "useGuardForIn": "error",
378
+ "useIsArray": "error",
379
+ "useNamespaceKeyword": "error",
380
+ "useNumberToFixedDigitsArgument": "error",
381
+ "useStrictMode": "error",
382
+
383
+ // --------- CSS ---------
384
+ "noDuplicateAtImportRules": "error",
385
+ "noDuplicateCustomProperties": "error",
386
+ "noDuplicateFontNames": "error",
387
+ "noDuplicateProperties": "error",
388
+ "noDuplicateSelectorsKeyframeBlock": "error",
389
+ "noEmptyBlock": "error",
390
+ "noImportantInKeyframe": "error",
391
+ "noShorthandPropertyOverrides": "error"
392
+ }
393
+ }
394
+ },
395
+ // ------------------------------ JAVASCRIPT ------------------------------
396
+ // Options for JavaScript and TypeScript files.
397
+ "javascript": {
398
+ "formatter": {
399
+ "arrowParentheses": "always",
400
+ "attributePosition": "auto",
401
+ "bracketSameLine": false,
402
+ "bracketSpacing": true,
403
+ "enabled": true,
404
+ "indentStyle": "space",
405
+ "jsxQuoteStyle": "double",
406
+ "quoteProperties": "asNeeded",
407
+ "quoteStyle": "double",
408
+ // Only use semicolons to clear up ambiguity. We are of the opinion that
409
+ // JavaScript code without semicolons is more elegant.
410
+ "semicolons": "asNeeded",
411
+ "trailingCommas": "es5"
412
+ }
413
+ },
414
+ // --------------------------------- CSS -------------------------------
415
+ "css": {
416
+ "formatter": {
417
+ "quoteStyle": "double"
418
+ },
419
+ "parser": {
420
+ "allowWrongLineComments": false,
421
+ "cssModules": false
422
+ }
423
+ },
424
+ // ------------------------------- JSON ------------------------------
425
+ "json": {
426
+ "assist": {
427
+ "enabled": true
428
+ },
429
+ "formatter": {
430
+ "enabled": true,
431
+ "indentStyle": "space",
432
+ "indentWidth": 2,
433
+ "lineEnding": "lf",
434
+ "lineWidth": 80,
435
+ "trailingCommas": "none"
436
+ },
437
+ "linter": {
438
+ "enabled": true
439
+ }
440
+ },
441
+ "vcs": {
442
+ "clientKind": "git",
443
+ "defaultBranch": "main",
444
+ "enabled": true,
445
+ "useIgnoreFile": true
446
+ }
447
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ // Base options
5
+ "esModuleInterop": true,
6
+ "skipLibCheck": true,
7
+ "verbatimModuleSyntax": true,
8
+ "allowJs": true,
9
+ "resolveJsonModule": true,
10
+ "moduleDetection": "force",
11
+
12
+ // Strictness and best practices
13
+ "strict": true,
14
+ "noUncheckedIndexedAccess": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noImplicitOverride": true,
17
+ "forceConsistentCasingInFileNames": true,
18
+ "noUnusedParameters": true,
19
+ "noPropertyAccessFromIndexSignature": true,
20
+ "noImplicitThis": true,
21
+ "noImplicitReturns": true
22
+ }
23
+ }