Skip to content

Commit ed8b9c9

Browse files
committed
Switched to modern tools
1 parent 1ecf192 commit ed8b9c9

9 files changed

Lines changed: 489 additions & 299 deletions

File tree

.eslintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: 🚀 PR
2+
3+
concurrency:
4+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on: [pull_request] # Run only on pull_request, to also get status updates in PRs. We omit push because this would run the steps two times (for push and pull_request).
8+
9+
permissions:
10+
actions: write
11+
contents: read
12+
# Required to put a comment into the pull-request
13+
pull-requests: write
14+
15+
jobs:
16+
lint:
17+
name: ⬣ Linting
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: biomejs/setup-biome@v2
22+
- run: biome ci . --reporter=github
23+
24+
typecheck:
25+
name: 🔎 Type check
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: 🛑 Cancel Previous Runs
29+
uses: styfle/cancel-workflow-action@0.12.1
30+
31+
- name: ⬇️ Checkout repo
32+
uses: actions/checkout@v4
33+
34+
- name: ⎔ Setup node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version-file: "package.json"
38+
39+
- name: 📥 Download deps
40+
uses: bahmutov/npm-install@v1
41+
with:
42+
useLockFile: false
43+
44+
- name: 🔎 Type check
45+
run: npm run typecheck
46+
47+
vitest:
48+
name: ⚡ Unit Tests
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: 🛑 Cancel Previous Runs
52+
uses: styfle/cancel-workflow-action@0.12.1
53+
54+
- name: ⬇️ Checkout repo
55+
uses: actions/checkout@v4
56+
57+
- name: ⎔ Setup node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version-file: "package.json"
61+
62+
- name: 📥 Download deps
63+
uses: bahmutov/npm-install@v1
64+
with:
65+
useLockFile: false
66+
67+
- name: Install dotenv cli
68+
run: npm install -g dotenv-cli
69+
70+
- name: ⚡ Run vitest
71+
run: npm run test:cov
72+
73+
- name: "Report Coverage"
74+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
75+
if: always()
76+
uses: davelosert/vitest-coverage-report-action@v2

.prettierrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"biome.enabled": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"editor.formatOnSave": true,
5+
"javascript.format.enable": false,
6+
"javascript.suggest.autoImports": true,
7+
"javascript.suggest.paths": true,
8+
"typescript.format.enable": false,
9+
"typescript.suggest.paths": true,
10+
"typescript.suggest.autoImports": true,
11+
"editor.renderWhitespace": "all",
12+
"editor.rulers": [120, 160],
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll": "always",
15+
"source.organizeImports": "never",
16+
"source.organizeImports.biome": "always",
17+
"quickfix.biome": "always"
18+
},
19+
"editor.insertSpaces": false,
20+
"editor.detectIndentation": true,
21+
"editor.trimAutoWhitespace": true,
22+
"files.trimTrailingWhitespace": true,
23+
"files.trimTrailingWhitespaceInRegexAndStrings": true,
24+
"files.trimFinalNewlines": true,
25+
"explorer.fileNesting.patterns": {
26+
"*.ts": "${basename}.*.${extname}",
27+
".env": ".env.*",
28+
"*.tsx": "${basename}.*.${extname},${basename}.*.ts",
29+
"package.json": "*.json, *.yml, *.config.js, *.config.ts, *.yaml"
30+
},
31+
"eslint.enable": false,
32+
"eslint.format.enable": false,
33+
"prettier.enable": false
34+
}

biome.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"defaultBranch": "main",
7+
"useIgnoreFile": true
8+
},
9+
"formatter": {
10+
"enabled": true,
11+
"formatWithErrors": false,
12+
"indentStyle": "tab",
13+
"lineEnding": "lf",
14+
"lineWidth": 120
15+
},
16+
"organizeImports": {
17+
"enabled": true
18+
},
19+
"linter": {
20+
"enabled": true,
21+
"rules": {
22+
"recommended": true,
23+
"suspicious": {
24+
"recommended": true
25+
},
26+
"style": {
27+
"recommended": true
28+
},
29+
"complexity": {
30+
"recommended": true
31+
},
32+
"security": {
33+
"recommended": true
34+
},
35+
"performance": {
36+
"recommended": true
37+
},
38+
"correctness": {
39+
"recommended": true
40+
},
41+
"a11y": {
42+
"recommended": true
43+
},
44+
"nursery": {
45+
"recommended": true
46+
}
47+
}
48+
},
49+
"javascript": {
50+
"formatter": {
51+
"semicolons": "asNeeded",
52+
"trailingCommas": "es5"
53+
}
54+
}
55+
}

lefthook.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
check:
5+
run: npm run check -- --staged --fix --no-errors-on-unmatched
6+
stage_fixed: true
7+
typecheck:
8+
run: npm run typecheck
9+
test:
10+
run: npm run test

0 commit comments

Comments
 (0)