Skip to content

Commit

Permalink
Use Biome for formatting and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Curetix committed Mar 8, 2024
1 parent 413c90e commit 17f052c
Show file tree
Hide file tree
Showing 6 changed files with 341 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm exec lint-staged
pnpm exec lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm exec tsc
pnpm exec tsc && pnpm run lint
25 changes: 0 additions & 25 deletions .prettierrc.json

This file was deleted.

31 changes: 31 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "warn"
}
},
"ignore": ["src/i18n/*.ts"]
},
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"semicolons": "always",
"trailingComma": "all",
"arrowParentheses": "always",
"bracketSameLine": true
}
}
}
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"build:chrome": "plasmo build --zip --hoist --target=chrome-mv3",
"build:firefox": "plasmo build --zip --hoist --target=firefox-mv3",
"build:vite": "tsc && vite build",
"prettier": "prettier -w *.json postcss.config.js vite.config.ts functions/ src/",
"typesafe-i18n": "typesafe-i18n"
"typesafe-i18n": "typesafe-i18n",
"lint": "biome lint functions/ src/",
"format": "biome format --write functions/ src/"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand Down Expand Up @@ -63,8 +64,8 @@
"typesafe-i18n": "^5.26.2"
},
"devDependencies": {
"@biomejs/biome": "1.5.3",
"@cloudflare/workers-types": "^4.20240222.0",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@plasmohq/rps": "^1.8.7",
"@types/chrome": "^0.0.262",
"@types/node": "^20.11.25",
Expand All @@ -73,7 +74,7 @@
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react-swc": "^3.6.0",
"husky": "^9.0.11",
"prettier": "^3.2.5",
"lint-staged": "^15.2.2",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vite-plugin-pwa": "^0.19.2",
Expand All @@ -93,7 +94,8 @@
"contextMenus"
],
"host_permissions": [
"*://api.cloudflare.com/*"
"*://api.cloudflare.com/*",
"*://localhost/*"
],
"browser_specific_settings": {
"gecko": {
Expand All @@ -102,6 +104,8 @@
}
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,css,html,md}": "prettier --write"
"**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"biome check --apply --no-errors-on-unmatched"
]
}
}
Loading

0 comments on commit 17f052c

Please sign in to comment.