@eslint/compat weekly downloads statistics
By eslint (7 listings) · npm · ESLint plugins
Compatibility utilities for ESLint
@eslint/compat has 11,340,357 recorded weekly downloads on npm, an increase of 13.3% over the past 30 days, ranking #135 of 3,247 tracked listings.
About @eslint/compat
ESLint Compatibility Utilities
Overview
This package contains functions that allow you to wrap existing ESLint rules, plugins, and configurations that were intended for use with ESLint v8.x or v9.x to allow them to work as-is in ESLint v9.x and v10.x.
Note: All plugins are not guaranteed to work in ESLint v9.x or v10.x. This package fixes the most common issues but can't fix everything.
Installation
For Node.js and compatible runtimes:
npm install @eslint/compat -D
# or
yarn add @eslint/compat -D
# or
pnpm install @eslint/compat -D
# or
bun add @eslint/compat -D
For Deno:
deno add @eslint/compat
Usage
This package exports the following functions in both ESM and CommonJS format:
fixupRule(rule)- wraps the given rule in a compatibility layer and returns the resultfixupPluginRules(plugin)- wraps each rule in the given plugin usingfixupRule()and returns a new object that represents the plugin with the fixed-up rulesfixupConfigRules(configs)- wraps all plugins found in an array of config objects usingfixupPluginRules()includeIgnoreFile(path)(deprecated) - reads an ignore file (like.gitignore) and converts the patterns into the correct format for the config file
Fixing Rules
If you have a rule that you'd like to make compatible with ESLint v9.x or v10.x, you can do so using the fixupRule() function:
// ESM example
import { fixupRule } from "@eslint/compat";
// Step 1: Import your rule
import myRule from "./local-rule.js";
// Step 2: Create backwards-compatible rule
const compatRule = fixupRule(myRule);
// Step 3 (optional): Export fixed rule
export default compatRule;
Or in CommonJS:
// CommonJS example
const { fixupRule } = require("@eslint/compat");
// Step 1: Import your rule
const myRule = require("./local-rule.js");
// Step 2: Create backwards-compatible rule
const compatRule = fixupRule(myRule);
// Step 3 (optional): Export fixed rule
module.exports = compatRule;
Fixing Plugins
If you are using a plugin in your eslint.config.js that is not yet compatible with ESLint v9.x or v10.x, you can wrap it using the fixupPluginRules() function:
// eslint.config.js - ESM example
import { defineConfig } from "eslint/config";
import { fixupPluginRules } from "@eslint/compat";
import somePlugin from "eslint-plugin-some-plugin";
export default defineConfig([
{
plugins: {
// insert the fixed plugin instead of the original
somePlugin: fixupPluginRules(somePlugin),
},
rules: {
"somePlugin/rule-name": "error",
},
},
]);
Or in CommonJS:
// eslint.config.js - CommonJS example
const { defineConfig } = require("eslint/config");
const { fixupPluginRules } = require("@eslint/compat");
const somePlugin = require("eslint-plugin-some-plugin");
module.exports = defineConfig([
{
plugins: {
// insert the fixed plugin instead of the original
somePlugin: fixupPluginRules(somePlugin),
},
rules: {
"somePlugin/rule-name": "error",
},
},
]);
Fixing Configs
If you are importing other configs into your eslint.config.js that use plugins that are not yet compatible with ESLint v9.x or v10.x, you can wrap the entire array or a single object using the fixupConfigRules() function:
// eslint.config.js - ESM example
import { defineConfig } from "eslint/config";
import { fixupConfigRules } from "@eslint/compat";
import someConfig from "eslint-config-some-config";
export default defineConfig([
...fixupConfigRules(someConfig),
{
// your overrides
},
]);
Or in CommonJS:
// eslint.config.js - CommonJS example
const { defineConfig } = require("eslint/config");
const { fixupConfigRules } = require("@eslint/compat");
const someConfig = require("eslint-config-some-config");
module.exports = defineConfig([
...fixupConfigRules(someConfig),
{
// your overrides
},
]);
Including Ignore Files
Deprecated: The includeIgnoreFile() exported by this package has been deprecated (eslint/rewrite#329). Use the includeIgnoreFile() function exported by @eslint/config-helpers instead (also available at eslint/config). This section is only preserved for historical reference.
If you were using an alternate ignore file in ESLint v8.x, such as using --ignore-path .gitignore on the command line, you can include those patterns programmatically in your config file using the includeIgnoreFile() function.
The includeIgnoreFile() function also accepts a second optional name parameter that allows you to set a custom name for this configuration object. If not specified, it defaults to "Imported .gitignore patterns". For example:
// eslint.config.js - ESM example
import { defineConfig } from "eslint/config";
import { includeIgnoreFile } from "@eslint/compat";
import path from "node:path";
const gitignorePath = path.resolve(import.meta.dirname, ".gitignore");
export default defineConfig([
includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"), // second argument is optional.
{
// your overrides
},
]);
Or in CommonJS:
// eslint.config.js - CommonJS example
const { defineConfig } = require("eslint/config");
const { includeIgnoreFile } = require("@eslint/compat");
const path = require("node:path");
const gitignorePath = path.resolve(__dirname, ".gitignore");
module.exports = defineConfig([
includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"), // second argument is optional.
{
// your overrides
},
]);
Limitation: This works without modification when the ignore file is in the same directory as your config file. If the ignore file is in a different directory, you may need to modify the patterns manually.
License
Apache 2.0
<!-- NOTE: This section is autogenerated. Do not manually edit.--> <!--sponsorsstart-->Sponsors…
Description from the npm listing.
- eslint
- compatibility
- eslintplugin
- eslint-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (591)Similar npm ESLint plugins plugins
All 20 @eslint/compat alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@eslint/compat. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.