🌐
Next.js
nextjs.org › docs › app › api-reference › config › eslint
Configuration: ESLint | Next.js
2 weeks ago - eslint-config-next/core-web-vitals: Includes everything from the base config, plus upgrades rules that impact Core Web Vitals from warnings to errors.
🌐
Stack Overflow
stackoverflow.com › questions › 78256695 › how-to-extend-next-core-web-vitals-on-eslint-config-js
next.js - How to extend next/core-web-vitals on eslint.config.js? - Stack Overflow
In general, the steps for doing this are provided here: eslint.org/docs/latest/use/configure/… ... Specifically for next/core-web-vitals, there is a discussion on GitHub: github.com/vercel/next.js/discussions/63999
🌐
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 - In case it is not clear, I have imported ...compat.extends("next/core-web-vitals") in page.tsx only for the purpose of showing that it does not work. The file with the actual ESLint configuration is eslint.config.js.
Published   Apr 05, 2024
🌐
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 - …compat.extends(“next/core-web-vitals”, “next/typescript”) Next, define our global ignores and environments in the config file · { ignores: [ ".next/**", ".env", "node_modules", "public/**", "next.config.js", "postcss.config.js" ] }, { languageOptions: { globals: { ...globals.browser, ...globals.node } } } ... { plugins: { js, "@next/next": pluginNext, "@typescript-eslint": tsPlugin, tailwindcss: tailwind, }, files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"], rules: { ...js.configs.recommended.rules, ...pluginNext.configs.recommended.rules, ...pluginNext.configs["core-web-vitals"].rules, ...t
🌐
GitHub
github.com › microsoft › rushstack › issues › 5049
[eslint-patch] Failed to patch ESLint when using next/core-web-vitals configuration · Issue #5049 · microsoft/rushstack
October 28, 2024 - This issue appears to involve @rushstack/eslint-patch in combination with eslint-config-next. Create a new Next.js project using the following command ... import { dirname } from "path"; import { fileURLToPath } from "url"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, }); const eslintConfig = [ ...compat.extends("next/core-web-vitals", "next/typescript"), ]; export default eslintConfig;
Published   Dec 17, 2024
🌐
GitHub
github.com › vercel › next.js › discussions › 24900
ESLint in Next.js and Create Next App · vercel/next.js · Discussion #24900
ESLint will be enabled at build time by default in Create Next App and both next and next/core-web-vitals will be included into the initial config
Author   vercel
🌐
npm
npmjs.com › package › @next › eslint-plugin-next
@next/eslint-plugin-next - npm
Documentation for @next/eslint-plugin-next can be found at: https://nextjs.org/docs/app/api-reference/config/eslint
      » npm install @next/eslint-plugin-next
    
Published   Jan 27, 2026
Version   16.1.6
Find elsewhere
🌐
freeCodeCamp
freecodecamp.org › news › how-to-set-up-eslint-prettier-stylelint-and-lint-staged-in-nextjs
How to Set Up ESLint, Prettier, StyleLint, and lint-staged in Next.js
May 30, 2025 - 'next/core-web-vitals' is a config provided by eslint-config-next that bundles Next.js-specific rules (both for JavaScript and TypeScript, from an inspection of its code on GitHub).
🌐
Vercel
nextjs-ja-translation-docs.vercel.app › docs › basic-features › eslint
Basic Features: ESLint | Next.js
yarn lint # You'll see a prompt like this: # # ? How would you like to configure ESLint? # # ❯ Base configuration + Core Web Vitals rule-set (recommended) # Base configuration # None
🌐
Fishtank
getfishtank.com › insights › best-eslint-setup-for-sitecore-xm-cloud-headless-projects
Optimized ESLint Config for Sitecore XM Cloud + Next.js Projects | Fishtank
This configuration includes the eslint-plugin-sitecore-jss plugin by default to maximize code safety and consistency with Sitecore JSS standards: { "root": true, "extends": [ "next", "next/core-web-vitals", "plugin:@typescript-eslint/recommended", "plugin:sitecore-jss/all", "prettier", "plugin:yaml/recommended", "plugin:prettier/recommended" ], "plugins": ["@typescript-eslint", "prettier", "yaml", "react", "sitecore-jss"], "ignorePatterns": [".generated/**/*", "**/*.d.ts", "**/*.js"], "rules": { "@next/next/no-img-element": "off", "jsx-a11y/alt-text": ["warn", { "elements": ["img"] }], "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/no-explicit-any": "error", "jsx-quotes": ["error", "prefer-double"], "prettier/prettier": ["error", { "endOfLine": "auto" }], "no-html-link-for-pages": "off" } } Next.js comes with built-in ESLint support.
🌐
jashezan
jashezan.hashnode.dev › boost-your-nextjs-productivity-a-comprehensive-guide-to-setting-up-nextjs-with-eslint-prettier-husky-and-lint-staged
Boost Your Next.js Productivity: A Comprehensive Guide to Setting Up Next.js with ESLint, Prettier, Husky, and Lint-Staged
October 26, 2024 - This setup configures ESLint from scratch and ensures you have TypeScript-specific linting in place when needed. { "extends": ["next/core-web-vitals", "next/typescript"] } Prettier is a code formatter that helps maintain a consistent style across your project by automatically formatting your code according to defined rules.
🌐
Medium
blog.linotte.dev › eslint-9-next-js-935c2b6d0371
Next.js & ESLint 9 Setup Guide | Linotte Blog
October 14, 2024 - import path from "node:path"; import { fileURLToPath } from "node:url"; import js from "@eslint/js"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all }); export default [...compat.extends("next/core-web-vitals")];
🌐
GitHub
github.com › vercel › next.js › issues › 73968
Failed to load plugin 'react-hooks' declared in ' » eslint-config-next/core-web-vitals » Cannot find module 'eslint-plugin-react-hooks' · Issue #73968 · vercel/next.js
October 28, 2024 - import { dirname } from 'path'; import { fileURLToPath } from 'url'; import { FlatCompat } from '@eslint/eslintrc'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, }); const eslintConfig = [ ...compat.config({ extends: ['next/core-web-vitals', 'next/typescript', 'prettier'], }), ]; export default eslintConfig;
Published   Dec 16, 2024
🌐
Paulintrognon
paulintrognon.fr › blog › typescript-prettier-eslint-next-js
Start a clean Next.js project with TypeScript, ESLint and Prettier
Add the prefer-const rule to the .eslintrc.json config file: // .eslintrc.json { "extends": "next/core-web-vitals", "rules": { "prefer-const": "error" } } Now, create a test.ts file containing: export let APP_VERSION = "v1.0.0" VSCode should display an error, like so: Try saving the file: VSCode should automatically convert the let into a const.
🌐
Reddit
reddit.com › r/nextjs › eslint issues when using create-next-app --use-pnpm are driving me crazy!
r/nextjs on Reddit: Eslint issues when using create-next-app --use-pnpm are driving me crazy!
February 17, 2025 -

