Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors are repeated #111

Open
tflx opened this issue Sep 20, 2023 · 8 comments
Open

Errors are repeated #111

tflx opened this issue Sep 20, 2023 · 8 comments

Comments

@tflx
Copy link

tflx commented Sep 20, 2023

I'm getting a huge output from eslint with every error repeated a number of times. It shows fx. ✖ 61 problems (61 errors, 0 warnings) (repeated 42 times)
It's not always the same amount of repeats though.

I can reproduce it here with a very simple nuxt starter:
https://stackblitz.com/edit/nuxt-starter-aepdun?file=package.json,nuxt.config.ts,.eslintrc,app.vue

Notice the line 3:5 error Component name "NuxtWelcome" is not kebab-case vue/component-name-in-template-casing is output twice.
Now imagine that in a big project with hundreds of files.

@robertpatrick
Copy link

robertpatrick commented Sep 27, 2023

@ricardogobbosouza We are seeing the same issue. While this also happens in earlier versions of Nuxt (e.g., 3.7.1), it is less noticable due to the way output is being written to the terminal (i.e., the multiple errors do not cause the text in the terminal to scroll) than it is in 3.7.2 and newer. Is it possible to get a fix for this issue?

@djixadin
Copy link

a big problem. especially with big projects. i tried to set lintOnStart to false to reduce the amount of repeating errors but it didn't do anything

@swunderlich
Copy link

Same problem here.

    "nuxt": "3.8.0",
    "@nuxtjs/eslint-module": "4.1.0",

@andrejp6k
Copy link

I was able to disable it directly in the module section but not in a dedicated section for eslint.

My current config:

  modules: [
    // https://nuxt.com/modules/eslint
    ['@nuxtjs/eslint-module', { cache: false, lintOnStart: false }],
  ],

@robertpatrick
Copy link

robertpatrick commented Nov 3, 2023

@andrejp6k That's sort of beside the point. Yes, it is possible to prevent lint from running at startup but the point of this issue is that we want to run lint on startup but only have it print each error once at the end of the scan versus printing the errors multiple times.

@robertpatrick
Copy link

@andrejp6k Sorry, seeing your config made me focus on the lintOnStartup: false when in fact, setting cache: false does seem to eliminate this behavior. It works in a dedicated eslint section as well:

  modules:  [
    '@nuxt/devtools',
    '@nuxtjs/eslint-module',
    '@nuxtjs/i18n',
    '@pinia/nuxt',
    '@vueuse/nuxt',
    'dayjs-nuxt',
  ],
  ...
  eslint: {
    cache:   false,
    exclude: [
      '.nuxt',
      '.output',
    ]
  },

@andrejp6k
Copy link

@robertpatrick I've noticed a comment that setting lintOnStartup: false does not help. So I shared my temporal solution.
It was not meant to be a solution for this issue.

@hs-wolf
Copy link

hs-wolf commented Jan 10, 2024

@andrejp6k Sorry, seeing your config made me focus on the lintOnStartup: false when in fact, setting cache: false does seem to eliminate this behavior. It works in a dedicated eslint section as well:

  modules:  [
    '@nuxt/devtools',
    '@nuxtjs/eslint-module',
    '@nuxtjs/i18n',
    '@pinia/nuxt',
    '@vueuse/nuxt',
    'dayjs-nuxt',
  ],
  ...
  eslint: {
    cache:   false,
    exclude: [
      '.nuxt',
      '.output',
    ]
  },

Unrelated to the problem at hand, I noticed your exclude property excluding .nuxt and .output, is there a reason for that?

By the documentation It seems that the default including glob goes like this [nuxt.options.srcDir.'/**/*.{js,jsx,ts,tsx,vue}']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants