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

Run lint/prettier after generating files #316

Open
mi5ha opened this issue Jun 14, 2019 · 4 comments
Open

Run lint/prettier after generating files #316

mi5ha opened this issue Jun 14, 2019 · 4 comments

Comments

@mi5ha
Copy link

mi5ha commented Jun 14, 2019

Hi there,

How can I tell generators to generate files with 4 spaces?

Thank you,
Misha

@kamilmysliwiec kamilmysliwiec transferred this issue from nestjs/nest Jun 16, 2019
@martinsotirov
Copy link

martinsotirov commented Jul 1, 2019

I'm interested in configuring the generate output too but in order to disable the semicolons. I like the two space indentation.

It would be awesome if the CLI were aware of the tslint / eslint conf file.

As a temporary workaround I'm appending this to all my generate commands to achieve a similar result:

nest generate controller foo | awk '{print $2}' | sed 's/\///' | xargs node_modules/tslint/bin/tslint --fix

@lkostrowski
Copy link

I think its too complex to adjust generator to obey everyone's code styles. Better pipe it through Prettier and thats it

@MoncefME
Copy link

is it possible after running a nest cli command like $ nest g controller [name] to also run npm run lint -- --fix because when I create a new files using the command I got this error , that error will go away after doing the lint command
image
image
is there any solution for this ?
I tried many solutions on-stackoverflow , nothing seems to work for now

@MuhammadPutraAge
Copy link

MuhammadPutraAge commented Nov 12, 2024

While we wait for generator to be able to run lint after generating files, i was able to fix this eslint error by adding this rule (last line) to my .eslintrc.js, at least it's not showing error every time generate new file 😄

Screenshot 2024-11-12 225522

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

6 participants