diff --git a/.gitignore b/.gitignore index 6f9b48e..c5f82c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .* *.lock !.gitignore +!.pre-commit-config.yaml __pycache__/ *.egg-info/ /cista/_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..92263e8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: + - repo: local + hooks: + - id: ruff-check + name: ruff check + entry: uv run ruff check . + language: system + pass_filenames: false + - id: ruff-format-check + name: ruff format check + entry: uv run ruff format --check . + language: system + pass_filenames: false + - id: pytest + name: pytest + entry: uv run pytest + language: system + pass_filenames: false + - id: frontend-type-check + name: frontend type-check + entry: npm --prefix frontend run type-check + language: system + pass_filenames: false + - id: frontend-biome-check + name: frontend biome check + entry: npm --prefix frontend run check + language: system + pass_filenames: false diff --git a/frontend/biome.json b/frontend/biome.json new file mode 100644 index 0000000..a777cca --- /dev/null +++ b/frontend/biome.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "files": { + "ignore": ["node_modules", "dist", "coverage", "components.d.ts"] + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 88 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "style": { + "noInferrableTypes": "off", + "noNonNullAssertion": "off", + "noParameterAssign": "off", + "noUselessElse": "off", + "useExponentiationOperator": "off", + "useSingleVarDeclarator": "off", + "useTemplate": "off", + "useConst": "off", + "useImportType": "off" + }, + "suspicious": { + "noAssignInExpressions": "off", + "noDoubleEquals": "off", + "noExplicitAny": "off", + "noImplicitAnyLet": "off", + "noMisleadingCharacterClass": "off" + }, + "complexity": { + "noBannedTypes": "off", + "useOptionalChain": "off" + }, + "correctness": { + "noSwitchDeclarations": "off" + }, + "a11y": { + "useGenericFontNames": "off" + } + } + }, + "overrides": [ + { + "include": ["**/*.d.ts"], + "linter": { + "rules": { + "suspicious": { + "noExplicitAny": "off" + }, + "complexity": { + "noBannedTypes": "off" + } + } + } + } + ], + "javascript": { + "formatter": { + "quoteStyle": "single", + "semicolons": "asNeeded", + "trailingCommas": "none", + "arrowParentheses": "asNeeded" + } + } +} diff --git a/frontend/package.json b/frontend/package.json index 63ae1ee..6061686 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,8 +9,10 @@ "test:unit": "vitest", "build-only": "vite build", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", - "format": "prettier --write src/" + "lint": "biome lint .", + "format": "biome format --write .", + "format:check": "biome format --check .", + "check": "biome check ." }, "engines": { "node": ">=18.0.0" @@ -30,33 +32,19 @@ "vue-router": "^5.0.1" }, "devDependencies": { - "@rushstack/eslint-patch": "^1.15.0", + "@biomejs/biome": "^1.9.4", "@tsconfig/node18": "^18.2.6", "@types/jsdom": "^27.0.0", "@types/lodash-es": "^4.17.12", "@types/node": "^25.1.0", "@vitejs/plugin-vue": "^6.0.3", - "@vue/eslint-config-prettier": "^10.2.0", - "@vue/eslint-config-typescript": "^14.6.0", "@vue/test-utils": "^2.4.6", "@vue/tsconfig": "^0.8.1", - "babel-eslint": "^10.1.0", - "eslint": "^9.39.2", - "eslint-plugin-vue": "^10.7.0", "jsdom": "^27.4.0", "npm-run-all2": "^8.0.4", - "prettier": "^3.8.1", "typescript": "~5.9.3", "vite": "^7.3.1", "vitest": "^4.0.18", "vue-tsc": "^3.2.4" - }, - "prettier": { - "semi": false, - "singleQuote": true, - "trailingComma": "none", - "arrowParens": "avoid", - "endOfLine": "lf", - "printWidth": 88 } } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6171f11..a645071 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -24,21 +24,21 @@ diff --git a/frontend/src/components/DiskSpace.vue b/frontend/src/components/DiskSpace.vue index 4f7e2d4..f17b991 100644 --- a/frontend/src/components/DiskSpace.vue +++ b/frontend/src/components/DiskSpace.vue @@ -62,8 +62,8 @@