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

use Biome #3327

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor Author

@godon019 godon019 Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this emits error. Biome doesn't seem to have it.

and the rule seems to be removed from Rome as well
we can see that there is no page when we click the link to lint/complexity/noExtraSemicolon
from https://rome.tools/blog/2023/05/10/rome12_1/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed from Rome rome/tools#4576

"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
Expand Down Expand Up @@ -151,5 +150,8 @@
"useValidTypeof": "error"
}
}
},
"organizeImports": {
"enabled": false
}
Comment on lines +153 to 156
Copy link
Contributor Author

@godon019 godon019 Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biome sorts imports on npm run check and it conflicts with prettier so turned it off. https://biomejs.dev/analyzer/#imports-sorting

should we use Biome to sort import?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we can use Biome. It will be faster for sure. Let's try in a separate PR

}
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