Closed t246246 closed 8 years ago
Having a similar issue on only JSX files (i.e using prettydiff) converts from CRLF to LF.
I tried with atom 1.9-beta0 but nothing changed.
Now I changed formatter to prettydiff suggested here that solved my problem. Thank you for your help.
However, I'm still curious if it is a problem of js-beaufify -- when I use formatter and atom-formatter-jsbeautify for JavaScript instead, eol stays LF as expected, although atom-formatter-jsbeautify uses js-beaufify...
Pretty Diff is not aware of the OS running it and so uses an option to determine the eol sequence. http://prettydiff.com/documentation.xhtml#crlf
I don't remember how JS Beautify does it, but JS Beautify does have a means of supporting CRLF instead of just LF.
Is there a better way to set options than adding a comment at the top of every jsx file? Does .prettydiffrc work with atom-beautify?
Pretty Diff does have a .prettydiffrc file which is not used in Atom Beautify, but Atom Beautify uses the .jsbeautify file for multiple beautifiers including Pretty Diff.
Description
eol character is changed to CRLF even though setting is LF on Windows. I already checked #707
Expected Results
eol is kept as LF.
Steps to Reproduce
set
in .editorconfig and set
in .jsbeautifyrc.
restart atom and open any JacaScript/JSON/html file EOL character of which is LF with atom and call atom-beautify.
Debug
Atom Beautify - Debugging information
The following debugging information was generated by
Atom Beautify
onThu Jun 09 2016 09:26:43 GMT+0900
.Table Of Contents
Platform: win32
Versions
Atom Version: 1.8.0-beta4
Atom Beautify Version: 0.29.7
Original file to be beautified
Original File Path:
C:\work\upload-demo\api\file-catcher.js
Original File Grammar: JavaScript
Original File Language: JavaScript
Language namespace: js
Supported Beautifiers: JS Beautify, JSCS Fixer, Pretty Diff
Selected Beautifier: JS Beautify
Original File Contents
Package Settings
The raw package settings options
Beautification options
Editor Options: Options from Atom Editor settings
Config Options: Options from Atom Beautify package settings
Home Options: Options from
C:\.jsbeautifyrc
EditorConfig Options: Options from EditorConfig file
Project Options: Options from
.jsbeautifyrc
files starting from directoryC:\work\upload-demo\api
and going up to rootPre-Transformed Options: Combined options before transforming them given a beautifier's specifications
Final Options
Final combined and transformed options that are used
Results
Beautified File Contents:
Original vs. Beautified Diff:
Logs