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.
Flat config structure
Flat config (default since ESLint 9) 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: "^_" }] },
},
];
Flat config fields at a glance
| Field | Type | Purpose |
|---|---|---|
files | string[] | Glob patterns — which files this config object applies to |
ignores | string[] | Glob patterns to exclude; standalone = global ignore list |
languageOptions | object | Parser, ecmaVersion, sourceType, globals |
languageOptions.globals | object | Global variables (from globals package) |
languageOptions.parser | object | Custom parser (e.g. @typescript-eslint/parser) |
languageOptions.parserOptions | object | Parser-specific options (e.g. project for type-aware linting) |
plugins | object | Namespace → plugin module mapping |
rules | object | Rule name → severity or [severity, options] |
settings | object | Free-form data shared with all rules in this config |
processor | string or object | Post-processor for non-JS files (e.g. extracting JS from Markdown) |
Legacy .eslintrc mapping
If you are migrating from .eslintrc, here is how the key fields map:
.eslintrc field | Flat config equivalent |
|---|---|
extends | Import the config and spread into the array |
env | languageOptions.globals via the globals package |
parser | languageOptions.parser |
parserOptions | languageOptions.parserOptions |
plugins (string array) | plugins (namespace-to-module object) |
rules | rules (unchanged) |
settings | settings (unchanged) |
.eslintignore | Config object with only ignores |
overrides | Additional array entries with files |
Tips and examples
- A flat-config object containing only
ignoresis a global ignore list and replaces the old.eslintignorefile. - Reference a plugin rule by its namespace: register
plugins: { import: x }, then enable"import/order": "warn". - Use
languageOptions.parserto swap intypescript-eslint’s parser for type-aware linting, paired withparserOptions.project. - The
settingsobject is free-form shared state passed to every rule — this is how plugins likeeslint-plugin-importlearn your module resolver configuration. - Flat config is evaluated from first to last; when two entries match the same file, the later one’s
rulesoverride the earlier one’s for any conflicting rule.