mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-07 03:07:56 +08:00
3a23167d31
## Problem PR #647 accidentally removed all code quality tools when adding test dependencies: - ❌ ESLint (9 packages) - code linting - ❌ Prettier - code formatting - ❌ Husky - Git hooks - ❌ lint-staged - pre-commit checks - ❌ Related scripts (lint, format, prepare) This significantly impacts code quality and team collaboration. ## Root Cause When adding test dependencies (vitest, @testing-library/react), the package.json was incorrectly edited, removing all existing devDependencies. ## Solution Restore all code quality tools while keeping the new test dependencies: ### ✅ Restored packages: - @eslint/js - @typescript-eslint/eslint-plugin - @typescript-eslint/parser - eslint + plugins (prettier, react, react-hooks, react-refresh) - prettier - husky - lint-staged ### ✅ Kept test packages: - @testing-library/jest-dom - @testing-library/react - jsdom - vitest ### ✅ Restored scripts: ```json { "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --ext ts,tsx --fix", "format": "prettier --write \"src/**/*.{ts,tsx,css,json}\"", "format:check": "prettier --check \"src/**/*.{ts,tsx,css,json}\"", "test": "vitest run", "prepare": "husky" } ``` ### ✅ Restored lint-staged config ## Impact This fix restores: - Automated code style enforcement - Pre-commit quality checks - Consistent code formatting - Team collaboration standards ## Testing - [x] npm install succeeds - [x] npm run build succeeds - [x] All scripts are functional Related-To: PR #647 Co-authored-by: tinkle-community <tinklefund@gmail.com>
66 lines
1.8 KiB
JSON
66 lines
1.8 KiB
JSON
{
|
|
"name": "nofx-web",
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc && vite build",
|
|
"preview": "vite preview",
|
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
"lint:fix": "eslint . --ext ts,tsx --fix",
|
|
"format": "prettier --write \"src/**/*.{ts,tsx,css,json}\"",
|
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,css,json}\"",
|
|
"prepare": "husky",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@radix-ui/react-slot": "^1.2.3",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"date-fns": "^4.1.0",
|
|
"framer-motion": "^12.23.24",
|
|
"lucide-react": "^0.552.0",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"recharts": "^2.15.2",
|
|
"swr": "^2.2.5",
|
|
"tailwind-merge": "^3.3.1",
|
|
"zustand": "^5.0.2"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.1",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.0",
|
|
"@types/react": "^18.3.17",
|
|
"@types/react-dom": "^18.3.5",
|
|
"@typescript-eslint/eslint-plugin": "^8.46.3",
|
|
"@typescript-eslint/parser": "^8.46.3",
|
|
"@vitejs/plugin-react": "^4.3.4",
|
|
"autoprefixer": "^10.4.20",
|
|
"eslint": "^9.39.1",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-prettier": "^5.5.4",
|
|
"eslint-plugin-react": "^7.37.5",
|
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
"husky": "^9.1.7",
|
|
"jsdom": "^25.0.1",
|
|
"lint-staged": "^16.2.6",
|
|
"postcss": "^8.4.49",
|
|
"prettier": "^3.6.2",
|
|
"tailwindcss": "^3.4.17",
|
|
"typescript": "^5.8.3",
|
|
"vite": "^6.0.7",
|
|
"vitest": "^2.1.9"
|
|
},
|
|
"lint-staged": {
|
|
"*.{ts,tsx}": [
|
|
"eslint --fix",
|
|
"prettier --write"
|
|
],
|
|
"*.{css,json}": [
|
|
"prettier --write"
|
|
]
|
|
}
|
|
}
|