I've been struggling to find out why this happens for the last hour! These issues exist in both VS Code and Webstorm:

  • initialize a project with npx create-next-app, eslint, typescript and all -> the ESLint plugins for both VSCode and Webstorm works fine, shows warnings etc.

  • initialize a projext with npx create-next-app --use-pnpm, eslint, ts -> the ESlint plugins for both misbehave:

    • VSCode -> throws no warnings no matter what .tsx file I open and change stuff

    • Webstorm -> throws errors like "Error: Failed to load plugin 'react-hooks' declared in ' » eslint-config-next/core-web-vitals" and the ""fix"" I've found atm is to explicitly install `@next/eslint-plugin-next` as a dev dependency

Why does pnpm not love me? Is it pnpm's fault, create-next-app's fault for how it handles pnpm, or something else?

🌐
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
At this point we can check out the ESLint "Migrate Your Config File" documentation which tells us to use the ESLint Configuration Migrator which is tool to help us convert eslintrc configuration files to Flat Config files · Our eslintrc file currently looks like this: .eslintrc.json · { "extends": [ "next/core-web-vitals", "next/typescript" ] } To convert it we launch the ESLint Configuration Migrator, using the following command (depending on what extension you use for your eslintrc, if you do NOT use json then you need to adjust the file name in the command): npx @eslint/migrate-config .eslintrc.json ·
🌐
Reddit
reddit.com › r/nextjs › solid eslint config for next 15.5?
r/nextjs on Reddit: Solid ESLint config for Next 15.5?
September 2, 2025 -

I'm wondering if anyone is willing to share their eslint.config.mjs file, for the latest Next 15.5? There's so many options and I wonder if there's some industry standards that are good to go for most projects

This is the one I'm using right now (with GPT's help)

// eslint.config.mjs
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import unusedImports from "eslint-plugin-unused-imports";

const compat = new FlatCompat({
  baseDirectory: import.meta.dirname,
  recommendedConfig: js.configs.recommended,
});

export default [
  {
    ignores: ["**/node_modules/**", ".next/**", "dist/**", "coverage/**", "**/*.min.js"],
  },

  ...compat.config({
    extends: ["next/core-web-vitals", "next/typescript", "prettier"],
  }),
  {
    files: ["**/*.{js,jsx,ts,tsx}"],
    plugins: {
      "unused-imports": unusedImports,
    },
    rules: {
      "import/order": [
        "error",
        {
          groups: [
            "builtin",
            "external",
            "internal",
            "parent",
            "sibling",
            "index",
            "object",
            "type",
          ],
          alphabetize: { order: "asc", caseInsensitive: true },
        },
      ],
      "unused-imports/no-unused-imports": "error",
      "unused-imports/no-unused-vars": [
        "warn",
        { varsIgnorePattern: "^_", argsIgnorePattern: "^_" },
      ],
      "react-hooks/exhaustive-deps": "off",
      "@typescript-eslint/no-explicit-any": "off",
    },
  },
];