nuxt / eslint

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

Problem with Nuxt Playground linting #501

Closed GaborTorma closed 21 minutes ago

GaborTorma commented 2 months ago

Environment


Base repo from nuxt layer template with the following command: npx nuxi init --template layer nuxt-layer

Package

@nuxt/eslint

Reproduction

https://stackblitz.com/~/github.com/GaborTorma/nuxt-eslint-playground-error

You need to see on the console. Lint automatically runs.

Describe the bug

1. vue/multi-word-component-name rule

Default this off on nuxt pages and layers folder, but it not working in .playground folder.

pages/index.vue has no error, but the same file in playground (.playground/pages/index.vue) has error.

2. vue/no-multiple-template-root rule

Default this is error on nuxt pages and layers folder, but it not working in .playground folder.

pages/multiple-template-root.vue has error, but the same file in playground (.playground/pages/multiple-template-root.vue) has no error.

Additional context

The problem is the nuxt/disables/routes and nuxt/vue/single-root use a generated files path instead of using a general glob path. 2024-09-21_13-23-01 The right one is the following: 2024-09-21_13-24-49

Logs

2024-09-21_13-27-51

mrleblanc101 commented 12 hours ago

I have the same issue although I use the v4-compat template for my Nuxt app, so I had to modify the layers structure a bit. So I think .playground/pages/**/* and .playground/app/pages/**/* should be included, or maybe there is nothing to be done if this use the new <rootDir> and <srcDir> structure from Nuxt 4. Image

antfu commented 21 minutes ago

You can fix it by applying this change: https://github.com/nuxt/starter/commit/9bddae690a91b852c078f1b2cb328af1b57d60b2 with the upgraded v0.7.2 of @nuxt/eslint