Gathering detailed insights and metrics for eslint-plugin-compat
Gathering detailed insights and metrics for eslint-plugin-compat
Gathering detailed insights and metrics for eslint-plugin-compat
Gathering detailed insights and metrics for eslint-plugin-compat
Check the browser compatibility of your code
npm install eslint-plugin-compat
Typescript
Module System
Min. Node Version
Node Version
NPM Version
91.1
Supply Chain
93.9
Quality
79.5
Maintenance
100
Vulnerability
98.6
License
TypeScript (97.06%)
JavaScript (2.94%)
Total Downloads
108,363,479
Last Day
29,789
Last Week
617,702
Last Month
2,738,798
Last Year
29,625,302
MIT License
3,129 Stars
465 Commits
111 Forks
30 Watchers
6 Branches
43 Contributors
Updated on Jun 27, 2025
Minified
Minified + Gzipped
Latest Version
6.0.2
Package Id
eslint-plugin-compat@6.0.2
Unpacked Size
185.62 kB
Size
28.58 kB
File Count
41
NPM Version
10.9.0
Node Version
23.3.0
Published on
Dec 12, 2024
Cumulative downloads
Total Downloads
Last Day
-8%
29,789
Compared to previous day
Last Week
-9.1%
617,702
Compared to previous week
Last Month
-0.8%
2,738,798
Compared to previous month
Last Year
22%
29,625,302
Compared to previous year
8
1
29
Lint the browser compatibility of your code
1npm install eslint-plugin-compat
eslint.config.mjs
)1import compat from "eslint-plugin-compat"; 2 3export default [compat.configs["flat/recommended"]];
.eslintrc.json
)1{ 2 "plugins": ["compat"], 3 "extends": ["plugin:compat/recommended"], 4 "env": { 5 "browser": true, 6 }, 7 // ... 8}
Browser targets are configured using browserslist. You can configure browser targets in your package.json
:
package.json
1{ 2 // ... 3 "browserslist": ["defaults"], 4}
If no configuration is found, browserslist defaults to "> 0.5%, last 2 versions, Firefox ESR, not dead"
.
See browserslist/browserslist for more details.
Add polyfills to the settings section of your eslint config. Append the name of the object and the property if one exists. Here are some examples:
1{ 2 // ... 3 "settings": { 4 "polyfills": [ 5 // Example of marking entire API and all methods and properties as polyfilled 6 "Promise", 7 // Example of marking specific method of an API as polyfilled 8 "WebAssembly.compile", 9 // Example of API with no property (i.e. a function) 10 "fetch", 11 // Example of instance method, must add `.prototype.` 12 "Array.prototype.push", 13 ], 14 }, 15}
This plugin also supports linting the compatibility of ES APIs in addition to Web APIs. This is an experimental feature and is disabled by default. To enable this feature, add the following to your eslint config:
1{ 2 // ... 3 "settings": { 4 "lintAllEsApis": true, 5 }, 6}
Browserslist allows specifying different browser queries for multiple environments. By default, this plugin targets the production
browserslist environment. To change this default, set the settings.browserslistOpts.env
property in your eslint config:
Example:
A browserslist with multiple environments:
1 "browserslist": { 2 "production": [ 3 "> 1%", 4 "not dead" 5 ], 6 "modern": [ 7 "last 1 chrome version", 8 "last 1 firefox version" 9 ] 10 }
Target modern
browserslist environment:
1{ 2 "settings": { 3 "browserslistOpts": { 4 "env": "modern", 5 }, 6 }, 7}
For a minimal demo, see amilajack/eslint-plugin-compat-demo
Toolchains for native platforms, like iOS and Android, have had API linting from the start. It's about time that the web had similar tooling.
This project was inspired by a two hour conversation I had with someone on the experience of web development and if it is terrible or not. The premise they argued was that x
browser doesn't support y
feature while z
browser does. Eventually, I agreed with him on this and made this plugin to save web developers from having to memorize the browser compatibility of WebAPIs.
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 9/29 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
8 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More@eslint/compat
Compatibility utilities for ESLint
eslint-plugin-ecmascript-compat
ESLint plugin for checking JavaScript code compatibility with target browsers and Node.js versions
eslint-plugin-builtin-compat
Checks built-in objects compatibility
eslint-plugin-typescript-compat
ESLint rule for browser compatibility of your TypeScript code