You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*eslint-disable*/varexpress=require('express');varmulter=require('multer');varfs=require('fs');varcors=require("cors");varcrypto=require("crypto");varmime=require("mime");varpath=require('path');varapp=express();varDIR='./uploads/';varstorage=multer.diskStorage({destination: function(req,file,cb){cb(null,DIR)},filename: function(req,file,cb){crypto.pseudoRandomBytes(16,function(err,raw){cb(null,raw.toString('hex')+Date.now()+'.'+file.originalname);});}});varupload=multer({storage: storage});app.use(cors({credentials: true,origin: 'http://localhost:8080'}));app.options('/api');// enable pre-flight request for DELETE requestapp.get('/api',function(req,res){res.end('file catcher example');});app.post('/api',upload.any(),function(req,res,next){// req.body contains the text fieldsres.end('file uploaded');});varPORT=process.env.PORT||3000;app.listen(PORT,function(){console.log('Working on port '+PORT);});
/*eslint-disable*/varexpress=require('express');varmulter=require('multer');varfs=require('fs');varcors=require("cors");varcrypto=require("crypto");varmime=require("mime");varpath=require('path');varapp=express();varDIR='./uploads/';varstorage=multer.diskStorage({destination: function(req,file,cb){cb(null,DIR)},filename: function(req,file,cb){crypto.pseudoRandomBytes(16,function(err,raw){cb(null,raw.toString('hex')+Date.now()+'.'+file.originalname);});}});varupload=multer({storage: storage});app.use(cors({credentials: true,origin: 'http://localhost:8080'}));app.options('/api');// enable pre-flight request for DELETE requestapp.get('/api',function(req,res){res.end('file catcher example');});app.post('/api',upload.any(),function(req,res,next){// req.body contains the text fieldsres.end('file uploaded');});varPORT=process.env.PORT||3000;app.listen(PORT,function(){console.log('Working on port '+PORT);});
Original vs. Beautified Diff:
Index: C:\work\upload-demo\api\file-catcher.js===================================================================---C:\work\upload-demo\api\file-catcher.jsoriginal+++C:\work\upload-demo\api\file-catcher.jsbeautified
@@ -1,48+1,48 @@
-/*eslint-disable*/-varexpress=require('express');-varmulter=require('multer');-varfs=require('fs');-varcors=require("cors");-varcrypto=require("crypto");-varmime=require("mime");-varpath=require('path');--varapp=express();--varDIR='./uploads/';--varstorage=multer.diskStorage({-destination: function(req,file,cb){-cb(null,DIR)-},-filename: function(req,file,cb){-crypto.pseudoRandomBytes(16,function(err,raw){-cb(null,raw.toString('hex')+Date.now()+'.'+file.originalname);-});-}-});--varupload=multer({-storage: storage-});--app.use(cors({-credentials: true,-origin: 'http://localhost:8080'-}));--app.options('/api');// enable pre-flight request for DELETE request-app.get('/api',function(req,res){-res.end('file catcher example');-});--app.post('/api',upload.any(),function(req,res,next){-// req.body contains the text fields-res.end('file uploaded');-});--varPORT=process.env.PORT||3000;--app.listen(PORT,function(){-console.log('Working on port '+PORT);-});+/*eslint-disable*/+varexpress=require('express');+varmulter=require('multer');+varfs=require('fs');+varcors=require("cors");+varcrypto=require("crypto");+varmime=require("mime");+varpath=require('path');++varapp=express();++varDIR='./uploads/';++varstorage=multer.diskStorage({+destination: function(req,file,cb){+cb(null,DIR)+},+filename: function(req,file,cb){+crypto.pseudoRandomBytes(16,function(err,raw){+cb(null,raw.toString('hex')+Date.now()+'.'+file.originalname);+});+}+});++varupload=multer({+storage: storage+});++app.use(cors({+credentials: true,+origin: 'http://localhost:8080'+}));++app.options('/api');// enable pre-flight request for DELETE request+app.get('/api',function(req,res){+res.end('file catcher example');+});++app.post('/api',upload.any(),function(req,res,next){+// req.body contains the text fields+res.end('file uploaded');+});++varPORT=process.env.PORT||3000;++app.listen(PORT,function(){+console.log('Working on port '+PORT);+});
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 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
{ "_default": {} }
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
The text was updated successfully, but these errors were encountered: