nuxt / eslint

Collection of ESLint-related packages for Nuxt
https://eslint.nuxt.com
MIT License
514 stars 65 forks source link

Request for support on failOnError Overlay when applying nuxt/eslint #460

Open kim1124 opened 4 days ago

kim1124 commented 4 days ago

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.

image

However, despite this, the compilation does not stop, and no error screen is displayed in the browser.

스크린샷 2024-06-27 오전 11 18 24

I would like the eslint errors to be reflected in the screenshot below.

스크린샷 2024-06-27 오전 11 20 56

Additional information

Final checks

dsvgl commented 4 days ago

have you installed vite-plugin-eslint2 as mentioned in thedocs?

kim1124 commented 1 day ago

have you installed vite-plugin-eslint2 as 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"**
  }
}