refactor: add React version detection and disable prop-types in eslint; refactor lazy translation tests with proper mock isolation and Chrome/browser stubs

This commit is contained in:
雨霖铃
2026-05-22 23:43:08 +08:00
parent ba57c070f9
commit 67bafe53d5
2 changed files with 73 additions and 47 deletions
+8
View File
@@ -60,6 +60,12 @@ export default tseslint.config(
'react-hooks': reactHooks,
},
settings: {
react: {
version: 'detect',
},
},
// 💡 修复点 2:高精对齐 React 19 / JSX Runtime 的全量生产质检规则大闸
rules: {
// 激活 react-hooks 官方推荐规则
@@ -68,6 +74,8 @@ export default tseslint.config(
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
'react/prop-types': 'off',
// 清洗原生未消费变量冲突,统一交由 TS 高阶哨兵接管
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [