This folder is a reusable baseline for adding ESLint and Prettier to an existing Nuxt 3 or Nuxt 4 project.
Install the required packages:
npm install --save-dev @nuxt/eslint eslint eslint-config-prettier prettierEquivalent package manager commands:
pnpm add -D @nuxt/eslint eslint eslint-config-prettier prettieryarn add --dev @nuxt/eslint eslint eslint-config-prettier prettierAdd @nuxt/eslint to the existing modules array in nuxt.config.ts:
export default defineNuxtConfig({
modules: [
'@nuxt/eslint'
]
})Add it to the project’s existing modules array rather than replacing the current modules.
Merge these entries into the existing scripts object in package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier . --write",
"format:check": "prettier . --check"
}
}Copy these files to the project root:
eslint.config.mjs
.prettierrc
.prettierignore
This template intentionally reports the initial lint backlog as warnings so that adoption is non-blocking. Teams can progressively promote important rules to errors over time. Repository-wide lint:fix or format should not be run blindly on a large existing application; formatting and lint cleanup should be reviewed in controlled, scoped changes.
Run these manually after installation:
npm install
npm run lint
npm run format:check