{"id":19548,"library":"eslint-config-next","title":"eslint-config-next","description":"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.","status":"active","version":"16.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/vercel/next.js","tags":["javascript"],"install":[{"cmd":"npm install eslint-config-next","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-next","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-next","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; config requires eslint >=9.0.0 to function","package":"eslint","optional":true},{"reason":"peer dependency; required for TypeScript rule support if used","package":"typescript","optional":true}],"imports":[{"note":"ESM-only since v16. Use import syntax with flat config.","wrong":"const nextEslintConfig = require('eslint-config-next')","symbol":"default","correct":"import nextEslintConfig from 'eslint-config-next'"},{"note":"ESM-only; use import for flat config.","wrong":"const nextCoreWebVitals = require('eslint-config-next/core-web-vitals')","symbol":"next/core-web-vitals","correct":"import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'"},{"note":"ESM-only; standalone TypeScript config for flat config.","wrong":null,"symbol":"next/typescript","correct":"import nextTypescript from 'eslint-config-next/typescript'"}],"quickstart":{"code":"// eslint.config.mjs\nimport nextConfig from 'eslint-config-next';\nimport nextCoreWebVitals from 'eslint-config-next/core-web-vitals';\n\nexport default [\n  nextConfig,\n  nextCoreWebVitals,\n  {\n    rules: {\n      // your custom rules\n    }\n  }\n];\n","lang":"javascript","description":"Shows how to use eslint-config-next with flat config in an eslint.config.mjs file, including core-web-vitals preset."},"warnings":[{"fix":"Migrate to flat config (eslint.config.js or mjs).","message":"eslint-config-next v16 drops support for legacy eslintrc format. Flat config only.","severity":"breaking","affected_versions":">=16.0.0"},{"fix":"Update eslint to >=9.0.0.","message":"Minimum eslint peer dependency increased to 9.0.0 in v16.","severity":"breaking","affected_versions":">=16.0.0"},{"fix":"Remove /parser import; import default config.","message":"Import from 'eslint-config-next/parser' is deprecated; use 'next' config directly.","severity":"deprecated","affected_versions":">=16.0.0"},{"fix":"npm install typescript --save-dev","message":"If using TypeScript, you must install typescript as a peer dependency even if not using TypeScript yourself.","severity":"gotcha","affected_versions":"all"},{"fix":"Override specific rules in your config.","message":"Rules may conflict with other ESLint plugins like eslint-plugin-react or eslint-plugin-import. Disable conflicting rules.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Switch to flat config: use `import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'`.","cause":"Using legacy eslintrc format; v16 only supports flat config.","error":"Error: Failed to load config \"next/core-web-vitals\" to extend from."},{"fix":"Create eslint.config.mjs or eslint.config.js with flat config.","cause":"eslint-config-next v16 requires flat config.","error":"Error: ESLint configuration in eslintrc format is not supported."},{"fix":"npm install typescript --save-dev","cause":"Missing peer dependency typescript.","error":"Cannot find module 'typescript'"},{"fix":"Ensure tsconfig.json exists and is valid, or set project: null in config.","cause":"TypeScript project not configured or tsconfig.json missing.","error":"Parsing error: Cannot read file 'tsconfig.json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}