-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added lefthook, validation workflows on CI, swapper eslint for biome
- Loading branch information
1 parent
7656b14
commit b5c14ef
Showing
103 changed files
with
47,086 additions
and
46,967 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: 🚀 Validation Pipeline | ||
concurrency: | ||
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
permissions: | ||
actions: write | ||
contents: read | ||
# Required to put a comment into the pull-request | ||
pull-requests: write | ||
jobs: | ||
lint: | ||
name: ⬣ Biome lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Biome | ||
uses: biomejs/setup-biome@v2 | ||
- name: Run Biome | ||
run: biome ci . | ||
|
||
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: 20 | ||
- 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: 20 | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
{ | ||
"biome.enabled": true, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true, | ||
"//editor.formatOnType": 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.autoSave": "afterDelay", | ||
"//files.autoSaveDelay": 250, | ||
"files.trimTrailingWhitespace": true, | ||
"files.trimTrailingWhitespaceInRegexAndStrings": true, | ||
"files.trimFinalNewlines": true, | ||
"[yaml]": { | ||
"editor.defaultFormatter": "redhat.vscode-yaml" | ||
}, | ||
"[toml]": { | ||
"editor.defaultFormatter": "tamasfe.even-better-toml" | ||
}, | ||
"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, | ||
"turbo.useLocalTurbo": true, | ||
"evenBetterToml.formatter.alignComments": false, | ||
"evenBetterToml.formatter.alignEntries": true, | ||
"evenBetterToml.formatter.allowedBlankLines": 1, | ||
"evenBetterToml.formatter.columnWidth": 120, | ||
"evenBetterToml.formatter.indentEntries": true, | ||
"evenBetterToml.formatter.indentTables": true, | ||
"evenBetterToml.formatter.trailingNewline": true, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
"biome.enabled": true, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true, | ||
"//editor.formatOnType": 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.autoSave": "afterDelay", | ||
"//files.autoSaveDelay": 250, | ||
"files.trimTrailingWhitespace": true, | ||
"files.trimTrailingWhitespaceInRegexAndStrings": true, | ||
"files.trimFinalNewlines": true, | ||
"[yaml]": { | ||
"editor.defaultFormatter": "redhat.vscode-yaml" | ||
}, | ||
"[toml]": { | ||
"editor.defaultFormatter": "tamasfe.even-better-toml" | ||
}, | ||
"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, | ||
"turbo.useLocalTurbo": true, | ||
"evenBetterToml.formatter.alignComments": false, | ||
"evenBetterToml.formatter.alignEntries": true, | ||
"evenBetterToml.formatter.allowedBlankLines": 1, | ||
"evenBetterToml.formatter.columnWidth": 120, | ||
"evenBetterToml.formatter.indentEntries": true, | ||
"evenBetterToml.formatter.indentTables": true, | ||
"evenBetterToml.formatter.trailingNewline": true, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,59 @@ | ||
{ | ||
"$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" | ||
} | ||
} | ||
} | ||
"$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 | ||
}, | ||
"files": { | ||
"ignore": ["test-apps/**", "docs/**", "./src/external/**", "./plugins/**", "./src/input.css"] | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"suspicious": { | ||
"recommended": true, | ||
"noExplicitAny": "off" | ||
}, | ||
"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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
{ | ||
"$schema": "https://unpkg.com/knip@5/schema.json", | ||
"entry": [ | ||
"src/*.{ts,js}", | ||
"scripts/*.{ts,js}" | ||
], | ||
"project": [ | ||
"**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}" | ||
], | ||
"ignore": [ | ||
"test-apps/**", | ||
"src/external/**", | ||
"docs/**", | ||
"plugins/**" | ||
], | ||
"ignoreWorkspaces": [ | ||
"test-apps/**", | ||
"docs/**" | ||
] | ||
} | ||
"$schema": "https://unpkg.com/knip@5/schema.json", | ||
"entry": ["src/*.{ts,js}", "scripts/*.{ts,js}"], | ||
"project": ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}"], | ||
"ignore": ["test-apps/**", "src/external/**", "docs/**", "plugins/**", "tsup*.ts", "**/rdtReducer.ts"], | ||
"ignoreWorkspaces": ["test-apps/**", "docs/**"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
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 | ||
unused-code: | ||
run: npm run check:unused |
Oops, something went wrong.