chore: add biome

This commit is contained in:
tigattack
2025-09-24 22:08:08 +01:00
parent b43b20fbe9
commit 330f80478d
6 changed files with 237 additions and 3058 deletions

View File

@@ -209,7 +209,7 @@ We welcome contributions from the community! Here's how you can get involved:
- Link any related issues - Link any related issues
### Contribution Guidelines ### Contribution Guidelines
- **Code Style**: Follow the existing code patterns and ESLint configuration - **Code Style**: Follow the existing code patterns and Biome configuration
- **Commits**: Use conventional commit messages (feat:, fix:, docs:, etc.) - **Commits**: Use conventional commit messages (feat:, fix:, docs:, etc.)
- **Testing**: Ensure all tests pass and add tests for new features - **Testing**: Ensure all tests pass and add tests for new features
- **Documentation**: Update README and code comments as needed - **Documentation**: Update README and code comments as needed

17
biome.json Normal file
View File

@@ -0,0 +1,17 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true
},
"linter": {
"enabled": true
},
"assist": {
"enabled": true
}
}

View File

@@ -1,38 +0,0 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import react from 'eslint-plugin-react'
export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]

View File

@@ -6,7 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0", "lint": "npx @biomejs/biome check .",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
@@ -29,16 +29,10 @@
"react-router-dom": "^6.30.1" "react-router-dom": "^6.30.1"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.17.0",
"@types/react": "^18.3.14", "@types/react": "^18.3.14",
"@types/react-dom": "^18.3.1", "@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"eslint": "^9.17.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.14.0",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"vite": "^7.1.5" "vite": "^7.1.5"

3202
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -17,24 +17,16 @@
"build:backend": "cd backend && npm run build", "build:backend": "cd backend && npm run build",
"build:frontend": "cd frontend && npm run build", "build:frontend": "cd frontend && npm run build",
"build": "npm run build:backend && npm run build:frontend", "build": "npm run build:backend && npm run build:frontend",
"format": "prettier --cache --write \"**/*.{js,jsx,ts,tsx,json,md,css,scss,yml,yaml}\"", "format": "npx @biomejs/biome format --write .",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md,css,scss,yml,yaml}\"", "format:check": "npx @biomejs/biome format .",
"lint": "eslint . --ext .js,.jsx --cache", "lint": "npx @biomejs/biome check .",
"lint:fix": "eslint . --ext .js,.jsx --fix --cache" "lint:fix": "npx @biomejs/biome check --write ."
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "2.2.4",
"@commitlint/cli": "^20.0.0", "@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0", "@commitlint/config-conventional": "^20.0.0",
"@eslint/js": "^9.17.0",
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"husky": "^9.1.6", "husky": "^9.1.6",
"lint-staged": "^15.2.10", "lint-staged": "^15.2.10",
"markdownlint-cli": "^0.41.0", "markdownlint-cli": "^0.41.0",
@@ -45,9 +37,11 @@
"node": ">=18.0.0" "node": ">=18.0.0"
}, },
"lint-staged": { "lint-staged": {
"*": { "*.{js,jsx,ts,tsx,json}": [
"{js,jsx}": "[\"eslint --fix --cache\",\"prettier --write\"]", "npx @biomejs/biome check --write"
"{md,yml,yaml,json,css,scss}": "[\"prettier --write\"]" ],
} "*.{md,yml,yaml,css,scss}": [
"npx @biomejs/biome format --write"
]
} }
} }