ESLint Config Schema Reference

All ESLint flat-config and .eslintrc fields with types and plugin extension.

Reference for the ESLint configuration schema covering flat config (eslint.config.js) and legacy .eslintrc fields — rules, plugins, languageOptions, files, ignores and overrides — with types and examples.

What is flat config versus .eslintrc?

Flat config (eslint.config.js) is the default since ESLint 9: an array of config objects evaluated in order. Legacy .eslintrc uses cascading files with extends and env. Most fields map across but plugins and parsers are declared differently.

Look up ESLint configuration fields fast

ESLint can be configured two ways: the modern flat config in eslint.config.js and the legacy .eslintrc files. This reference lists the fields each format accepts, their types and how plugins and rules are wired in, so you can build or fix a config without digging through docs. It runs entirely in your browser.

How it works

Flat config exports an array of config objects, each with optional files, ignores, languageOptions, plugins, rules and settings. ESLint merges the objects that match a given file in array order, with later objects winning. Rule severity is off, warn or error (or 0, 1, 2), optionally followed by rule options:

import js from "@eslint/js";
import globals from "globals";

export default [
  js.configs.recommended,
  {
    files: ["**/*.ts"],
    languageOptions: { globals: globals.node, ecmaVersion: 2023 },
    rules: { "no-unused-vars": ["error", { argsIgnorePattern: "^_" }] },
  },
];

Tips and examples

  • A flat-config object containing only ignores is a global ignore list and replaces the old .eslintignore file.
  • Reference a plugin rule by its namespace: register plugins: { import: x }, then enable "import/order": "warn".
  • Use languageOptions.parser to swap in typescript-eslint’s parser for type-aware linting, paired with parserOptions.project.
  • The settings object is free-form shared state passed to every rule and is how plugins like import learn your module resolver configuration.