jsonlint icon indicating copy to clipboard operation
jsonlint copied to clipboard

Windows line endings are changed to Unix line endings

Open petsuter opened this issue 9 years ago • 2 comments

jsonlint -i changes all Windows line endings (CRLF) to Unix line endings (LF).

Would be nice if it would instead preserve the line endings.

petsuter avatar Feb 04 '16 09:02 petsuter

Yes, it could be a nice feature.

However, producing an output with LFs only should not break any parser. JSON parsers on any platform have to accept input, which uses only LF for line breaks according to the specification. Although the operating-system-default line break is represented by CRLF on the particular platform.

prantlf avatar May 19 '19 04:05 prantlf

Sure it doesn't break anything directly. However when not all files in a project use the same style e.g. copying lines from one file to another can easily lead to mixed line endings, annoying warnings and chaos and confusion in general, so this is best avoided, and using a LINT tool that introduces more such problems than it helps catch seems pointless. ;)

petsuter avatar May 19 '19 07:05 petsuter