#Problems to create a projetct with nestJS

15 messages · Page 1 of 1 (latest)

bright wagon
#

Hi Peoples

i start create a new project in nest

usign

nest new <project-name>

but, in hour the open a project with

code <project-name>

this return this error in all project

Delete `␍`

i use windows to new project

polar oxide
#

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

bright wagon
#

but how can I fix it?

frail topaz
#

eslint --fix in the terminal

polar oxide
#

Update the prettier config to expect a different newline. And eslint --fix as whitedog said

frail topaz
#

IMO, the choice of EOL of files created with the CLI could be an option somehow.

polar oxide
#

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

GitHub

Is there an existing issue for this? I have searched the existing issues Current behavior I have Git configured to use LF line endings. In global .gitconfig I have autocrlf = input and eol = lf. I ...

frail topaz
#

I even heard of an option in VSCode, that automatically format files when you save them.

bright wagon
#

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

serene scroll
#

just exclude prettier rules in .eslint