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

Automatically run ESLint when generating components #1447

Closed
1 task done
scriptcoded opened this issue Dec 10, 2021 · 1 comment
Closed
1 task done

Automatically run ESLint when generating components #1447

scriptcoded opened this issue Dec 10, 2021 · 1 comment
Labels

Comments

@scriptcoded
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

When generating new components in a Nest project the generated files don't necessarily comply to the ESLint rule set. For example we use import/order to ensure that imports are always ordered the same in every file.

Describe the solution you'd like

This is just an idea, and I don't have the experience in this code base to judge the size of the task or if it's feasible.

When generating Nest components the CLI could automatically call ESLint, provided that it's installed in the project, and auto fix the files. Most linting issues can be resolved automatically using the ESLint binary or it's Node API.

Teachability, documentation, adoption, migration strategy

This would be a feature that's enabled by default and runs seamlessly in the background. There should probably be a configuration option and flag to disable this functionality.

What is the motivation / use case for changing the behavior?

Adding this feature would mean that files generated by the CLI will be compliant to the ESLint configuration in the project.

Personally I generate a bunch of components at once and work my way through them one by one. If the project I'm working on happens to have the linter run on commit I wouldn't be able to commit my work until I'd manually fixed every generated file. Having Nest do this for you would not only solve this issue, but also make the Nest CLI feel more integrated with the project.

@kamilmysliwiec
Copy link
Member

#316

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

No branches or pull requests

2 participants