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
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 and is how plugins likeimportlearn your module resolver configuration.