Flat Config

noun

say it: “FLAT KAHN-fig” /flæt ˈkɑnfɪɡ/

ESLint's settings file format: one JavaScript file that exports a list of settings applied in order.

What is ESLint's flat config?

Flat config is ESLint's settings file, eslint.config.js: one list of settings objects applied in order, such as the recommended rules, the globals your code may use, and your own rules on top.

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

export default [
  js.configs.recommended,
  { languageOptions: { globals: globals.node } },
  { rules: { "no-unused-vars": "warn" } },
];

In a sentence

  • “The project's flat config turns on the recommended rules and tells ESLint the code runs in Node.”
  • “New ESLint versions ignore an old .eslintrc file and read the flat config instead.”

Level: Journeyman · More JavaScript terms at this level

Updated