Skip to content

Commit

Permalink
Switched to modern tools
Browse files Browse the repository at this point in the history
  • Loading branch information
AlemTuzlak committed Jul 17, 2024
1 parent 1ecf192 commit ed8b9c9
Show file tree
Hide file tree
Showing 9 changed files with 489 additions and 299 deletions.
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 🚀 PR

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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).

permissions:
actions: write
contents: read
# Required to put a comment into the pull-request
pull-requests: write

jobs:
lint:
name: ⬣ Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
- run: biome ci . --reporter=github

typecheck:
name: 🔎 Type check
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🔎 Type check
run: npm run typecheck

vitest:
name: ⚡ Unit Tests
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: Install dotenv cli
run: npm install -g dotenv-cli

- name: ⚡ Run vitest
run: npm run test:cov

- name: "Report Coverage"
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"biome.enabled": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"javascript.format.enable": false,
"javascript.suggest.autoImports": true,
"javascript.suggest.paths": true,
"typescript.format.enable": false,
"typescript.suggest.paths": true,
"typescript.suggest.autoImports": true,
"editor.renderWhitespace": "all",
"editor.rulers": [120, 160],
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "never",
"source.organizeImports.biome": "always",
"quickfix.biome": "always"
},
"editor.insertSpaces": false,
"editor.detectIndentation": true,
"editor.trimAutoWhitespace": true,
"files.trimTrailingWhitespace": true,
"files.trimTrailingWhitespaceInRegexAndStrings": true,
"files.trimFinalNewlines": true,
"explorer.fileNesting.patterns": {
"*.ts": "${basename}.*.${extname}",
".env": ".env.*",
"*.tsx": "${basename}.*.${extname},${basename}.*.ts",
"package.json": "*.json, *.yml, *.config.js, *.config.ts, *.yaml"
},
"eslint.enable": false,
"eslint.format.enable": false,
"prettier.enable": false
}
55 changes: 55 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "tab",
"lineEnding": "lf",
"lineWidth": 120
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"recommended": true
},
"style": {
"recommended": true
},
"complexity": {
"recommended": true
},
"security": {
"recommended": true
},
"performance": {
"recommended": true
},
"correctness": {
"recommended": true
},
"a11y": {
"recommended": true
},
"nursery": {
"recommended": true
}
}
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"trailingCommas": "es5"
}
}
}
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
parallel: true
commands:
check:
run: npm run check -- --staged --fix --no-errors-on-unmatched
stage_fixed: true
typecheck:
run: npm run typecheck
test:
run: npm run test
Loading

0 comments on commit ed8b9c9

Please sign in to comment.