Chore: enforce no any type lint (#10461)

* chore(frontend): enforce no explicit any types in lint for changed files

- Add noExplicitAny rule to Biome configuration
- Update pre-commit hook to only check staged files (not entire codebase)
- Add check-format:staged npm script for manual checks
- Fix biome schema version to match installed version (2.1.1)

* add lint to biome to enforce not using any in commited files only

---------

Co-authored-by: Olfa Maslah <olfamaslah@Olfas-MacBook-Pro.local>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
This commit is contained in:
Wallgau
2025-10-31 15:23:28 -04:00
committed by GitHub
parent 43e0db3210
commit e9d1c2fb7d
3 changed files with 16 additions and 4 deletions

View File

@ -35,11 +35,19 @@ repos:
hooks:
- id: local-biome-check
name: biome check
entry: bash -c 'cd src/frontend && npx @biomejs/biome check --write --files-ignore-unknown=true --no-errors-on-unmatched --diagnostic-level=error'
entry: bash -c 'cd src/frontend && files=("${@#src/frontend/}") && npx @biomejs/biome check --write --files-ignore-unknown=true --diagnostic-level=error "${files[@]}"' --
language: system
types: [text]
files: "\\.(jsx?|tsx?|c(js|ts)|m(js|ts)|d\\.(ts|cts|mts)|jsonc?)$"
files: "^src/frontend/.*\\.(jsx?|tsx?|c(js|ts)|m(js|ts)|d\\.(ts|cts|mts)|jsonc?)$"
exclude: (^docs/|src/lfx/src/lfx/_assets/component_index\.json$)
pass_filenames: true
- id: biome-lint-no-any-staged
name: biome no-any check (staged only)
entry: bash -c 'cd src/frontend && npx @biomejs/biome lint --staged --diagnostic-level=error --no-errors-on-unmatched'
language: system
files: "^src/frontend/.*\\.(tsx?|ts)$"
exclude: (^docs/)
pass_filenames: false
- id: validate-starter-projects
name: Validate Starter Project Templates
entry: uv run python src/backend/tests/unit/template/test_starter_projects.py

View File

@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
@ -73,6 +73,7 @@
"noDuplicateElseIf": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noExplicitAny": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",

View File

@ -97,7 +97,10 @@
"test:coverage": "jest --coverage",
"test:watch": "jest --watch",
"serve": "vite preview",
"format": "npx @biomejs/biome check --write",
"format": "npx @biomejs/biome format --write",
"lint": "npx @biomejs/biome lint",
"lint:types": "npx @biomejs/biome lint --diagnostic-level=error",
"lint:types:staged": "npx @biomejs/biome lint --staged --diagnostic-level=error",
"check-format": "npx @biomejs/biome check",
"type-check": "tsc --noEmit --pretty --project tsconfig.json && vite"
},