Files
goclaw/ui/web/eslint.config.js
viettranx 607ef556b5 feat(web): add ESLint 10 with flat config and CI integration
- Install ESLint 10 + TypeScript-ESLint + React hooks plugins
- Create eslint.config.js with flat config format
- Fix conditional hooks violations in agents-page, task-list, knowledge-chart
- Fix unused variables and useless assignments
- Add lint step to CI workflow before build
- Remove unused eslint-disable comments

Rules configured:
- rules-of-hooks: error (critical)
- exhaustive-deps: off (intentional patterns)
- no-explicit-any: off (pragmatic casts)
- no-console: off (dev convenience)
2026-04-12 17:40:33 +07:00

38 lines
1.2 KiB
JavaScript

import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist", "node_modules"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2024,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
// React hooks - keep critical rules only
"react-hooks/rules-of-hooks": "error",
// Disabled: many intentional patterns (stable refs, translation fn)
"react-hooks/exhaustive-deps": "off",
// Disabled: legitimate pattern to co-locate hooks with components
"react-refresh/only-export-components": "off",
// TypeScript
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// Disabled: pragmatic casts for external libs and dynamic data
"@typescript-eslint/no-explicit-any": "off",
// General - disabled for dev convenience
"no-console": "off",
},
}
);