Try this

import pluginNext from '@next/eslint-plugin-next'

export default defineConfig([
  {
    plugins: {
      '@next/next': pluginNext
    },
  },
  {
    files: ['**/*.ts', '**/*.tsx'],
    rules: {
      ...pluginNext.configs.recommended.rules
    }
  }
])
Answer from TheFabi8A on Stack Overflow
🌐
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
October 31, 2024 - import globals from "globals"; import pluginJs from "@eslint/js"; import tseslint from "typescript-eslint"; import pluginReact from "eslint-plugin-react"; /** @type {import('eslint').Linter.Config[]} */ export default [ { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], }, { languageOptions: { globals: globals.browser, }, }, pluginJs.configs.recommended, ...tseslint.configs.recommended, pluginReact.configs.flat.recommended, ]; gives ⚠ The Next.js plugin was not detected in your ESLint configuration.
Author   rzimmerdev
🌐
Next.js
nextjs.org › docs › app › api-reference › config › eslint
Configuration: ESLint | Next.js
2 weeks ago - As part of the removal, the eslint option in your Next config file is no longer needed and can be safely removed. If you're using @next/eslint-plugin-next in a project where Next.js isn't installed in your root directory (such as a monorepo), you can tell @next/eslint-plugin-next where to find your Next.js application using the settings property in your eslint.config.mjs:
🌐
Reddit
reddit.com › r/askprogramming › how to fix eslintrc rules not being followed in nextjs app (e.g "error: strings must use singlequote.")
r/AskProgramming on Reddit: How to fix eslintrc rules not being followed in nextjs app (e.g "Error: Strings must use singlequote.")
January 13, 2023 -

I'm trying to compile a nextjs app but I keep getting errors like:

warn  - The `app` dir is experimental. Please add `{experimental:{appDir: true}}` to your `next.config.js` to enable it
info  - Linting and checking validity of types ...warn  - The `app` dir is experimental. Please add `{experimental:{appDir: true}}` to your `next.config.js` to enable it
warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config

Failed to compile.

./components/CustomTexts.jsx
3:45  Error: Strings must use singlequote.  quotes
4:1  Error: `framer-motion` import should occur before import of `../utils/motion`  import/order
6:47  Error: Multiple spaces found before '}'.  no-multi-spaces
8:3  Error: Expected indentation of 4 space characters but found 2.  react/jsx-indent-props
9:3  Error: Expected indentation of 4 space characters but found 2.  react/jsx-indent-props
13:43  Error: Trailing spaces not allowed.  no-trailing-spaces
14:7  Error: Expected indentation of 8 space characters but found 6.  react/jsx-indent-props
14:18  Error: A space is forbidden before closing bracket  react/jsx-tag-spacing
14:19  Error: The closing bracket must be aligned with the line containing the opening tag (expected column 7 on the next line)  react/jsx-closing-bracket-location     

I added rules in both eslintrc files (eslintrc.js and eslintrc.json) "jsx-quotes": "off" but it doesn't make a difference.

Here is my eslintrc.json:

{
  "extends": "next/core-web-vitals",
  "rules": {
    "jsx-quotes": "off"
  }
}

"extends": "next/core-web-vitals", "rules": { "jsx-quotes": "off" } }

And my eslintrc.js with the "jsx-quotes" rule at the bottom:

