@eslint/eslintrc
The legacy ESLintRC config file format for ESLint
Last updated 2 years ago by eslintbot .
MIT · Repository · Bugs · Original npm
$ cnpm install @eslint/eslintrc 
SYNC missed versions from official npm registry.

ESLintRC Library

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.

Installation

You can install the package as follows:

npm install @eslint/eslintrc --save-dev

# or

yarn add @eslint/eslintrc -D

Usage

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:

import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import path from "path";
import { fileURLToPath } from "url";

// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
    baseDirectory: __dirname,                  // optional; default: process.cwd()
    resolvePluginsRelativeTo: __dirname,       // optional
    recommendedConfig: js.configs.recommended, // optional
    allConfig: js.configs.all,                 // optional
});

export default [

    // mimic ESLintRC-style extends
    ...compat.extends("standard", "example"),

    // mimic environments
    ...compat.env({
        es2020: true,
        node: true
    }),

    // mimic plugins
    ...compat.plugins("airbnb", "react"),

    // translate an entire config
    ...compat.config({
        plugins: ["airbnb", "react"],
        extends: "standard",
        env: {
            es2020: true,
            node: true
        },
        rules: {
            semi: "error"
        }
    })
];

License

MIT License

Current Tags

  • 2.1.0                                ...           latest (2 years ago)

11 Versions

  • 2.1.0                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 1.3.3                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.0.5                                ...           4 years ago
  • 0.4.3                                ...           4 years ago
  • 0.4.0                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org