ESLint "Definition for rule was not found" in CI
ESLint reports an error for a configured rule it cannot resolve to a definition. The rule's plugin is not installed, the name is misspelled, or the plugin dropped the rule in the installed version.
What this error means
ESLint prints "error Definition for rule 'X' was not found X" for a plugin rule like import/no-cycle or react-hooks/exhaustive-deps, failing the run.
/home/runner/work/app/app/src/index.tsx
0:0 error Definition for rule 'react-hooks/exhaustive-deps' was not found react-hooks/exhaustive-depsCommon causes
The plugin that defines the rule is not installed
The rule lives in a plugin (eslint-plugin-react-hooks, eslint-plugin-import) that is missing from the CI dependency set.
The rule was renamed or removed
A plugin upgrade renamed or dropped the rule, so the name in your config no longer maps to a definition.
How to fix it
Install the plugin and register it
- Identify the plugin prefix in the rule name (
react-hooks/...->eslint-plugin-react-hooks). - Install the plugin and add it to
pluginsin the config. - Re-run ESLint to confirm the rule resolves.
npm install --save-dev eslint-plugin-react-hooksCorrect or remove a stale rule name
If the plugin renamed the rule, update the key to the new name; if it was removed, delete the entry.
How to prevent it
- Keep every plugin that supplies a rule in devDependencies.
- Review plugin changelogs before bumping major versions.
- Add new rules with their plugin in the same change.