Better enforce LF

More consistently maintain this line break.

As is known, we are using the LF line break to keep Nest's pattern when generating new files. However, if the project is also present in a code repository and you are on Windows, when pulling the code you will get the CRLF line break once again. This will force you to have to run the command yarn format when this occurs. This can quickly become very bothersome.

This happens because the default behavior of Git is to convert whatever line break to LF when pushing to the repository, and then when pulling, it will depend on the OS (Windows: CRLF | Linux/Mac: LF). To maintain the push behavior (always send as LF) but pull without altering the line break (always receive as LF), the following command can be executed

git config core.autocrlf input

The ideal approach would be to use CRLF on Windows, but Nest always creates its schematics with LF. If there is intention to maintain CRLF, there will be the need to format whenever generating a Nest schematic. It is left to the reader's decision. This complementary read better explores this topic.

Last updated