Skip to content

Commit

Permalink
Replace ESLint with Biome
Browse files Browse the repository at this point in the history
* Setup Biome;
* Remove ESLint from dependencies, remove configs;
* Update lint-staged config to use Biome;
* Add VSCode settings to format code with Biome on save;
* Format source files with Biome;
* Remove ESlint workflow;
* Specify pnpm version in package.json;
  • Loading branch information
octet-stream committed Aug 21, 2024
1 parent cdecc1a commit 93a8bd6
Show file tree
Hide file tree
Showing 14 changed files with 3,167 additions and 3,697 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/eslint.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"*.ts": "pnpm eslint",
"*.js": "eslint"
"*.{ts,js,json,jsonc}": [
"pnpm biome format --write --no-errors-on-unmatched",
"pnpm biome lint --write --no-errors-on-unmatched"
]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
}
}
35 changes: 35 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useShorthandFunctionType": "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", "coverage", "lib", ".husky", "**/*.d.ts"]
}
}
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"bracket-notation",
"dot-notation"
],
"engines": {
"node": ">= 18"
},
"packageManager": "[email protected]",
"repository": {
"type": "git",
"url": "git+https://github.com/octet-stream/object-to-form-data.git"
Expand All @@ -33,12 +37,8 @@
"files": [
"lib"
],
"engines": {
"node": ">= 18"
},
"scripts": {
"build": "pnpm run lint:types && pnpm del-cli lib && tsup",
"eslint": "eslint src/**/*.ts",
"lint:types": "tsc --noEmit",
"test": "NODE_OPTIONS=\"--no-warnings --import tsx\" ava",
"coverage": "c8 pnpm test",
Expand All @@ -49,16 +49,15 @@
"prepare": "npx is-in-ci || husky install"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@octetstream/eslint-config": "8.0.2",
"@size-limit/preset-small-lib": "11.0.2",
"@types/node": "20.11.17",
"@types/sinon": "17.0.3",
"ava": "6.1.1",
"c8": "9.1.0",
"del-cli": "^5.1.0",
"eslint": "8.56.0",
"del-cli": "5.1.0",
"formdata-node": "6.0.3",
"husky": "9.0.11",
"lint-staged": "15.2.2",
Expand Down
Loading

0 comments on commit 93a8bd6

Please sign in to comment.