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

should .eslintrc.json in a library project include the list of presets? #251

Open
gregveres opened this issue May 17, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@gregveres
Copy link
Contributor

Description

I have been using Nx-plus/vue for a couple of weeks now. Due to wanting so much of my app to dynamic load via the router, I now have ~50 library projects and I expect it to grow considerably.
I am finding that every time I create a new library project, I have to edit the .eslintrc.json file to modify the first line:

  "extends": ["../../../../../../../.eslintrc.json", "plugin:vue/essential", "@vue/typescript/recommended", "prettier"],

I remove the presets so that it reads:

  "extends": ["../../../../../../../.eslintrc.json"],

The reason I do that is because I have those presets loaded in my root level .eslintrc.json file, along with a number of overrides for different file types. When I leave these presets in the library level config file, then all of the root level overrides get thrown out because the re-inclusion of the presets override my overrides.

I can continue to remove the presets from the library file each time I create a library, but it is getting tedious. I was wondering if there was a reason why you include these at the library level.

Motivation

to cut down the number of steps that I have to take each time I create a library project.

Suggested Implementation

just output the extends line with the reference to the root level .eslintrc.json file.

Alternate Implementations

some sort of elaborate configuration of defaults so that each project can tweak exactly which files will be created when they run the generator.

@gregveres gregveres added the enhancement New feature or request label May 17, 2022
@ZachJW34
Copy link
Owner

This is a fairly common convention for Nx. Since it can support multiple frameworks at the same time, the root eslintrc.json should not have framework-specific overrides. You could create a custom generator that invokes @nx-plus/vue:lib and deletes those additions, that way you wouldn't have to manually add them.

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

No branches or pull requests

2 participants