test(panel): 加组件测试与浏览器冒烟、hooks lint、OpenAPI 双向类型对齐,修复 CI 类型检查空转、列表不显示服务器名称与玩家停服不确认
This commit is contained in:
44 files changed
+10578
-216
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import globals from "globals";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
// Lint guards what tsc cannot: the rules of hooks (a hook behind a condition
|
||||
// renders fine until the branch flips) and effect dependency lists (a stale
|
||||
// closure, or a memo that recomputes every render). Types are tsc's job and
|
||||
// style the formatter's, so nothing else is switched on. CI runs it with
|
||||
// --max-warnings 0; a deliberate gap in a dependency list carries a disable
|
||||
// comment that says why.
|
||||
export default tseslint.config(
|
||||
{ ignores: ["dist", "node_modules", "test-results", "playwright-report", "src/lib/openapi.gen.ts"] },
|
||||
{
|
||||
files: ["src/**/*.{ts,tsx}", "dev/**/*.ts"],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
ecmaVersion: 2022,
|
||||
globals: { ...globals.browser, ...globals.node },
|
||||
},
|
||||
linterOptions: { reportUnusedDisableDirectives: "error" },
|
||||
plugins: { "react-hooks": reactHooks },
|
||||
rules: {
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
},
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user