Skip to content

Commit

Permalink
Switch to Biome (sergiodxa#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa authored May 3, 2024
1 parent 927aa27 commit 73993df
Show file tree
Hide file tree
Showing 59 changed files with 561 additions and 509 deletions.
54 changes: 0 additions & 54 deletions .eslintrc.cjs

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Semver type of new version (major / minor / patch)'
description: "Semver type of new version (major / minor / patch)"
required: true
type: choice
options:
- major
- minor
- patch
- major
- minor
- patch

jobs:
bump-version:
Expand All @@ -22,7 +22,7 @@ jobs:
ssh-key: ${{ secrets.DEPLOY_KEY }}

- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile

- uses: actions/setup-node@v4
with:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile
- run: bun run build

exports:
Expand All @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile
- run: bun run test:exports

typecheck:
Expand All @@ -31,23 +31,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile
- run: bun run typecheck

test:
name: Unit and Integration Tests
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile
- run: bun run test

lint:
name: Linter
quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run lint
- run: bun install --frozen-lockfile
- run: bun run check
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install ----frozen-lockfile && bunx typedoc
- run: bun install --frozen-lockfile && bunx typedoc
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:exports

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
.gitignore
.npmignore
.npmrc
biome.json
bun.lockb
prettier.config.js
tsconfig.json
vitest.config.ts
vitest.setup.ts
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"recommendations": [
"bierner.jsdoc-markdown-highlighting",
"biomejs.biome",
"bradlc.vscode-tailwindcss",
"csstools.postcss",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"github.vscode-github-actions",
"vitest.explorer",
"vscode-icons-team.vscode-icons",
"waderyan.gitblame"
]
}
70 changes: 70 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[markdown]": {
"editor.wordWrap": "on"
},
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit"
},
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.inlineSuggest.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 80,
"files.associations": {
"*.js": "javascriptreact",
"*.ts": "typescriptreact"
},
"files.defaultLanguage": "markdown",
"tailwindCSS.classAttributes": ["class", "className", "cn", "tv"],
"workbench.editor.customLabels.enabled": true,
"workbench.editor.customLabels.patterns": {
"**/.github/workflows/*.yml": "${filename} - GitHub Action",
"**/app/**/*.stories.tsx": "${dirname}/${filename} - Story",
"**/app/**/*.test.ts": "${dirname}/${filename} - Unit Test",
"**/app/**/*.test.tsx": "${dirname}/${filename} - Component Test",
"**/app/components/**/*.tsx": "${dirname}/${filename} - Component",
"**/app/entry.client.tsx": "${dirname}/${filename} - Entry Client",
"**/app/entry.server.tsx": "${dirname}/${filename} - Entry Server",
"**/app/helpers/**/*.ts": "${dirname}/${filename} - Helper",
"**/app/helpers/**/*.tsx": "${dirname}/${filename} - Helper",
"**/app/hooks/**/*.ts": "${dirname}/${filename} - Hook",
"**/app/hooks/**/*.tsx": "${dirname}/${filename} - Hook",
"**/app/modules/**/*.ts": "${filename} - Module",
"**/app/routes/*.ts": "${dirname}/${filename} - Resource Route",
"**/app/routes/*.tsx": "${dirname}/${filename} - UI Route",
"**/app/routes/**/route.ts": "${dirname} - Resource Route",
"**/app/routes/**/route.tsx": "${dirname} - UI Route",
"**/app/ui/**/*.tsx": "${dirname}/${filename} - UI Kit",
"**/config/*.ts": "${filename} - Config",
"**/db/migrations/*.sql": "${filename} - Migration",
"**/db/schema.ts": "Database Schema",
"**/e2e/**/*.test.ts": "${filename} - E2E Test",
"**/locales/**/*.ts": "${dirname}/${filename} - Locale",
"**/scripts/**/*.ts": "${filename} - CLI",
"**/server/modules/**/*.ts": "${filename} - Server Module",
"**/types/**/*.d.ts": "${filename} - Type"
},
"workbench.iconTheme": "vscode-icons"
}
55 changes: 55 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["src/server/json-hash.ts"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"useHookAtTopLevel": "error"
},
"performance": {
"noBarrelFile": "error",
"noReExportAll": "error"
},
"style": {
"noNegationElse": "error",
"useConst": "off",
"useExportType": "off",
"useImportType": "off"
},
"suspicious": {
"noConsoleLog": "warn",
"noEmptyBlockStatements": "warn",
"noSkippedTests": "error"
},
"nursery": {
"useSortedClasses": {
"level": "error",
"options": {
"attributes": ["className", "class"],
"functions": ["cn", "tv"]
}
}
}
}
},
"formatter": { "enabled": true },
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"overrides": [
{
"include": ["**/*.md"],
"formatter": { "indentStyle": "tab" }
}
]
}
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit 73993df

Please sign in to comment.