module.exports = {
  env: {
    browser: true,
    es2021: true,
  },
  extends: [
    'plugin:react/recommended',
    'airbnb',
  ],
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 12,
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
    'react/no-unescaped-entities': 0,
    'eslintreact/no-danger': 0,
    'react/jsx-max-props-per-line': 0,
    'react/jsx-first-prop-new-line': 0,
    'no-console': 0,
    'jsx-a11y/label-has-associated-control': 0,
    'no-nested-ternary': 0,
    'consistent-return': 0,
    'no-alert': 0,
    'react/jsx-no-constructed-context-values': 0,
    'import/extensions': 0,
    'react/prop-types': 0,
    'linebreak-style': 0,
    'react/state-in-constructor': 0,
    'import/prefer-default-export': 0,
    'react/react-in-jsx-scope': 'off',
    'react/jsx-props-no-spreading': 'off',
    'jsx-a11y/no-noninteractive-element-interactions': 'off',
    'react/function-component-definition': [
      2,
      {
        namedComponents: 'arrow-function',
        unnamedComponents: 'arrow-function',
      },
    ],
    'max-len': [
      2,
      1050,
    ],
    'no-multiple-empty-lines': [
      'error',
      {
        max: 1,
        maxEOF: 1,
      },
    ],
    'no-underscore-dangle': [
      'error',
      {
        allow: [
          '_d',
          '_dh',
          '_h',
          '_id',
          '_m',
          '_n',
          '_t',
          '_text',
        ],
      },
    ],
    'object-curly-newline': 0,
    'react/jsx-filename-extension': 0,
    'react/jsx-one-expression-per-line': 0,
    'jsx-a11y/click-events-have-key-events': 0,
    'jsx-a11y/alt-text': 0,
    'jsx-a11y/no-autofocus': 0,
    'jsx-a11y/no-static-element-interactions': 0,
    'react/no-array-index-key': 0,
    'jsx-a11y/anchor-is-valid': [
      'error',
      {
        components: [
          'Link',
        ],
        specialLink: [
          'to',
          'hrefLeft',
          'hrefRight',
        ],
        aspects: [
          'noHref',
          'invalidHref',
          'preferButton',
        ],
      },
    ],
    'jsx-quotes': 'off'
  },
};

Does it have something to do with this warning warn - The Next.js plugin was not detected in your ESLint configuration.?

I've tried going through the link to configure it but it seems like everything is installed already.

🌐
Medium
medium.com › @mdnoushadsiddiqi › fixing-next-js-eslint-errors-with-flat-config-in-eslint-9-f622d4570af0
Fixing Next.js ESLint Errors with Flat Config in ESLint 9 | by Mohammad Noushad Siddiqi | Medium
October 2, 2025 - ESLint 9 only supports flat config. Old .eslintrc configs with plugins: ["@next/next"] are no longer valid. Next.js still bundles legacy configs. That’s why you see “plugin not detected” warnings unless you switch to flatConfig.
🌐
GitHub
github.com › vercel › next.js › discussions › 40660
Suppress/Silent warning "The Next.js plugin was not detected in your ESLint configuration." · vercel/next.js · Discussion #40660
Reload to refresh your session. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... Using custom eslint configuration and really don't want/need eslint-config-next . I s there a way to suppress just this specific warning in the console during builds? info - Linting and checking validity of types ..warn - The Next.js plugin was not detected in your ESLint configuration.
Author   vercel
🌐
GitHub
github.com › vercel › next.js › issues › 73655
`The Next.js plugin was not detected` reporting when using flat config · Issue #73655 · vercel/next.js
December 8, 2024 - next.js/packages/next/src/lib/eslint/runLintCheck.ts ... At this step, the calculateConfigForFile API is called with the path to the configuration file. However, the result of this API reflects the linting configuration for the specified file path. For example, if the configuration file is a .mjs file, and the @next/next plugin does not include .mjs in its files property, the warning The Next.js plugin was not detected in your ESLint configuration.
Author   mrskiro
Top answer
1 of 3
37

Update

NextJS now has official guide to add eslint to project: https://nextjs.org/docs/basic-features/eslint Additionally you need to install ESLint extension.

Also, If you're looking for ESLint with typescript support: https://gourav.io/blog/nextjs-cheatsheet

Old answer:

Install ESLint

npm i eslint --save-dev

Install ESLint plugins:

npx install-peerdeps --dev eslint-config-airbnb

