diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index aed033a..0000000 --- a/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -.husky -.vscode -node_modules -public -dist diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 65c1e49..0000000 --- a/.eslintrc +++ /dev/null @@ -1,45 +0,0 @@ -{ - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:astro/recommended", - "plugin:astro/jsx-a11y-recommended", - "plugin:tailwindcss/recommended" - ], - "plugins": ["prettier", "tailwindcss"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module", - "project": "./tsconfig.json", - "extraFileExtensions": [".astro"] - }, - "settings": { - "tailwindcss": { - "config": "tailwind.config.js" - } - }, - "rules": { - "tailwindcss/classnames-order": "off" - }, - "overrides": [ - { - "env": { - "node": true, - "astro/astro": true, - "es2020": true - }, - "files": ["*.astro"], - "extends": ["plugin:astro/recommended", "plugin:astro/jsx-a11y-recommended"], - "plugins": ["astro", "jsx-a11y"], - "parser": "astro-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser", - "extraFileExtensions": [".astro"], - "project": "./tsconfig.json" - }, - "rules": { - "@typescript-eslint/no-floating-promises": "warn" - } - } - ] -} diff --git a/.husky/pre-commit b/.husky/pre-commit index 5e59273..d6e894a 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,2 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -pnpm exec lint-staged +lint-staged diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 0000000..a92d0b0 --- /dev/null +++ b/.prettierrc.mjs @@ -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", + }, + }, + ], +}; diff --git a/.vscode/settings.json b/.vscode/settings.json index 78d1341..d247c29 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { - "editor.codeActionsOnSave": ["source.organizeImports", "source.fixAll"], + "editor.codeActionsOnSave": { + "source.organizeImports.biome": "explicit" + }, "editor.formatOnSave": true, "files.associations": { "*.css": "tailwindcss" diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..75fedee --- /dev/null +++ b/biome.json @@ -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"] }] +} diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 8683b2f..0000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,92 +0,0 @@ -import { FlatCompat } from "@eslint/eslintrc"; -import js from "@eslint/js"; -import tsParser from "@typescript-eslint/parser"; -import parser from "astro-eslint-parser"; -import astro from "eslint-plugin-astro"; -import jsxA11Y from "eslint-plugin-jsx-a11y"; -import prettier from "eslint-plugin-prettier"; -import tailwindcss from "eslint-plugin-tailwindcss"; -import globals from "globals"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all, -}); - -export default [ - { - ignores: ["**/.husky", "**/.vscode", "**/node_modules", "**/public", "**/dist"], - }, - ...compat.extends( - "plugin:@typescript-eslint/recommended", - "plugin:astro/recommended", - "plugin:astro/jsx-a11y-recommended", - "plugin:tailwindcss/recommended", - ), - { - plugins: { - prettier, - tailwindcss, - }, - - languageOptions: { - parser: tsParser, - ecmaVersion: "latest", - sourceType: "module", - - parserOptions: { - project: "./tsconfig.json", - extraFileExtensions: [".astro"], - }, - }, - - settings: { - tailwindcss: { - config: "tailwind.config.js", - }, - }, - - rules: { - "tailwindcss/classnames-order": "off", - }, - }, - ...compat.extends("plugin:astro/recommended", "plugin:astro/jsx-a11y-recommended").map((config) => ({ - ...config, - files: ["**/*.astro"], - })), - { - files: ["**/*.astro"], - - plugins: { - astro, - "jsx-a11y": jsxA11Y, - }, - - languageOptions: { - globals: { - ...globals.node, - ...astro.environments.astro.globals, - }, - - parser: parser, - ecmaVersion: 5, - sourceType: "commonjs", - - parserOptions: { - parser: "@typescript-eslint/parser", - extraFileExtensions: [".astro"], - project: "./tsconfig.json", - }, - }, - - rules: { - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-unused-vars": "warn", - }, - }, -]; diff --git a/package.json b/package.json index 7d66049..43dffda 100644 --- a/package.json +++ b/package.json @@ -6,18 +6,16 @@ "version": "0.2.1", "author": "Felix Hoffmann ", "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", @@ -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" ] } }