Gathering detailed insights and metrics for @eslint/eslintrc
Gathering detailed insights and metrics for @eslint/eslintrc
Gathering detailed insights and metrics for @eslint/eslintrc
Gathering detailed insights and metrics for @eslint/eslintrc
The legacy ESLintRC config file format for ESLint
npm install @eslint/eslintrc
92.5
Supply Chain
99.2
Quality
86.8
Maintenance
100
Vulnerability
99.3
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
121 Stars
171 Commits
43 Forks
13 Watching
3 Branches
28 Contributors
Updated on 26 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.1%
7,198,271
Compared to previous day
Last week
1.7%
42,301,461
Compared to previous week
Last month
13.2%
172,186,279
Compared to previous month
Last year
27.2%
1,689,203,183
Compared to previous year
This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
Note: This package is frozen except for critical bug fixes as ESLint moves to a new config system.
You can install the package as follows:
npm install @eslint/eslintrc --save-dev
# or
yarn add @eslint/eslintrc -D
The primary class in this package is FlatCompat
, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your eslint.config.js
file:
1import { FlatCompat } from "@eslint/eslintrc"; 2import js from "@eslint/js"; 3import path from "path"; 4import { fileURLToPath } from "url"; 5 6// mimic CommonJS variables -- not needed if using CommonJS 7const __filename = fileURLToPath(import.meta.url); 8const __dirname = path.dirname(__filename); 9 10const compat = new FlatCompat({ 11 baseDirectory: __dirname, // optional; default: process.cwd() 12 resolvePluginsRelativeTo: __dirname, // optional 13 recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended" 14 allConfig: js.configs.all, // optional unless you're using "eslint:all" 15}); 16 17export default [ 18 19 // mimic ESLintRC-style extends 20 ...compat.extends("standard", "example", "plugin:react/recommended"), 21 22 // mimic environments 23 ...compat.env({ 24 es2020: true, 25 node: true 26 }), 27 28 // mimic plugins 29 ...compat.plugins("jsx-a11y", "react"), 30 31 // translate an entire config 32 ...compat.config({ 33 plugins: ["jsx-a11y", "react"], 34 extends: "standard", 35 env: { 36 es2020: true, 37 node: true 38 }, 39 rules: { 40 semi: "error" 41 } 42 }) 43];
Using FlatCompat
in CommonJS files is similar to ESM, but you'll use require()
and module.exports
instead of import
and export
. Here's how you use it inside of your eslint.config.js
CommonJS file:
1const { FlatCompat } = require("@eslint/eslintrc"); 2const js = require("@eslint/js"); 3 4const compat = new FlatCompat({ 5 baseDirectory: __dirname, // optional; default: process.cwd() 6 resolvePluginsRelativeTo: __dirname, // optional 7 recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended" 8 allConfig: js.configs.all, // optional unless using "eslint:all" 9}); 10 11module.exports = [ 12 13 // mimic ESLintRC-style extends 14 ...compat.extends("standard", "example", "plugin:react/recommended"), 15 16 // mimic environments 17 ...compat.env({ 18 es2020: true, 19 node: true 20 }), 21 22 // mimic plugins 23 ...compat.plugins("jsx-a11y", "react"), 24 25 // translate an entire config 26 ...compat.config({ 27 plugins: ["jsx-a11y", "react"], 28 extends: "standard", 29 env: { 30 es2020: true, 31 node: true 32 }, 33 rules: { 34 semi: "error" 35 } 36 }) 37];
TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor
The recommendedConfig
option is required when any config uses eslint:recommended
, including any config in an extends
clause. To fix this, follow the example above using @eslint/js
to provide the eslint:recommended
config.
TypeError: Missing parameter 'allConfig' in FlatCompat constructor
The allConfig
option is required when any config uses eslint:all
, including any config in an extends
clause. To fix this, follow the example above using @eslint/js
to provide the eslint:all
config.
MIT License
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 20/21 approved changesets -- score normalized to 9
Reason
4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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