{"id":19991,"library":"eslint-prettier-next-15","title":"ESLint + Prettier Setup for Next.js 15","description":"eslint-prettier-next-15 (v0.1.11) is an automated CLI tool that configures ESLint (v9) and Prettier (v3) for Next.js 15 projects. It detects the package manager (npm, yarn, pnpm, or bun), removes old configurations, installs recommended dependencies (including @typescript-eslint, eslint-config-next, prettier plugins for import sorting and JSON formatting), and generates flat ESLint config and .prettierrc files. Designed for fresh or existing Next.js 15 apps, it enforces consistent code quality rules with zero manual setup. Updated irregularly; relies on flat config (eslint.config.mjs) and ESM-only imports.","status":"active","version":"0.1.11","language":"javascript","source_language":"en","source_url":"https://https://github.com/danielalves96/eslint-prettier-next-15","tags":["javascript","eslint","prettier","nextjs"],"install":[{"cmd":"npm install eslint-prettier-next-15","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-prettier-next-15","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-prettier-next-15","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is meant to be executed via npx, not installed globally.","wrong":"npm install -g eslint-prettier-next-15 && eslint-prettier-next-15","symbol":"CLI usage","correct":"npx eslint-prettier-next-15"},{"note":"This tool generates the modern ESLint flat config format. Legacy .eslintrc files are not compatible with ESLint v9.","wrong":".eslintrc.json or .eslintrc.js","symbol":"eslint.config.mjs","correct":"eslint.config.mjs (flat config file generated by script)"},{"note":"The generated config uses JSON format. Prettier also supports JS/TOML, but JSON is created here.","wrong":"prettier.config.js or .prettierrc.js","symbol":".prettierrc.json","correct":".prettierrc.json (JSON with plugins array)"}],"quickstart":{"code":"mkdir my-next-app && cd my-next-app\nnpx create-next-app@15 . --typescript --eslint=false --src-dir --app --import-alias '@/*' --no-tailwind\necho 'y' | npx eslint-prettier-next-15\nnpx eslint . --ext .ts,.tsx 2>/dev/null | head -5 || echo \"No lint errors\"\nnpx prettier --check \"app/**/*.ts\" 2>/dev/null | head -5 || echo \"All files formatted\"","lang":"bash","description":"Creates a fresh Next.js 15 app, runs the setup script, then validates linting and formatting."},"warnings":[{"fix":"Manually backup your configuration files before running the script, or reapply them after setup.","message":"This script deletes existing ESLint and Prettier configuration files (.eslintrc.*, .prettierrc, .editorconfig, .vscode/settings.json) without backup.","severity":"breaking","affected_versions":"<=0.1.11"},{"fix":"After running the script, update eslint-config-next to the latest version manually: npm install eslint-config-next@latest --save-dev","message":"The script installs eslint-config-next@15.1.4 which is pinned; it may become outdated as Next.js updates its ESLint config.","severity":"deprecated","affected_versions":"0.1.11"},{"fix":"Ensure you are in the root directory of your Next.js 15 project before executing the command.","message":"Script expected to be run in a Next.js 15 project root. Running elsewhere will create config files in wrong directory.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Verify that eslint and eslint-config-next are installed and compatible.","message":"The generated eslint.config.mjs uses FlatCompat to extend 'next' and 'next/core-web-vitals'. This may not work if ESLint is not v9 or if next/core-web-vitals is not installed.","severity":"gotcha","affected_versions":"0.1.11"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run the command in a Next.js 15 project root after installing dependencies.","cause":"The script is run in a directory that is not a Next.js project or lacks node_modules.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'next'"},{"fix":"Upgrade Node.js to v18 or later, or ensure \"type\": \"module\" is in package.json.","cause":"Using an outdated Node.js version (<18) that does not support ES modules or top-level await.","error":"SyntaxError: Unexpected token 'export' (at eslint.config.mjs:1:1)"},{"fix":"Delete node_modules and package-lock.json, then run npm install again, or run the script again.","cause":"Script dependencies were not fully installed due to network issue or failed npm install.","error":"Error: Cannot find module '@eslint/eslintrc'"},{"fix":"Add 'eslint-plugin-import' to the plugins and extend 'plugin:import/errors' or disable the rule.","cause":"The generated config does not include eslint-plugin-import, but the eslint:recommended rule may report this.","error":"eslint: 'import' is not defined (no-undef)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}