Skip to content

Commit

Permalink
feat(tooling): Replace ESLint with Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
octet-stream committed Jun 30, 2024
1 parent 6fefac2 commit c713274
Show file tree
Hide file tree
Showing 30 changed files with 437 additions and 2,238 deletions.
13 changes: 0 additions & 13 deletions .eslintrc.json

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/eslint.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: ESLint
name: Lint

on:
push:
branches: [main]
paths:
- "**.ts"
- "**.js"
- "package.json"
- "pnpm-lock.yaml"
- ".eslintrc.json"
- ".eslintignore"
- ".github/workflows/eslint.yml"
- "biome.jsonc"
- ".github/workflows/lint.yml"
pull_request:
branches: [main]
paths:
- "**.ts"
- "**.js"
- "package.json"
- "pnpm-lock.yaml"
- ".eslintrc.json"
- ".eslintignore"
- ".github/workflows/eslint.yml"
- "biome.jsonc"
- ".github/workflows/lint.yml"

jobs:
eslint:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -54,4 +54,4 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

- run: pnpm run eslint
- run: pnpm run lint
3 changes: 0 additions & 3 deletions .lintstagedrc

This file was deleted.

6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.{ts,js,json,jsonc}": [
"pnpm biome format --write --no-errors-on-unmatched",
"pnpm biome lint --write --no-errors-on-unmatched"
]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
}
4 changes: 1 addition & 3 deletions ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ export default {
extensions: {
ts: "module"
},
files: [
"src/**/*.test.ts"
]
files: ["src/**/*.test.ts"]
}
37 changes: 37 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"linter": {
"rules": {
"recommended": true,
"complexity": {
"noForEach": "off"
},
"style": {
"noParameterAssign": "off"
},
"suspicious": {
"noGlobalIsNan": "off"
}
}
},
"formatter": {
"indentStyle": "space"
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"bracketSpacing": false,
"trailingCommas": "none",
"arrowParentheses": "asNeeded"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
},
"files": {
"include": ["**/*.ts", "**/*.js"],
"ignore": ["node_modules", "lib"]
}
}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
},
"types": "./lib/index.d.ts",
"scripts": {
"eslint": "eslint src/**/*.ts",
"lint:types": "tsc --project tsconfig.json --noEmit",
"lint": "pnpm eslint && pnpm lint:types",
"lint": "pnpm biome && pnpm lint:types",
"staged": "lint-staged",
"coverage": "c8 pnpm test",
"ci": "c8 pnpm test && c8 report --reporter=json",
Expand All @@ -49,17 +48,16 @@
"prepare": "npx is-in-ci || husky install"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.6",
"@octetstream/eslint-config": "8.2.5",
"@types/mime-types": "2.1.4",
"@types/node": "20.14.2",
"@types/sinon": "17.0.3",
"ava": "6.1.3",
"c8": "10.1.2",
"cross-env": "7.0.3",
"del-cli": "5.1.0",
"eslint": "9.6.0",
"formdata-node": "6.0.3",
"husky": "9.0.11",
"lint-staged": "15.2.7",
Expand Down
Loading

0 comments on commit c713274

Please sign in to comment.