Skip to content
Latchkey

ESLint "Definition for rule was not found" - Fix Missing Plugins

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.

eslint output
/app/src/App.tsx
  1:1  error  Definition for rule '@typescript-eslint/no-floating-promises' was not found
        @typescript-eslint/no-floating-promises

Common 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.

Terminal
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

  1. Confirm every prefix/rule you enable has its plugin installed and registered.
  2. In legacy .eslintrc, add the plugin to plugins: ["@typescript-eslint"].
  3. In flat config, import the plugin and add it to the plugins object.

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 ci so the plugin set matches the lockfile.

Frequently asked questions

What causes ""Definition for rule not found""?
The rule belongs to a plugin (@typescript-eslint, eslint-plugin-react-hooks) that is not in node_modules, so its rule definitions are unavailable.
How do I fix "Definition for rule not found"?
Add the plugin and reference it so its rules resolve.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card