Skip to content

Commit

Permalink
chore: migrate lint to biome
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Jul 7, 2024
1 parent 9c307b7 commit 164be05
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 113 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,9 @@ jobs:
- name: Pnpm Cache
uses: ./.github/actions/pnpm-cache

- name: Oxlint
- name: lint_js
if: steps.changes.outputs.src == 'true'
run: pnpm run lint:js

- name: Biome Sort Imports Order
if: steps.changes.outputs.src == 'true'
run: pnpm run lint-ci:js-sort-imports-order

- name: Prettier
if: steps.changes.outputs.src == 'true'
run: pnpm run format-ci:js
Expand Down
12 changes: 11 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"formatter": {
"enabled": false
},
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
},
"organizeImports": {
"enabled": true,
"ignore": [
Expand All @@ -22,7 +28,11 @@
]
},
"linter": {
"enabled": false
"enabled": true,
"rules": {
"recommended": false
},
"ignore": ["tests/**/*", "crates/**/*", "diff.bundle.js"]
},
"vcs": {
"enabled": true,
Expand Down
6 changes: 1 addition & 5 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ export default {
"*.rs": "rustfmt --edition 2021",
"*.{ts,tsx,js}": "pnpm run format:js",
"*.toml": "npx @taplo/cli format",
"*.{ts,tsx,js,cts,cjs,mts,mjs}": () => [
"pnpm run lint:js",
"pnpm run lint:js-sort-imports-order",
"node ./x ae ci"
]
"*.{ts,tsx,js,cts,cjs,mts,mjs}": () => ["pnpm run lint:js", "node ./x ae ci"]
};
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
"format-ci:js": "node ./node_modules/prettier/bin/prettier.cjs \"packages/**/src/**/*.{ts,tsx,js}\" \"crates/rspack_plugin_runtime/**/*.{ts,js}\" \"x.mjs\" --check",
"format-ci:toml": "npx @taplo/cli format --check '.cargo/*.toml' './crates/**/Cargo.toml' './Cargo.toml'",
"format:toml": "npx @taplo/cli format '.cargo/*.toml' './crates/**/Cargo.toml' './Cargo.toml'",
"lint:js": "oxlint --deny-warnings -c .eslintrc.json",
"lint:js-sort-imports-order": "pnpm run lint-ci:js-sort-imports-order --write",
"lint-ci:js-sort-imports-order": "biome check",
"lint:js": "pnpm run lint-ci:js --write",
"lint-ci:js": "biome check",
"lint:rs": "node ./scripts/check_rust_dependency.cjs",
"build:binding:debug": "pnpm --filter @rspack/binding run build:debug",
"build:binding:release": "pnpm --filter @rspack/binding run build:release",
Expand Down Expand Up @@ -67,7 +66,6 @@
"jest": "29.7.0",
"jest-environment-node": "29.7.0",
"lint-staged": "^15.0.0",
"oxlint": "0.3.4",
"prettier": "3.2.5",
"prettier-2": "npm:prettier@2.8.8",
"rimraf": "3.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/create-rspack/template-vue-ts/src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
declare module "*.vue" {
import { DefineComponent } from "vue";
// biome-ignore lint/complexity/noBannedTypes: reason
const component: DefineComponent<{}, {}, any>;
export default component;
}
138 changes: 42 additions & 96 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 164be05

Please sign in to comment.