Above single command will install 6 plugins: eslint-config-airbnb, eslint-plugin-import, eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-jsx-a11y. You can also install these plugins individually.

Install babel eslint

npm i -D babel-eslint

Install prettier plugin (optional, so that prettier doesn't mess up with linting)

 npm i -D eslint-config-prettier eslint-plugin-prettier

Your "devDependencies" should look something like this:

"devDependencies": {
    "babel-eslint": "^10.1.0",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.1.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-react": "^7.20.0",
    "eslint-plugin-react-hooks": "^2.5.1"
  }

Now, create a file .eslintrc.json at root of project. Paste below config:

{
  "env": {
    "browser": true,
    "commonjs": true,
    "es6": true,
    "node": true
  },
  "parser": "babel-eslint",
  "extends": [
    "eslint:recommended",
    "airbnb",
    "airbnb/hooks",
    "plugin:react/recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:jsx-a11y/recommended",
    // "plugin:react-hooks/recommended",
    // always put prettier at last
    "prettier"
  ],
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly"
  },
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true // enable linting for jsx files
    },
    "ecmaVersion": 11,
    "sourceType": "module"
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "plugins": ["react", "react-hooks"],
  "rules": {
    // NextJs specific fix: suppress errors for missing 'import React' in files for nextjs
    "react/react-in-jsx-scope": "off",
   // NextJs specific fix: allow jsx syntax in js files
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], //should add ".ts" if typescript project
    "react/display-name": 1
  }
}

Also, install ESLint extension for VSCode.

Reload VSCode window once to get proper linting

ESLint will automatically start detecting errors/warnings in *.js and *.jsx files. If that's not the case then either your project has no linting errors or ESLint is not properly setup. To test if linting works run eslint command in terminal with folder path i.e. eslint pages/** and notice output.

To disable linting of some files/folders you can create a .eslintignore at the root of project.

.eslintignore:

# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage

Finally, you can also add linting to scripts in package.json as a part of your build/deploy process:

"scripts": {
    "lint": "eslint ./components/** ./pages/** -c .eslintrc.json --ext js,jsx",
    "lint-fix": "eslint ./components/** ./pages/** -c .eslintrc.json --fix --ext js,jsx",
}

See my current ESLint configuration for NextJS Typescript project: https://github.com/GorvGoyl/Personal-Site-Gourav.io/blob/main/.eslintrc.js

2 of 3
15

you need to install required npm modules.

with Npm:

npm i -D babel-eslint eslint-config-airbnb eslint eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks

with Yarn:

yarn add -D babel-eslint eslint-config-airbnb eslint eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks

Here is related article about that

https://medium.com/@melih193/next-js-eslint-setup-tutorial-for-airbnb-config-c2b04183a92a

Find elsewhere
🌐
Joshtronic
joshtronic.com › 2024 › 03 › 17 › airbnb-style-guide-nextjs
Airbnb style guide with Next.js - Joshtronic
By choosing the JSON config file format, the .eslintrc.json generated by create-next-app will be wiped clean in favor of a configuration based on the initialization options. If you were to try to run npm run lint at this point, you'd be greeted with a whole mess of errors: ... ⚠ The Next.js plugin was not detected in your ...
🌐
npm
npmjs.com › package › @next › eslint-plugin-next
@next/eslint-plugin-next - npm
ESLint plugin for Next.js.. Latest version: 16.1.6, last published: a month ago. Start using @next/eslint-plugin-next in your project by running `npm i @next/eslint-plugin-next`. There are 650 other projects in the npm registry using @next/eslint-plugin-next.
      » npm install @next/eslint-plugin-next
    
