refactor(mp): Phase 0 工程基础 — TS strict + ESLint + Prettier + 安全加固
- tsconfig: noImplicitAny:true + jsx:react-jsx + target:ES2018 + skipLibCheck - 新增 eslint.config.mjs (flat config v9, no-explicit-any:error) - 新增 .prettierrc + lint/format/typecheck 脚本 - prod: pure_funcs 添加 console.warn 防泄漏 - config: 生产环境强制清空 DEV_USER/DEV_PASS - .env.production: 清空硬编码 tenant_id - @types/node + @noble/ciphers 依赖
This commit is contained in:
@@ -6,6 +6,11 @@
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"lint": "eslint src/",
|
||||
"lint:fix": "eslint src/ --fix",
|
||||
"format": "prettier --write 'src/**/*.{ts,tsx}'",
|
||||
"format:check": "prettier --check 'src/**/*.{ts,tsx}'",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test:e2e": "vitest run --config e2e/vitest.config.ts",
|
||||
"dev:h5": "dotenv -e .env.h5 -- taro build --type h5 --watch",
|
||||
"build:h5": "dotenv -e .env.h5 -- taro build --type h5"
|
||||
@@ -26,7 +31,8 @@
|
||||
"@tarojs/taro": "4.2.0",
|
||||
"react": "^18.3.0",
|
||||
"react-dom": "18.3.1",
|
||||
"zustand": "^5.0.0"
|
||||
"zustand": "^5.0.0",
|
||||
"@noble/ciphers": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.29.2",
|
||||
@@ -44,6 +50,15 @@
|
||||
"react-refresh": "^0.14.0",
|
||||
"sass": "^1.87.0",
|
||||
"typescript": "^5.8.0",
|
||||
"@types/node": "^22.0.0",
|
||||
"eslint": "^9.0.0",
|
||||
"@eslint/js": "^9.0.0",
|
||||
"@typescript-eslint/parser": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.0",
|
||||
"prettier": "^3.0.0",
|
||||
"eslint-config-prettier": "^10.0.0",
|
||||
"vite": "^8.0.10",
|
||||
"vitest": "^4.1.5",
|
||||
"webpack": "~5.95.0"
|
||||
|
||||
Reference in New Issue
Block a user