Koskamo

Flat config with eslint.config.js

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

ESLint flat configuration lives in eslint.config.js, eslint.config.mjs, or eslint.config.cjs (the eslint.config.ts variants require additional setup), placed in the project root and exporting an array of configuration objects, conventionally wrapped in the defineConfig() helper imported from "eslint/config". Each configuration object carries properties such as name, files (glob patterns in minimatch syntax, evaluated relative to the config file), ignores, languageOptions, plugins, rules, and settings. When ignores appears without other keys it acts as a global ignore applied to every configuration object. In languageOptions, ecmaVersion defaults to "latest" and sourceType defaults to "module" for .js and .mjs files and "commonjs" for .cjs files. A configuration object without files or ignores applies to every file matched by any other configuration object. By default ESLint lints files matching */.js, */.cjs, and */.mjs; lint other extensions by adding a "*/.extension" pattern to files, for example files: ["*/.ts", "*/.cts", "*/.mts"] to include TypeScript files. Scope: ESLint. Reviewed October 4, 2026.

Source and provenance

Original source
eslint.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.