Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Biome config, lint script and lint CI job #1649

Closed
wants to merge 11 commits into from
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ jobs:
- name: Test packages
run: pnpm -r test:coverage

lint:
name: Lint code
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Generate types
working-directory: ./docs
run: pnpm astro sync
- name: Run linter
run: pnpm lint

pa11y:
name: Check for accessibility issues
runs-on: ubuntu-20.04
Expand Down
33 changes: 33 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"formatter": {
"enabled": false
},
"linter": {
"rules": {
"complexity": {
"useLiteralKeys": "off",
"noForEach": "off"
},
"performance": {
"noDelete": "off"
},
"style": {
"noParameterAssign": "off",
"noUnusedTemplateLiteral": "off",
"noUselessElse": "off",
"useTemplate": "off"
},
"suspicious": {
"useAwait": "error"
}
}
},
"files": {
"ignore": [
"**/.astro/types.d.ts",
"**/__tests__/i18n/malformed-src/**",
"**/dist/**"
]
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"description": "",
"scripts": {
"build:examples": "pnpm --no-bail --workspace-concurrency 1 --filter '@example/*' build",
"lint": "biome lint . --error-on-warnings --max-diagnostics=500",
"size": "size-limit",
"version": "pnpm changeset version && pnpm i --no-frozen-lockfile",
"format": "prettier -w --cache --plugin prettier-plugin-astro ."
},
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "^1.6.1",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@size-limit/file": "^8.2.4",
Expand Down
Loading
Loading