chore(frontend): add eslint v9 config and fix lint issues

This commit is contained in:
Adrian Acala
2026-01-16 21:34:58 -08:00
parent 7c238701b7
commit d1dbde95e4
3 changed files with 39 additions and 2 deletions
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
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 [
{
ignores: ["dist", "coverage", "node_modules"],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.browser,
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": "off",
"react-hooks/exhaustive-deps": "off",
"react-hooks/set-state-in-effect": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
];
+1 -2
View File
@@ -141,8 +141,7 @@ export const DrawingCard: React.FC<DrawingCardProps> = ({
return () => {
cancelled = true;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [drawing.id, drawing.preview, onPreviewGenerated]); // ensureFullData has stable identity via refs
}, [drawing.id, drawing.preview, onPreviewGenerated, ensureFullData]);
const handleExport = useCallback(async () => {
try {