#Problems to create a projetct with nestJS
15 messages · Page 1 of 1 (latest)
Nest uses the carriage return newline character during creation. That error comes from eslint (and specifically eslint prettier). It's not an error, at least not one that will stop your application from running, and using prettier should fix it right up
but how can I fix it?
eslint --fix in the terminal
Update the prettier config to expect a different newline. And eslint --fix as whitedog said
IMO, the choice of EOL of files created with the CLI could be an option somehow.
to be fair, I'm pretty sure the functionality comes from higher up the chain as Nest uses angular schematics for generating the files. But there is this about running eslint --fix and prettier after file generation
https://github.com/nestjs/nest-cli/issues/2891
i go try
thanks
Yup, I think I already read this one.
Not a big problem, I'm not constantly creating new files in my projects.
Giving a eslint --fix each time does the trick.
I even heard of an option in VSCode, that automatically format files when you save them.
Downed to version 10
and add
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'prettier/prettier': ['error', { endOfLine: 'auto'}]
},```
and fix
just exclude prettier rules in .eslint