Registry / web-framework / eslint-config-next

eslint-config-next

JSON →
library16.2.4jsnpmunverified

ESLint configuration package published by Vercel as part of Next.js, providing a curated set of rules for Next.js projects. Current stable version is 16.2.4, with canary releases in parallel. It integrates with the Next.js compiler, includes TypeScript and React-specific rules, and is updated frequently alongside Next.js releases. Enforces best practices for App Router, Pages Router, image optimization, and data fetching. Requires eslint >=9.0.0 and typescript >=3.3.1 as peer dependencies. Differentiators include automatic detection of Next.js configuration and seamless integration with Next.js toolchain.

npm install eslint-config-next
INSTALL
IMPORT
SIG · ESLINT-CONFIG-NEXT
E
eslint-config-next
web-frameworkjavascriptv16.2.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import nextEslintConfig from 'eslint-config-next'
const nextEslintConfig = require('eslint-config-next')
ESM-only since v16. Use import syntax with flat config.
next/core-web-vitals
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'
const nextCoreWebVitals = require('eslint-config-next/core-web-vitals')
ESM-only; use import for flat config.
next/typescript
import nextTypescript from 'eslint-config-next/typescript'
ESM-only; standalone TypeScript config for flat config.

Shows how to use eslint-config-next with flat config in an eslint.config.mjs file, including core-web-vitals preset.

// eslint.config.mjs import nextConfig from 'eslint-config-next'; import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'; export default [ nextConfig, nextCoreWebVitals, { rules: { // your custom rules } } ];
Debug
Known issues
breakingeslint-config-next v16 drops support for legacy eslintrc format. Flat config only.
fix
Migrate to flat config (eslint.config.js or mjs).
affects: >=16.0.0
breakingMinimum eslint peer dependency increased to 9.0.0 in v16.
fix
Update eslint to >=9.0.0.
affects: >=16.0.0
deprecatedImport from 'eslint-config-next/parser' is deprecated; use 'next' config directly.
fix
Remove /parser import; import default config.
affects: >=16.0.0
gotchaIf using TypeScript, you must install typescript as a peer dependency even if not using TypeScript yourself.
fix
npm install typescript --save-dev
affects: all
gotchaRules may conflict with other ESLint plugins like eslint-plugin-react or eslint-plugin-import. Disable conflicting rules.
fix
Override specific rules in your config.
affects: all
Errors
Common errors & fixes
Error: Failed to load config "next/core-web-vitals" to extend from.
Using legacy eslintrc format; v16 only supports flat config.
fix
Switch to flat config: use `import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'`.
Error: ESLint configuration in eslintrc format is not supported.
eslint-config-next v16 requires flat config.
fix
Create eslint.config.mjs or eslint.config.js with flat config.
Cannot find module 'typescript'
Missing peer dependency typescript.
fix
npm install typescript --save-dev
Parsing error: Cannot read file 'tsconfig.json'
TypeScript project not configured or tsconfig.json missing.
fix
Ensure tsconfig.json exists and is valid, or set project: null in config.
Upgrade
Version history
16.2.4latest on npm
Audit
Dependencies
eslintoptionalpeer dependency; config requires eslint >=9.0.0 to function
typescriptoptionalpeer dependency; required for TypeScript rule support if used
Agent activity
22 hits · last 30 days
node
22
Resources
eslint-config-next — npm install eslint-config-next · libregistry