@opinionated-ts/config 1.1.1 → 1.5.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 +2 -0
- package/lefthook.yml +39 -0
- package/package.json +6 -2
- package/tsconfig.json +42 -0
package/README.md
CHANGED
|
@@ -31,10 +31,12 @@ Each configuration can be used directly as a recommended default or customized d
|
|
|
31
31
|
|
|
32
32
|
See the configuration guides for each tool:
|
|
33
33
|
|
|
34
|
+
- [Typescript](./docs/tsconfig.md)
|
|
34
35
|
- [Commitlint](./docs/commitlint.md)
|
|
35
36
|
- [CSpell](./docs/cspell.md)
|
|
36
37
|
- [Oxfmt](./docs/oxfmt.md)
|
|
37
38
|
- [Oxlint](./docs/oxlint.md)
|
|
39
|
+
- [Lefthook](./docs/lefthook.md)
|
|
38
40
|
|
|
39
41
|
## Philosophy
|
|
40
42
|
|
package/lefthook.yml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
pre-commit:
|
|
2
|
+
parallel: true
|
|
3
|
+
jobs:
|
|
4
|
+
- name: format and lint
|
|
5
|
+
group:
|
|
6
|
+
piped: true
|
|
7
|
+
jobs:
|
|
8
|
+
- name: format
|
|
9
|
+
run: bun oxfmt --write {staged_files}
|
|
10
|
+
glob: "*.{js,jsx,ts,tsx,json,css,md,yml}"
|
|
11
|
+
stage_fixed: true
|
|
12
|
+
|
|
13
|
+
- name: lint
|
|
14
|
+
run: bun oxlint --fix {staged_files}
|
|
15
|
+
glob: "*.{ts,tsx,js,jsx}"
|
|
16
|
+
stage_fixed: true
|
|
17
|
+
|
|
18
|
+
# Example: add independent tasks that can run in parallel
|
|
19
|
+
# - name: other task
|
|
20
|
+
# run: bun other-task.ts {staged_files}
|
|
21
|
+
# glob: "*.{ts,tsx,js,jsx}"
|
|
22
|
+
# stage_fixed: true
|
|
23
|
+
|
|
24
|
+
commit-msg:
|
|
25
|
+
commands:
|
|
26
|
+
commitlint:
|
|
27
|
+
run: bunx commitlint --edit {1}
|
|
28
|
+
|
|
29
|
+
pre-push:
|
|
30
|
+
parallel: true
|
|
31
|
+
commands:
|
|
32
|
+
run-tests:
|
|
33
|
+
run: bun test
|
|
34
|
+
|
|
35
|
+
run-audit:
|
|
36
|
+
run: bun audit
|
|
37
|
+
fail_text: |
|
|
38
|
+
Security vulnerabilities detected.
|
|
39
|
+
Run `bun audit fix` manually to try resolving them.
|
package/package.json
CHANGED
|
@@ -38,13 +38,17 @@
|
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
41
|
+
"lefthook.yml",
|
|
42
|
+
"tsconfig.json",
|
|
41
43
|
"LICENSE",
|
|
42
44
|
"README.md"
|
|
43
45
|
],
|
|
44
46
|
"type": "module",
|
|
45
47
|
"exports": {
|
|
46
48
|
".": "./dist/index.mjs",
|
|
47
|
-
"./package.json": "./package.json"
|
|
49
|
+
"./package.json": "./package.json",
|
|
50
|
+
"./lefthook.yml": "./lefthook.yml",
|
|
51
|
+
"./tsconfig.json": "./tsconfig.json"
|
|
48
52
|
},
|
|
49
53
|
"publishConfig": {
|
|
50
54
|
"access": "public"
|
|
@@ -83,5 +87,5 @@
|
|
|
83
87
|
"node": "^26.2.0"
|
|
84
88
|
},
|
|
85
89
|
"packageManager": "bun@1.4.0",
|
|
86
|
-
"version": "1.
|
|
90
|
+
"version": "1.5.0"
|
|
87
91
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"types": ["bun", "node"],
|
|
11
|
+
|
|
12
|
+
// Bundler mode
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"allowImportingTsExtensions": true,
|
|
15
|
+
"verbatimModuleSyntax": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
|
|
18
|
+
// Best practices
|
|
19
|
+
"strict": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedIndexedAccess": true,
|
|
23
|
+
"noImplicitOverride": true,
|
|
24
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
25
|
+
"useUnknownInCatchVariables": true
|
|
26
|
+
|
|
27
|
+
// Some stricter flags
|
|
28
|
+
// "isolatedModules": true
|
|
29
|
+
// "isolatedDeclarations": true,
|
|
30
|
+
|
|
31
|
+
// "paths": {
|
|
32
|
+
// "@/*": ["./src/*"],
|
|
33
|
+
// // Preact compat for React
|
|
34
|
+
// "react": ["./node_modules/preact/compat/"],
|
|
35
|
+
// "react/jsx-runtime": ["./node_modules/preact/jsx-runtime"],
|
|
36
|
+
// "react-dom": ["./node_modules/preact/compat/"],
|
|
37
|
+
// "react-dom/*": ["./node_modules/preact/compat/*"]
|
|
38
|
+
// },
|
|
39
|
+
},
|
|
40
|
+
"include": ["src", "tests", "*.config.*"],
|
|
41
|
+
"exclude": []
|
|
42
|
+
}
|