Registry / testing / eslint-plugin-escompat

eslint-plugin-escompat

JSON →
library3.11.4jsnpmunverified

ESLint plugin (v3.11.4) that reports errors for JavaScript/TypeScript syntax which, if left untranspiled, will not work in target browsers, as defined by a Browserslist config. Unlike eslint-plugin-compat (which checks for missing polyfills), this focuses on native syntax incompatibilities. It ships with recommended configs for browser code and separate TypeScript configs per ECMAScript target year. Integrates with both legacy .eslintrc and flat eslint.config.js formats. Actively maintained with multiple releases per year since initial release.

npm install eslint-plugin-escompat
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-ESCO
E
eslint-plugin-escompat
testingjavascriptv3.11.4
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import escompat from 'eslint-plugin-escompat'
✗ const escompat = require('eslint-plugin-escompat')
ESM import used in flat config; CommonJS require works with .eslintrc in ESLint <9.
escompat.configs['flat/recommended']
✓ import escompat from 'eslint-plugin-escompat'; export default [{ ... }, escompat.configs['flat/recommended']]
✗ using escompat.configs['flat/recommended'] without spreading or in .eslintrc
Flat config is an object, not an array; extend in export default array.
escompat.configs['flat/typescript-2020']
✓ import escompat from 'eslint-plugin-escompat'; export default [{ ... }, ...escompat.configs['flat/typescript-2020']]
✗ escompat.configs['flat/typescript-2020'] without spread operator
TypeScript flat configs are arrays; must spread them into config array.

Flat config example enabling two escompat rules with browser globals.

// eslint.config.js import globals from 'globals'; import escompat from 'eslint-plugin-escompat'; export default [ { plugins: { escompat }, languageOptions: { globals: globals.browser }, rules: { 'escompat/no-async-generator': 'error', 'escompat/no-numeric-separators': 'error', } } ];
Debug
Known issues
breakingv3.11.2 fixed a breaking change where Browserslist API broke `this` context in custom browserslist configs.
fix
Update to v3.11.2 or later.
affects: 3.11.0, 3.11.1
deprecated.eslintrc (non-flat) config style is deprecated in ESLint 9; only flat config is recommended going forward.
fix
Migrate to flat config (eslint.config.js) using eslint-plugin-escompat's flat configs.
affects: >=3.11.0
gotchaRules are only effective if you have a browserslist configured in package.json or .browserslistrc. Without one, all rules are disabled.
fix
Add a browserslist to your project (e.g., 'last 1 version') or define it in a config file.
affects: >=3.0.0
gotchaThe 'recommended' config only enables rules that cover syntax not yet widely supported; it may not catch all potential incompatibilities. Always pair with eslint-plugin-compat for polyfill checks.
fix
Use both eslint-plugin-escompat and eslint-plugin-compat for full coverage.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'escompat' declared in '.eslintrc'
Missing eslint-plugin-escompat package or incorrect plugin name in config.
fix
Run 'npm install --save-dev eslint-plugin-escompat' and ensure the plugin is listed as 'escompat' in plugins.
Configuration for rule 'escompat/no-async-generator' is invalid
Rule is not recognized; either the plugin is not loaded, or the rule name is misspelled.
fix
Check that the plugin is correctly loaded and the rule name matches exactly (e.g., 'no-async-generator', not 'no-async-generator-something').
Definition for rule 'escompat/no-*' was not found
The rule does not exist in the plugin version installed.
fix
Update to latest version: 'npm update eslint-plugin-escompat' and verify available rules in documentation.
TypeError: Cannot read properties of undefined (reading 'includes')
Possibly related to a missing or malformed browserslist config causing rule parsing to fail.
fix
Ensure browserlist is defined properly in package.json or .browserslistrc (e.g., 'last 1 version').
Upgrade
Version history
3.11.4latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin requires ESLint >=5.14.1
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-escompat — npm install eslint-plugin-escompat · libregistry