Since ESLint 9.9.0, it's now possible to use the (experimental) eslint.config.ts format:

  • https://eslint.org/blog/2024/08/eslint-v9.9.0-released/#experimental-typescript-configuration-files
🌐
TypeScript ESlint
typescript-eslint.io › getting-started
Getting Started | typescript-eslint
This page is a quick-start for ESLint's new "flat" config format to go from zero to linting with our recommended rules on your TypeScript code as quickly as possible.
🌐
TypeScript ESlint
typescript-eslint.io › packages › typescript-eslint
typescript-eslint | typescript-eslint
Below is a more complex example of how you might use our tooling with flat configs. This config: ... // @ts-check import eslint from '@eslint/js'; import { defineConfig } from 'eslint/config'; import jestPlugin from 'eslint-plugin-jest'; import tseslint from 'typescript-eslint'; export default defineConfig( { // config with just ignores is the replacement for `.eslintignore` ignores: ['**/build/**', '**/dist/**', 'src/some/file/to/ignore.ts'], }, eslint.configs.recommended, { plugins: { '@typescript-eslint': tseslint.plugin, jest: jestPlugin, }, languageOptions: { parser: tseslint.parser, parserOptions: { projectService: true, }, }, rules: { '@typescript-eslint/no-floating-promises': 'error', // ...
🌐
ESLint
eslint.org › docs › latest › use › configure › migration-guide
Configuration Migration Guide - ESLint - Pluggable JavaScript Linter
(Flat config files act as if root: true is set.) The files option cannot be a single string anymore, it must be an array. The sourceType option now supports the new value "commonjs" (.eslintrc supports it too, but it was never documented). You can see the TypeScript types for the flat config file format in the lib/types source folder on GitHub.
🌐
DEV Community
dev.to › aolyang › eslint-9-flat-config-tutorial-2bm5
ESLint 9 Flat config tutorial - DEV Community
August 5, 2024 - Now ESLint9 disabled & deprecated some confict rules, and enabled Flat config as default. (ESLint 9.0 stable version published in 2024/4/6, and developed quickly) In this tutorial, I have created a Gist based on ESLint 9 for Vue3 + TypeScript, supported Template and JSX.
Top answer
1 of 1
9

ESLint flat config is quite different from the previous format. To help understand the "flat config" the following pointers helped me:

  • Config is nothing more complicated than an array of objects. This is simpler than the previous format but might not be obvious at first.
  • Each object in the array can define whatever ESLint configuration it wants
  • Each object can target certain files by including or ignoring a set of files (useful because .eslintignore is no longer available)
  • Each file being linted will have all matching configurations applied - I believe in the order they appear in the array

Setup for VS Code - at the time of writing you'll need:

  • ESLint plugin v3.0.5 or above (this currently requires "switch to pre-release version") in the plugin's installation page
  • Add "eslint.useFlatConfig": true to your settings.json (this was previously eslint.experimental.useFlatConfig)

Install the following dependencies:

    yarn add --dev \
      eslint \
      @eslint/js \
      typescript-eslint \
      --

Use the following eslint.config.mjs file to get you started (locate it alongside package.json). This provides defaults from https://typescript-eslint.io/getting-started/. This config additionally allows you to add ignored files, which is useful because .eslintignore is no longer available. NB the config is 'just Javascript' so you can make additional changes. This uses module.exports which avoids the need to add type: "module" to package.json:

// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

// https://typescript-eslint.io/getting-started/

const ignores = [
  '**/*.js',
];

export default tseslint.config(
  {
    ...eslint.configs.recommended,
    ignores,
  },
  ...tseslint.configs.recommended.map((config) => ({
    ...config,
    ignores,
  })),
);

Pro:

  • It's actually quite clean
  • The config above is a lot smaller than the sticky nest of stuff I had accumulated under the old config

Con:

  • I was previously using AirBnB config but decided I needed to dump that because it's not (yet) available in flat config format
  • Applying a different set of linting rules meant a raft of (mostly simple) changes across my codebase
