Request for support on failOnError Overlay when applying nuxt/eslint
Describe the feature
I would like to apply nuxt/eslint so that if there are any issues with the code, the compilation does not proceed and an error is displayed in the browser. I have configured it as defined in the nuxt/eslint documentation, but despite the IDE and devServer detecting errors, the compilation proceeds normally and no error screen is displayed in the browser.
The code I have configured is as follows.
// eslint.config.mjs
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt(
// Your custom configs here
{
rules: {
'no-unused-vars': 'error'
},
files: ['**/*.js', '**/*.vue']
}
)
// nuxt.config.ts
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ['@nuxt/eslint'],
eslint: {
checker: true
}
})
If I intentionally cause an error as shown below, the IDE and devServer detect it properly.
However, despite this, the compilation does not stop, and no error screen is displayed in the browser.
I would like the eslint errors to be reflected in the screenshot below.
Additional information
- [X] Would you be willing to help implement this feature?
- [X] Could this feature be implemented as a module?
Final checks
- [X] Read the contribution guide.
- [X] Check existing discussions and issues.
have you installed vite-plugin-eslint2 as mentioned in thedocs?
have you installed
vite-plugin-eslint2as mentioned in thedocs?
Yes, I installed vite-plugin-eslint2 as mentioned in the documentation.
// package.json
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"lint": "eslint .",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/eslint": "^0.3.13",
"nuxt": "^3.12.2"
},
"devDependencies": {
"eslint": "^8.57.0",
"vite-plugin-checker": "^0.6.4",
**"vite-plugin-eslint2": "^4.4.0"**
}
}
This feature is delegated to vite-plugin-eslint2 - if it doesn't work that way already, I'd suggest you open a request to their repo instead. Thanks!