@adamhl8/configs 0.1.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.
- package/README.md +34 -0
- package/configs/biome.jsonc +156 -0
- package/configs/prettier.js +30 -0
- package/configs/tsconfig.json +33 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# configs
|
|
2
|
+
|
|
3
|
+
Configs (`tsconfig`, `biome`, etc) I use across my projects.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bun add -D @adamhl8/configs
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
### tsconfig
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"extends": "@adamhl8/configs/tsconfig"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### biome
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
22
|
+
"extends": ["@adamhl8/configs/biome"]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### prettier
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { prettierConfig } from "@adamhl8/configs/prettier"
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
...prettierConfig,
|
|
33
|
+
}
|
|
34
|
+
```
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"vcs": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"clientKind": "git",
|
|
7
|
+
"useIgnoreFile": true
|
|
8
|
+
},
|
|
9
|
+
"formatter": {
|
|
10
|
+
"indentStyle": "space",
|
|
11
|
+
"lineWidth": 120
|
|
12
|
+
},
|
|
13
|
+
"linter": {
|
|
14
|
+
"rules": {
|
|
15
|
+
"complexity": {
|
|
16
|
+
"useLiteralKeys": "off",
|
|
17
|
+
"noExcessiveCognitiveComplexity": "on",
|
|
18
|
+
"noExcessiveNestedTestSuites": "on",
|
|
19
|
+
"noForEach": "on",
|
|
20
|
+
"noUselessStringConcat": "on",
|
|
21
|
+
"useSimplifiedLogicExpression": "on",
|
|
22
|
+
"useWhile": "on"
|
|
23
|
+
},
|
|
24
|
+
"correctness": {
|
|
25
|
+
"noRenderReturnValue": "on",
|
|
26
|
+
"useExhaustiveDependencies": "on",
|
|
27
|
+
"useHookAtTopLevel": "on",
|
|
28
|
+
"useImportExtensions": "on",
|
|
29
|
+
"useJsxKeyInIterable": "on"
|
|
30
|
+
},
|
|
31
|
+
"nursery": {
|
|
32
|
+
"noAwaitInLoop": "on",
|
|
33
|
+
"noConstantBinaryExpression": "on",
|
|
34
|
+
"noFloatingPromises": "on",
|
|
35
|
+
"noGlobalDirnameFilename": "on",
|
|
36
|
+
"noImplicitCoercion": "on",
|
|
37
|
+
"noImportCycles": "on",
|
|
38
|
+
"noNestedComponentDefinitions": "on",
|
|
39
|
+
"noNoninteractiveElementInteractions": "on",
|
|
40
|
+
"noProcessGlobal": "on",
|
|
41
|
+
"noReactPropAssign": "on",
|
|
42
|
+
"noSecrets": "on",
|
|
43
|
+
"noShadow": "on",
|
|
44
|
+
"noTsIgnore": "on",
|
|
45
|
+
"noUnassignedVariables": "on",
|
|
46
|
+
"noUselessBackrefInRegex": "on",
|
|
47
|
+
"noUselessEscapeInString": "on",
|
|
48
|
+
"noUselessUndefined": "on",
|
|
49
|
+
"useAdjacentGetterSetter": "on",
|
|
50
|
+
"useConsistentObjectDefinition": "on",
|
|
51
|
+
"useConsistentResponse": "on",
|
|
52
|
+
"useExhaustiveSwitchCases": "on",
|
|
53
|
+
"useGoogleFontPreconnect": "on",
|
|
54
|
+
"useIndexOf": "on",
|
|
55
|
+
"useIterableCallbackReturn": "on",
|
|
56
|
+
"useJsonImportAttribute": "on",
|
|
57
|
+
"useNumericSeparators": "on",
|
|
58
|
+
"useObjectSpread": "on",
|
|
59
|
+
"useParseIntRadix": "on",
|
|
60
|
+
"useReadonlyClassProperties": "on",
|
|
61
|
+
"useSingleJsDocAsterisk": "on",
|
|
62
|
+
"useSortedClasses": "on",
|
|
63
|
+
"useSymbolDescription": "on",
|
|
64
|
+
"useUnifiedTypeSignature": "on",
|
|
65
|
+
"useUniqueElementIds": "on"
|
|
66
|
+
},
|
|
67
|
+
"performance": {
|
|
68
|
+
"noBarrelFile": "on",
|
|
69
|
+
"noDelete": "on",
|
|
70
|
+
"noNamespaceImport": "on",
|
|
71
|
+
"noReExportAll": "on",
|
|
72
|
+
"useTopLevelRegex": "on"
|
|
73
|
+
},
|
|
74
|
+
"style": {
|
|
75
|
+
"useImportType": {
|
|
76
|
+
"level": "on",
|
|
77
|
+
"options": {
|
|
78
|
+
"style": "separatedType"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"noCommonJs": "on",
|
|
82
|
+
"noDefaultExport": "on",
|
|
83
|
+
"noDoneCallback": "on",
|
|
84
|
+
"noExportedImports": "on",
|
|
85
|
+
"noImplicitBoolean": "on",
|
|
86
|
+
"noInferrableTypes": "on",
|
|
87
|
+
"noNegationElse": "on",
|
|
88
|
+
"noNestedTernary": "on",
|
|
89
|
+
"noParameterAssign": "on",
|
|
90
|
+
"noParameterProperties": "on",
|
|
91
|
+
"noShoutyConstants": "on",
|
|
92
|
+
"noSubstr": "on",
|
|
93
|
+
"noUnusedTemplateLiteral": "on",
|
|
94
|
+
"noUselessElse": "on",
|
|
95
|
+
"noYodaExpression": "on",
|
|
96
|
+
"useAsConstAssertion": "on",
|
|
97
|
+
"useAtIndex": "on",
|
|
98
|
+
"useCollapsedElseIf": "on",
|
|
99
|
+
"useCollapsedIf": "on",
|
|
100
|
+
"useComponentExportOnlyModules": "on",
|
|
101
|
+
"useConsistentArrayType": "on",
|
|
102
|
+
"useConsistentBuiltinInstantiation": "on",
|
|
103
|
+
"useConsistentCurlyBraces": "on",
|
|
104
|
+
"useConsistentMemberAccessibility": "on",
|
|
105
|
+
"useDefaultParameterLast": "on",
|
|
106
|
+
"useDefaultSwitchClause": "on",
|
|
107
|
+
"useExplicitLengthCheck": "on",
|
|
108
|
+
"useForOf": "on",
|
|
109
|
+
"useFragmentSyntax": "on",
|
|
110
|
+
"useNodeAssertStrict": "on",
|
|
111
|
+
"useNodejsImportProtocol": "on",
|
|
112
|
+
"useNumberNamespace": "on",
|
|
113
|
+
"useSelfClosingElements": "on",
|
|
114
|
+
"useShorthandAssign": "on",
|
|
115
|
+
"useSingleVarDeclarator": "on",
|
|
116
|
+
"useThrowNewError": "on",
|
|
117
|
+
"useThrowOnlyError": "on",
|
|
118
|
+
"useTrimStartEnd": "on"
|
|
119
|
+
},
|
|
120
|
+
"suspicious": {
|
|
121
|
+
"noDuplicateTestHooks": "on",
|
|
122
|
+
"noEmptyBlockStatements": "on",
|
|
123
|
+
"noEvolvingTypes": "on",
|
|
124
|
+
"noExportsInTest": "on",
|
|
125
|
+
"noMisplacedAssertion": "on",
|
|
126
|
+
"noVar": "on",
|
|
127
|
+
"useAwait": "on",
|
|
128
|
+
"useErrorMessage": "on",
|
|
129
|
+
"useGuardForIn": "on",
|
|
130
|
+
"useNumberToFixedDigitsArgument": "on"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"javascript": {
|
|
135
|
+
"formatter": {
|
|
136
|
+
"semicolons": "asNeeded"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"assist": {
|
|
140
|
+
"enabled": true,
|
|
141
|
+
"actions": {
|
|
142
|
+
"source": {
|
|
143
|
+
"organizeImports": {
|
|
144
|
+
"level": "on",
|
|
145
|
+
"options": {
|
|
146
|
+
"groups": [
|
|
147
|
+
[":NODE:", ":BUN:", ":URL:", ":PACKAGE_WITH_PROTOCOL:", ":PACKAGE:"],
|
|
148
|
+
":BLANK_LINE:",
|
|
149
|
+
[":ALIAS:", ":PATH:"]
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @type {import("prettier").Config} */
|
|
2
|
+
const prettierConfig = {
|
|
3
|
+
printWidth: 120,
|
|
4
|
+
semi: false,
|
|
5
|
+
plugins: [
|
|
6
|
+
// "@prettier/plugin-xml", currently broken
|
|
7
|
+
"prettier-plugin-sh",
|
|
8
|
+
"prettier-plugin-toml",
|
|
9
|
+
"prettier-plugin-astro",
|
|
10
|
+
"prettier-plugin-tailwindcss",
|
|
11
|
+
],
|
|
12
|
+
tailwindStylesheet: "./src/global.css",
|
|
13
|
+
overrides: [
|
|
14
|
+
{
|
|
15
|
+
// https://github.com/prettier/prettier/issues/15956
|
|
16
|
+
files: "*.jsonc",
|
|
17
|
+
options: {
|
|
18
|
+
trailingComma: "none",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
files: "*.astro",
|
|
23
|
+
options: {
|
|
24
|
+
parser: "astro",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { prettierConfig }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"moduleDetection": "force",
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"allowJs": true,
|
|
15
|
+
"checkJs": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
|
|
18
|
+
// Strictness
|
|
19
|
+
"strict": true,
|
|
20
|
+
"allowUnreachableCode": false,
|
|
21
|
+
"allowUnusedLabels": false,
|
|
22
|
+
"exactOptionalPropertyTypes": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"noImplicitOverride": true,
|
|
25
|
+
"noImplicitReturns": true,
|
|
26
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
27
|
+
"noUncheckedIndexedAccess": true,
|
|
28
|
+
"noUnusedLocals": true,
|
|
29
|
+
"noUnusedParameters": true,
|
|
30
|
+
"forceConsistentCasingInFileNames": true,
|
|
31
|
+
"noUncheckedSideEffectImports": true
|
|
32
|
+
}
|
|
33
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adamhl8/configs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/adamhl8/configs"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/adamhl8/configs",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/adamhl8/configs/issues"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"email": "adamhl@pm.me",
|
|
15
|
+
"name": "Adam Langbert",
|
|
16
|
+
"url": "https://github.com/adamhl8"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./tsconfig": "./configs/tsconfig.json",
|
|
21
|
+
"./biome": "./configs/biome.jsonc",
|
|
22
|
+
"./prettier": "./configs/prettier.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"configs/"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"prepublish": "bun lint",
|
|
29
|
+
"lint": "biome check --write"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@prettier/plugin-xml": "^3.4.1",
|
|
33
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
34
|
+
"prettier-plugin-sh": "^0.18.0",
|
|
35
|
+
"prettier-plugin-tailwindcss": "^0.6.13",
|
|
36
|
+
"prettier-plugin-toml": "^2.0.5"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@biomejs/biome": "^2.0.6",
|
|
40
|
+
"@types/bun": "^1.2.17",
|
|
41
|
+
"prettier": "^3.6.2",
|
|
42
|
+
"typescript": "^5.8.3"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
}
|
|
47
|
+
}
|