Next.js
nextjs.org › docs › app › api-reference › config › eslint
Configuration: ESLint | Next.js
2 weeks ago - eslint-config-next/typescript: Adds TypeScript-specific linting rules from typescript-eslint. Use this alongside the base or core-web-vitals config. Get linting working quickly with the ESLint CLI (flat config):
GitHub
github.com › vercel › next.js › discussions › 49337
How to use new "flat config" approach in Eslint? · vercel/next.js · Discussion #49337
Switching my projects to flat config was taking more time than it was worth. Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... There was an error while loading. Please reload this page. ... Something went wrong. There was an error while loading. Please reload this page. ... I have created a package eslint-config-next-flat (Source code) that is (roughly) a port of the eslint-config-next for FlatConfig.
Author vercel
GitHub
github.com › vercel › next.js › discussions › 50453
How can I use the new ESLint flat config in a Next.js project and also use 'canonical' rules? · vercel/next.js · Discussion #50453
After updating eslint config to flat format, eslint needs it to be in an eslint.config.js file for eslint to be happy with the flat format. However, next.js (when you run next lint) is looking for an eslintrc.json file, which is no longer valid with eslint flat config.
Author vercel
Chris
chris.lu › web_development › tutorials › next-js-static-first-mdx-starterkit › linting-setup-using-eslint
Linting setup using ESLint 9 flat config - Next.js 15 Tutorial
ESLint "flat config rollout" issue ESLint "flag config part 1" blog post ESLint "flag config part 2" blog post ESLint "flag config part 3" blog post ESLint "flat config files" RFC · In ESLint v9 the eslintrc files are deprecated, support for eslintrc (classic) configuration files will be removed in ESLint version 10.0.0 ... if Next.js detects that you are still using ESLint v8 they automatically set the ESLINT_USE_FLAT_CONFIG=false flag, which enables support for flat config files in ESLint v8
npm
npmjs.com › package › eslint-config-next
eslint-config-next - npm
ESLint configuration used by Next.js.. Latest version: 16.1.6, last published: a month ago. Start using eslint-config-next in your project by running `npm i eslint-config-next`. There are 1677 other projects in the npm registry using eslint-config-next.
» npm install eslint-config-next
GitHub
github.com › vercel › next.js › issues › 64114
New ESLint "flat" configuration file does not work with `next/core-web-vitals` · Issue #64114 · vercel/next.js
April 5, 2024 - I also tried ...compat.extends("eslint-config-next"), but that does not work either. For extra context, ESLint is moving from .eslintrc.json to eslint.config.js, and all other shareable ESLint configs I am using (e.g., typescript-eslint, eslint-config-prettier) already support this, even without needing to use FlatCompat.
Published Apr 05, 2024
Top answer 1 of 4
7
Try this
import pluginNext from '@next/eslint-plugin-next'
export default defineConfig([
{
plugins: {
'@next/next': pluginNext
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
...pluginNext.configs.recommended.rules
}
}
])
2 of 4
5
This works for me (I tested with next 15.0.3 / eslint 9.14 / eslint-config-next 15.0.3)
eslint.config.mjs
import pluginNext from '@next/eslint-plugin-next';
import parser from '@typescript-eslint/parser'; // optional
export default [
{
name: 'ESLint Config - nextjs',
languageOptions: {
parser, // optional
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@next/next': pluginNext,
},
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
},
},
];
Medium
medium.com › @wahvanessa22 › im-setting-up-eslint-for-my-next-js-a6f22ebf768b
I'm setting up ESLint for my Next.js + TypeScript project to keep my code clean, consistent, and bug-free. A step you should consider when writing like a pro! | by Wah Vanessa | Medium
May 13, 2025 - I decided to document my findings because of how hard it was, but it was fun to set up ESLint for my next project through its documentation and understanding what is going on, especially with the new changes. For those who do not know what ESLint is, I've got you. If you have ever used a configured linters file, and how it works, you will understand better will I mean by ESLint is an advanced linting configuration that helps you to write cleaner and clearer code.
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 72: we can now remove next/typescript from the compatibility mode (compat.extends), as it gets replaced by our custom typescript-eslint config · Line 76: we set the FlatConfig type from the @typescript-eslint utilities as type for our default export (to replace the type from the ESLint package which is what we were using previously), the reason to switch for the Config type from ESLint to the one from @typescript-eslint utilities is because of issues related with the type of the default export, you can read more about those issues in the next chapter
Reddit
reddit.com › r/nextjs › eslint-config-next v1.7
r/nextjs on Reddit: eslint-config-next V1.7
March 12, 2025 - Hi all, I want to draw your attention to my package: https://github.com/Goldziher/eslint-config-next This is a comprehensive EsLint 9 (flat config)…
GitHub
github.com › vercel › next.js › issues › 73389
The Next.js plugin was not detected in your ESLint configuration and after adding it breaks because has no flat format · Issue #73389 · vercel/next.js
November 30, 2024 - gives Config (unnamed): Key "plugins": This appears to be in eslintrc format (array of strings) rather than flat config format (object). and pluginNext isn't iterable neither has a flat attribute. Current behavior is that next lint fails, and expected behaviour obviously is that it should work with the correct format.
Published Nov 30, 2024
Chris
chris.lu › web_development › tutorials › next-js-16-linting-setup-eslint-9-flat-config
Next.js 16 Linting setup using ESLint 9 flat config | chris.lu
Setting up proper linting in your Next.js 16 project is crucial for maintaining code quality and consistency. This comprehensive guide walks you through configuring ESLint 9 with the modern flat config format, including support for TypeScript, React, MDX, and various ESLint plugins.
ESLint
eslint.org › blog › 2025 › 03 › flat-config-extends-define-config-global-ignores
Evolving flat config with extends - ESLint - Pluggable JavaScript Linter
One pointed criticism is that they never knew how to extend another configuration because some were objects, some were arrays, and not all plugins exposed their flat configs the same way. Here’s an example: import js from "@eslint/js"; import tailwind from "eslint-plugin-tailwindcss"; import reactPlugin from "eslint-plugin-react"; import eslintPluginImportX from "eslint-plugin-import-x"; export default [ js.configs.recommended, ...tailwind.configs["flat/recommended"], ...reactPlugin.configs.flat.recommended, eslintPluginImportX.flatConfigs.recommended, ];