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

EsLint module Layers support #399

Closed
2 of 4 tasks
Dominic-Marcelino opened this issue Apr 19, 2024 · 5 comments
Closed
2 of 4 tasks

EsLint module Layers support #399

Dominic-Marcelino opened this issue Apr 19, 2024 · 5 comments

Comments

@Dominic-Marcelino
Copy link

Describe the feature

In order to improve the DX on extending projects it would be great, if the new eslint-module would read the extending layers eslint.config.mjs config and merge it with the own layers config.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@antfu
Copy link
Member

antfu commented Apr 20, 2024

It already does - if anything missing, please provide a minimal reproduction

@Dominic-Marcelino
Copy link
Author

I've recreated a reproduction repo: https://stackblitz.com/edit/nuxt-starter-ofcsfa (same repo as #406 )

It doesn't seem to work for me. I've added the rule no-trailing-spaces to layer1 but it doesn't get included on Nuxt-app.

(I know the rule is deprecated and needs to be updated to @stylistic/no-trailing-spaces, but for testing I even tried with the basic one)

@antfu
Copy link
Member

antfu commented Apr 25, 2024

It downs to eslint - that usually assumes you only have one eslint config in our project root.

In that case, I'd suggest you give a try of using extend from https://github.com/antfu/eslint-flat-config-utils#extend and create a root eslint-config to proxy those configs of the subdirectory. This shouldn't be in Nuxt's scope.

@antfu antfu closed this as completed Apr 25, 2024
@Dominic-Marcelino
Copy link
Author

In that case, I'd suggest you give a try of using extend from https://github.com/antfu/eslint-flat-config-utils#extend and create a root eslint-config to proxy those configs of the subdirectory. This shouldn't be in Nuxt's scope.

Thanks, really appreciate. I'll have a look into it!

@abdul-alhasany
Copy link

@antfu

I am builidng a component library and adding such feature would help the end users integrate the library's eslint config without an extra step.
Maybe users can opt-in/out using a module option.
I think the expectation is that this functionality would be the same as extending nuxt.config (at least that is why I assumed when reading the module supports layers).

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

No branches or pull requests

3 participants