ESLint "Definition for rule was not found" - Fix Missing Plugin in CI
ESLint encountered a rule it has no definition for. The plugin that provides the rule is not installed, or it is installed but not registered in the config's plugins, so the rule name resolves to nothing.
What this error means
ESLint errors with Definition for rule '<plugin>/<rule>' was not found, naming the missing rule. It is deterministic and points at a rule you enabled in config.
/app/src/App.tsx
1:1 error Definition for rule '@typescript-eslint/no-floating-promises' was not found
@typescript-eslint/no-floating-promisesCommon causes
Plugin not installed
The rule belongs to a plugin (@typescript-eslint, eslint-plugin-react-hooks) that is not in node_modules, so its rule definitions are unavailable.
Plugin installed but not registered
In legacy config the plugin must be listed under plugins; in flat config it must be imported and added to the plugins map. Without registration, the prefixed rule name has no definition.
How to fix it
Install and register the plugin
Add the plugin and reference it so its rules resolve.
npm install -D @typescript-eslint/eslint-plugin
# flat config:
# import tseslint from 'typescript-eslint'
# plugins: { '@typescript-eslint': tseslint.plugin }Match rule prefixes to registered plugins
- Confirm every
prefix/ruleyou enable has its plugin installed and registered. - In legacy
.eslintrc, add the plugin toplugins: ["@typescript-eslint"]. - In flat config, import the plugin and add it to the
pluginsobject.
How to prevent it
- Install every plugin whose rules your config references.
- Register plugins in
plugins(flat or legacy) before enabling their rules. - Use
npm ciso the plugin set matches the lockfile.