Skip to content

Commit

Permalink
use Biome (#3327)
Browse files Browse the repository at this point in the history
* setup biome

* use biome.json

* turn off import sorting as it conflicts with prettier

---------

Co-authored-by: Gordon Ko <gko@freewheel.com>
  • Loading branch information
godon019 and Gordon Ko authored Aug 30, 2023
1 parent d31d347 commit f38a875
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
key: npm-${{ hashFiles('package.json') }}
- name: npm install
run: npm i
- name: Rome
run: npm run rome:ci
- name: Biome
run: npm run biome:ci
- name: ESLint
run: npm run eslint
- name: Prettier
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "rome.rome"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "biomejs.biome"]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib"
Expand Down
6 changes: 4 additions & 2 deletions rome.json → biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "./node_modules/rome/configuration_schema.json",
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["./coverage/**/*", "./dist/**/*", "./lib/**/*", "*.json"]
},
Expand Down Expand Up @@ -42,7 +42,6 @@
},
"complexity": {
"noExtraBooleanCast": "error",
"noExtraSemicolon": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
Expand Down Expand Up @@ -151,5 +150,8 @@
"useValidTypeof": "error"
}
}
},
"organizeImports": {
"enabled": false
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"build:types": "tsc -p tsconfig.lib.json && api-extractor run --local --verbose",
"test": "vitest run",
"test:watch": "vitest watch",
"format": "rome format . --write",
"check": "rome check .",
"rome:ci": "rome ci .",
"format": "biome format . --write",
"check": "biome check .",
"biome:ci": "biome ci .",
"eslint": "eslint --ext js,ts,tsx --max-warnings 0 --cache --color src test website vite.config.ts",
"eslint:fix": "npm run eslint -- --fix",
"prettier:check": "prettier --check .",
Expand All @@ -61,6 +61,7 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.21.5",
"@biomejs/biome": "^1.0.0",
"@faker-js/faker": "^8.0.0",
"@ianvs/prettier-plugin-sort-imports": "^4.0.2",
"@linaria/rollup": "^4.5.2",
Expand Down Expand Up @@ -102,7 +103,6 @@
"react-router-dom": "^6.11.1",
"rollup": "^3.26.2",
"rollup-plugin-postcss": "^4.0.2",
"rome": "12.1.3",
"typescript": "~5.1.6",
"vite": "^4.4.2",
"vitest": "^0.34.1"
Expand Down

0 comments on commit f38a875

Please sign in to comment.