Nest-cli: Run lint/prettier after generating files

Created on 14 Jun 2019  路  2Comments  路  Source: nestjs/nest-cli

Hi there,

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

Thank you,
Misha

PRs open feature

Most helpful comment

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

All 2 comments

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

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

Was this page helpful?
0 / 5 - 0 ratings