nestjs / nest-cli

CLI tool for Nest applications 🍹
https://nestjs.com
Other
1.94k stars 388 forks source link

Run lint/prettier after generating files #316

Open mi5ha opened 5 years ago

mi5ha commented 5 years ago

Hi there,

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

Thank you, Misha

martinsotirov commented 5 years ago

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 commented 5 years ago

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

MoncefME commented 3 months ago

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