Git should always check out every text file with LF. This needs to be ensured on a project level, so that environment specific settings do not interfere.
.gitattributes
* text=auto eol=lf
Our editor should always insert LF as a new line.
.editorconfig
[*]
end_of_line = lf
Use proper tooling / API-s which provide the option to set proper line endings to generated sources, so that the process should not cause any issues for non-ignored generated files.
E.g.: Prettier options
{
endOfLine: 'lf',
}