Find elsewhere
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 7694
ESLint Flat Config Support · Issue #7694 · typescript-eslint/typescript-eslint
June 19, 2023 - Edit: typescript-eslint@>=v7 supports ESLint flat config! See: https://typescript-eslint.io/blog/announcing-typescript-eslint-v7 Overview ESLint is adding an exciting new config system called "flat" configs: Configuration files docs: htt...
Author   JoshuaKGoldberg
🌐
Advancedfrontends
advancedfrontends.com › eslint-flat-config-typescript-javascript
Modern Linting in 2025: ESLint Flat Config with TypeScript and JavaScript - Advanced Frontends.com
April 9, 2025 - The new flat config eliminates legacy concepts like "extends" chains and config merging, replacing them with a single JavaScript file (eslint.config.js) that gives you full control over: ... The following will demonstrate how to use rulesets for Typescript independently of JavaScript and apply plugins and sharable configs.
🌐
DEV Community
dev.to › psychosynthesis › new-eslint-flat-config-file-format-example-217c
New ESLint flat config file format example - DEV Community
April 12, 2024 - import path from "path"; import { fileURLToPath } from "url"; import { FlatCompat } from "@eslint/eslintrc"; import pluginJs from "@eslint/js"; // mimic CommonJS variables -- not needed if using CommonJS const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended }); export default [ ...compat.extends("standard-with-typescript") ];
🌐
TypeScript ESlint
typescript-eslint.io › users › configs
Shared Configs | typescript-eslint
If a majority of developers working on your project are comfortable with TypeScript and typescript-eslint, consider replacing recommended with strict. If your project enables typed linting, we suggest enabling the recommended-type-checked and stylistic-type-checked configurations to start: note · To use type-checking, you also need to configure languageOptions.parserOptions as shown in typed linting docs. Flat Config ·
🌐
GitHub
github.com › vercel › next.js › discussions › 49337
How to use new "flat config" approach in Eslint? · vercel/next.js · Discussion #49337
I did the exact same thing but ran into this error: ConfigError: Config (unnamed): Key "extends": This appears to be in eslintrc format rather than flat config format. ... import eslintPluginNext from "@next/eslint-plugin-next"; import tseslint from "typescript-eslint"; import eslintPluginReactHooks from "eslint-plugin-react-hooks"; import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; const eslintConfig = [ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access eslintPluginNext.flatConfig.recommended, // eslint-disable-next-line @typescript-eslint/n
Author   vercel
🌐
ESLint
eslint.org › blog › 2025 › 03 › flat-config-extends-define-config-global-ignores
Evolving flat config with extends - ESLint - Pluggable JavaScript Linter
// eslint.config.js import { ... the correctness of your configuration using TypeScript. The defineConfig() function also automatically flattens all of its arguments, meaning you can nest objects and arrays:...
🌐
GitHub
gist.github.com › x7ddf74479jn5 › 1cf36b185950ce088130d60426cb4e2e
ESLint Flat Configメモ · GitHub
import { FlatCompat } from "@eslint/eslintrc" const compat = new FlatCompat(); export default [{ ...compat.extends("plugin:@typescript-eslint/recommended"), rules: { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-var-requires": "off", } }]; ... import typescriptEslint from "@typescript-eslint/eslint-plugin"; export default [ { plugins: { "@typescript-eslint": typescriptEslint, }, rules: { ...typescriptEslint.configs["eslint-recommended"].rules, ...typescriptEslint.configs["recommended"].rules, ...typescriptEslint.configs["recommended-requiring-type-checking"].rules, }, }, ];
🌐
Chris
chris.lu › web_development › tutorials › next-js-static-first-mdx-starterkit › typescript-eslint-flat-config
Typescript Linting and custom flat config - Next.js 15 Tutorial
Line 31: first we specify that the name for custom flat config will be tseslintConfig · Line 32: We use the files option to tell ESLint which files (extensions) we want to include (for this tutorial we will enable linting for ES Module (esm) files (.mjs), for regular Typescript (.ts) and also for Typescript & JSX files (.tsx))
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 5938
Docs: new eslint.config.js - adapt all existing content to new flat config · Issue #5938 · typescript-eslint/typescript-eslint
February 14, 2022 - On this occasion, it would be nice to supplement the Custom rules > Testing section because there's no more defineParser(), and people might want few examples how to set up let linter = new Linter({ configType: "flat" }); linter.verifyAndFix(str, [ ... and how to test the plugin works on esprima and @typescript-eslint/parser.
Published   Nov 08, 2022
🌐
GitHub
github.com › eslint › eslint › discussions › 18303
Migrating from JSON to flat config · eslint/eslint · Discussion #18303
I find the new flat config syntax verbose and cryptic. I have posted a question on StackOverflow but I feel I need to ask here as well. I have a monorepo project that has this as my base config for ESlint 8.57.0 · { "root": true, "plugins": ["@typescript-eslint", "deprecation", "simple-import-sort", "prettier", "only-warn"], "reportUnusedDisableDirectives": true, "overrides": [ { "files": ["*.ts"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@typescript-eslint/stylistic-type-checked", "plugin:deprecation/recommended", "plugin:eslint-comments/recommended", "plugin:prettier/recommended" ], "rules": { //specific rules go here } }, { "files": ["*.spec.ts"], "extends": [], "rules": { //Less strict in test files - disable a few here //etc.
Author   eslint
🌐
Nx
nx.dev › recipes › tips-n-tricks › flat-config
Switching to ESLint's Flat Config Format | Nx
It will also convert the base .eslintrc.json and .eslintignore. Section titled “Correctness and best practices” · The purpose of this generator is to create a flat config that works the same way as the original JSON config did.
🌐
Raul Melo
raulmelo.me › en › blog › migration-eslint-to-flat-config
Embrace the Future: Navigating the New Flat Configuration of ESLint · Raul Melo
July 20, 2023 - In eslintrc, we could give various names and extensions to an ESLint config: .eslintrc (without extension but matches the JSON syntax) ... Now in the flat config, we have a unique file name standard: eslint.config.js.