Problem
The shared ESLint config (eslint.config.shared.js) wires up @eslint/js, @typescript-eslint, eslint-plugin-react, and eslint-config-prettier, but eslint-plugin-react-hooks is not loaded anywhere. As a result, none of the React-rendering packages (@simlin/app, @simlin/diagram, @simlin/serve-web, website) get any hooks linting at all.
This was discovered during a dependency audit: eslint-plugin-react-hooks was declared in src/app/package.json devDependencies but never referenced by any eslint config, so it has been removed as an unused dependency (branch dep-diet). Removing it makes the gap explicit rather than introducing it.
The reactConfig block in eslint.config.shared.js only spreads eslint-plugin-react's recommended rules:
const reactConfig = {
files: ['**/*.tsx'],
plugins: { react: reactPlugin },
rules: { ...reactPlugin.configs.recommended.rules, ... },
};
There is no react-hooks plugin and no react-hooks/rules-of-hooks or react-hooks/exhaustive-deps rule.
Why it matters
The two react-hooks rules catch real bugs:
rules-of-hooks flags conditional / out-of-order hook calls that corrupt React's hook state and cause hard-to-diagnose runtime crashes.
exhaustive-deps flags missing/stale dependency arrays in useEffect/useMemo/useCallback, the source of a large class of stale-closure bugs.
Simlin's React surface (the diagram editor, app shell, serve web client) is exactly the kind of stateful, effect-heavy UI where these bugs hide. Today none of it is checked.
Components affected
eslint.config.shared.js (the missing plugin + rules)
@simlin/app, @simlin/diagram, @simlin/serve-web (src/simlin-serve/web), website -- the packages that lint .tsx files and would gain coverage
Suggested approach
- Add
eslint-plugin-react-hooks as a devDependency to the packages that lint .tsx (or to the root, depending on how the shared config resolves plugins).
- Wire it into the
reactConfig block in eslint.config.shared.js: register the react-hooks plugin and enable react-hooks/rules-of-hooks (error) and react-hooks/exhaustive-deps (warn or error).
- Run lint and fix whatever violations surface.
exhaustive-deps in particular tends to surface a backlog on first adoption -- triage each (genuine stale-closure bug vs. intentional omission that warrants an inline disable with a comment) rather than blanket-disabling the rule.
This should be a deliberate enablement + cleanup effort, not a silent re-add of the dependency.
Discovery context
Identified during a dependency audit of the repo on branch dep-diet, while removing eslint-plugin-react-hooks from src/app/package.json as an unused dependency.
Problem
The shared ESLint config (
eslint.config.shared.js) wires up@eslint/js,@typescript-eslint,eslint-plugin-react, andeslint-config-prettier, buteslint-plugin-react-hooksis not loaded anywhere. As a result, none of the React-rendering packages (@simlin/app,@simlin/diagram,@simlin/serve-web,website) get any hooks linting at all.This was discovered during a dependency audit:
eslint-plugin-react-hookswas declared insrc/app/package.jsondevDependencies but never referenced by any eslint config, so it has been removed as an unused dependency (branchdep-diet). Removing it makes the gap explicit rather than introducing it.The
reactConfigblock ineslint.config.shared.jsonly spreadseslint-plugin-react'srecommendedrules:There is no
react-hooksplugin and noreact-hooks/rules-of-hooksorreact-hooks/exhaustive-depsrule.Why it matters
The two react-hooks rules catch real bugs:
rules-of-hooksflags conditional / out-of-order hook calls that corrupt React's hook state and cause hard-to-diagnose runtime crashes.exhaustive-depsflags missing/stale dependency arrays inuseEffect/useMemo/useCallback, the source of a large class of stale-closure bugs.Simlin's React surface (the diagram editor, app shell, serve web client) is exactly the kind of stateful, effect-heavy UI where these bugs hide. Today none of it is checked.
Components affected
eslint.config.shared.js(the missing plugin + rules)@simlin/app,@simlin/diagram,@simlin/serve-web(src/simlin-serve/web),website-- the packages that lint.tsxfiles and would gain coverageSuggested approach
eslint-plugin-react-hooksas a devDependency to the packages that lint.tsx(or to the root, depending on how the shared config resolves plugins).reactConfigblock ineslint.config.shared.js: register thereact-hooksplugin and enablereact-hooks/rules-of-hooks(error) andreact-hooks/exhaustive-deps(warn or error).exhaustive-depsin particular tends to surface a backlog on first adoption -- triage each (genuine stale-closure bug vs. intentional omission that warrants an inline disable with a comment) rather than blanket-disabling the rule.This should be a deliberate enablement + cleanup effort, not a silent re-add of the dependency.
Discovery context
Identified during a dependency audit of the repo on branch
dep-diet, while removingeslint-plugin-react-hooksfromsrc/app/package.jsonas an unused dependency.