Replace ESLint react-hooks stub with the real plugin and clear lint warnings #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
PR #19 added
webapp/frontend/eslint.config.js(a dependency-free flat config) and wirednpm run lintinto CI. Because no npm/lockfile changes were possible at the time, the config currently registers a no-op stub for thereact-hooksplugin — just enough so the existing// eslint-disable-next-line react-hooks/exhaustive-depsdirectives in the source resolve instead of erroring ("Definition for rule … was not found").So
react-hooks/exhaustive-depsis not actually being linted right now.Task
When
webapp/frontend/package.jsonis next touched:eslint-plugin-react-hooks(and considereslint-plugin-react) todevDependencies; runnpm installto updatepackage-lock.json.eslint.config.js, replace thereactHooksStubno-op with the real plugin and enable its recommended rules (react-hooks/rules-of-hooks: error,react-hooks/exhaustive-deps: warn).Reactimports (React 19's automatic JSX runtime doesn't need the import). A couple areno-undeffor browser globals (EventSource,FileReader) that the dependency-free globals list doesn't yet cover;eslint-pluginpresets or adding them to the globals map fixes those.Context
webapp/frontend/eslint.config.js(reactHooksStub), with a comment pointing here.Acceptance
react-hooksrules are actually enforced (real plugin, no stub).npm run lintis clean (0 errors, 0 warnings) onmain.