Skip to content

Commit

Permalink
feat(format & linting): remove eslint, add biome
Browse files Browse the repository at this point in the history
Keep prettier for the time being.
  • Loading branch information
felixhoffmnn committed Oct 10, 2024
1 parent 2e4780e commit 9d9d64e
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 180 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

45 changes: 0 additions & 45 deletions .eslintrc

This file was deleted.

4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec lint-staged
lint-staged
13 changes: 13 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import("prettier").Config} */
export default {
printWidth: 120,
plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"editor.codeActionsOnSave": ["source.organizeImports", "source.fixAll"],
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
"editor.formatOnSave": true,
"files.associations": {
"*.css": "tailwindcss"
Expand Down
32 changes: 32 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": true },
"files": {
"ignoreUnknown": false,
"ignore": [".astro", ".husky", "node_modules", "public", "dist", "pnpm-lock.yaml"]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"lineWidth": 120,
"attributePosition": "auto",
"bracketSpacing": true
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "double",
"attributePosition": "auto"
}
},
"organizeImports": { "enabled": true },
"linter": { "enabled": true, "rules": { "recommended": true } },
"overrides": [{ "include": ["*.astro"] }]
}
92 changes: 0 additions & 92 deletions eslint.config.mjs

This file was deleted.

45 changes: 11 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
"version": "0.2.1",
"author": "Felix Hoffmann <[email protected]>",
"scripts": {
"prepare": "husky install",
"prepare": "husky",
"dev": "astro dev",
"build": "pnpm run mermaid && astro build",
"check": "astro check && tsc --noEmit",
"sync": "astro sync",
"preview": "astro preview",
"astro": "astro",
"mermaid": "find ./src/data/mermaid -name '*.mmd' -exec sh -c 'mmdc -i {} -o ./src/assets/mermaid/$(basename {} .mmd).svg' \\;",
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix",
"format": "prettier --write . --plugin=prettier-plugin-astro",
"format:check": "prettier --check . --plugin=prettier-plugin-astro"
"lint": "biome lint",
"lint:fix": "biome lint --fix",
"format": "biome format --fix"
},
"dependencies": {
"@astrojs/check": "^0.3.4",
Expand All @@ -40,43 +38,22 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.0",
"@biomejs/biome": "1.9.3",
"@mermaid-js/mermaid-cli": "^10.9.1",
"@tailwindcss/typography": "^0.5.14",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"astro-eslint-parser": "^0.16.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-astro": "^0.29.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-tailwindcss": "^3.17.4",
"globals": "^15.9.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.9",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.12.3",
"prettier-plugin-tailwindcss": "^0.5.14",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.8",
"typescript": "^5.5.4"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"printWidth": 120
},
"lint-staged": {
"*.{astro,md,mdx,js,jsx,ts,tsx}": [
"prettier --write ."
"*": [
"biome check --no-errors-on-unmatched"
]
}
}

0 comments on commit 9d9d64e

Please sign in to comment.