Published   Jan 27, 2026
Version   16.1.6
🌐
GitHub
github.com › vercel › next.js › issues › 67596
Next.js does not pick up external eslint config · Issue #67596 · vercel/next.js
July 9, 2024 - https://codesandbox.io/p/devbox/serene-napier-go8s7s · Currently, when running next lint with the above reproduction steps, next tries to go through eslint config setup. Expected Behaviour: For next lint to pick up the root eslint config, possibly through an option in next.config.js
Author   EliasVal
🌐
DEV Community
dev.to › jordanahaines › just-use-this-nextjs-eslint-configuration-540
Just use this Next.js Eslint Configuration - DEV Community
January 12, 2025 - npm i --save eslint typescript-eslint eslint-config-next eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-tailwindcss eslint-plugin-unicorn
🌐
ESLint
eslint.org › docs › latest › use › configure › configuration-files
Configuration Files - ESLint - Pluggable JavaScript Linter
When files is specified, these plugins are only available to the matching files. rules - An object containing the configured rules. When files or ignores are specified, these rule configurations are only available to the matching files. settings - An object containing name-value pairs of information that should be available to all rules. ... Patterns specified in files and ignores use minimatch syntax and are evaluated relative to the location of the eslint.config.js file.
🌐
Stack Overflow
stackoverflow.com › questions › 79445426 › how-do-i-fix-the-eslint-configuration-error-in-my-project
reactjs - How do I fix the ESLint configuration error in my project? - Stack Overflow
**This is what my eslint.config.js file looks like: ** /** @type {import('eslint').Linter.Config} */ module.exports = { extends: [ 'airbnb-base', 'next', 'next/core-web-vitals', 'plugin:prettier/recommended', ], plugins: ['next', 'prettier'], parser: '@typescript-eslint/parser', // Add parser for TypeScript (if using TypeScript) parserOptions: { ecmaVersion: 2020, // Ensure ECMAScript 2020 (ESModules) support sourceType: 'module', // Enable module support for import/export statements ecmaFeatures: { jsx: true, // Enable JSX support (if using React) }, }, rules: { 'react/jsx-no-target-blank': 'off', 'prettier/prettier': 'off', 'no-unused-vars': 'warn', 'no-console': 'warn', }, };
🌐
DEV Community
dev.to › celest67 › nextjs-with-eslint-3gl5
Next.js with ESLint - DEV Community
February 8, 2023 - Reading the documentation for Next.js you are going to find that · Next.js provides an integrated ESLint experience out of the box. We just need to add next lint as a script to the package.json. So that is what I'm going to do now.
🌐
Devinshoemaker
devinshoemaker.com › blog › next-js › configure-eslint
Configure ESLint for Next.js
To fix this, we need to update the ESLint config rules to fit Next.js. The first thing we need to fix is the warning: Warning: React version not specified in eslint-plugin-react settings · To get rid of this, we can add settings property at the root of our config: { "settings": { "react": ...
🌐
Stack Overflow
stackoverflow.com › questions › 77336084 › failed-to-load-eslint-plugin-next-despite-correct-configuration-in-next-js-pro
json - Failed to Load ESLint Plugin 'next' Despite Correct Configuration in Next.js Project - Stack Overflow
error - ESLint: Failed to load plugin 'next' declared in '.eslintrc.json': Cannot find module 'E:\Project\node_modules\eslint-plugin-next\index.js'. Please verify that the package.json has a valid "main" entry Require stack: - E:\Project\__placeholder__.js
🌐
Stack Overflow
stackoverflow.com › questions › 74245942 › how-to-solve-eslint-error-in-the-build-process-of-next-js
reactjs - How to solve Eslint error in the build process of Next.js - Stack Overflow
info - Checking validity of types warn - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config Failed to compile.
🌐
Witch
witch.work › en › posts › blog-eslint-pnpm-bugfix
Reasons and Solutions for eslint-config-next Failing in Next.js Projects Using pnpm
April 16, 2025 - There was a setting ensuring that eslint plugins existed at the top level of node_modules. However, starting from pnpm v10, this setting was removed from the default configuration. As a result, eslint could not find the plugins, leading to this bug.