Skip to content

Commit

Permalink
Use biome over prettier (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvnxiao authored Feb 10, 2024
1 parent 51f3f41 commit 42fde78
Show file tree
Hide file tree
Showing 12 changed files with 793 additions and 759 deletions.
8 changes: 2 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"next/core-web-vitals",
"prettier"
"next/core-web-vitals"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint", "simple-import-sort", "prettier"],
"plugins": ["@typescript-eslint"],
"rules": {
"eqeqeq": "error",
"no-else-return": "error",
Expand All @@ -25,9 +24,6 @@
"prefer-spread": "error",
"prefer-template": "error",
"radix": ["error", "always"],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"prettier/prettier": "error",
"react-hooks/exhaustive-deps": "error"
}
}
4 changes: 3 additions & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ const buildEslintCommand = (filenames) =>

module.exports = {
"src/**/*.{js,jsx,ts,tsx}": [buildEslintCommand],
"*.{json,html,css,scss,xml,svg,md}": ["prettier --write"],
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"biome check --apply --no-errors-on-unmatched", // Format, sort imports, lint, and apply safe fixes
],
}
10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

24 changes: 24 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"lineEnding": "lf",
"trailingComma": "all"
}
}
}
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"tauri": "tauri",
"build": "tauri build",
"dev": "tauri dev",
"lint": "next lint",
"lint": "next lint && biome check src/",
"prepare": "husky install"
},
"dependencies": {
Expand All @@ -23,33 +23,28 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@prettier/plugin-xml": "^3.2.2",
"@biomejs/biome": "^1.5.3",
"@tauri-apps/cli": "^1.5.9",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.16",
"@types/react": "^18.2.53",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@types/node": "^20.11.17",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.17",
"cross-env": "^7.0.3",
"cssnano": "^6.0.3",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"postcss": "^8.4.33",
"lint-staged": "^15.2.2",
"postcss": "^8.4.35",
"postcss-import": "^16.0.0",
"postcss-nesting": "^12.0.2",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
},
Expand Down
Loading

0 comments on commit 42fde78

Please sign in to comment.