Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken formatting on UMD files #13

Open
coderaiser opened this issue Jan 16, 2019 · 1 comment
Open

Broken formatting on UMD files #13

coderaiser opened this issue Jan 16, 2019 · 1 comment

Comments

@coderaiser
Copy link

I have example.js:

const fs = require('fs');
const indent = require('indent.js');

const data = fs.readFileSync('./index.js', 'utf8');
console.log(data);
console.log(indent.js(data, {tabString: 4}));             

When I run it, I see:

(function(mod) {
    'use strict';

    if (typeof exports === 'object' && typeof module === 'object') // CommonJS
        mod(require('../../lib/codemirror'));
    else if (typeof define === 'function' && define.amd) // AMD
        define(['../../lib/codemirror'], mod);
    else // Plain browser env
        mod(CodeMirror);
})(function(CodeMirror) {
});


(function(mod) {
    'use strict';

    if (typeof exports === 'object' && typeof module === 'object') // CommonJS
    mod(require('../../lib/codemirror'));
    else if (typeof define === 'function' && define.amd) // AMD
    define(['../../lib/codemirror'], mod);
    else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
    });

Would be great to have ability not add windows line endings:
screen shot 2019-01-16 at 6 05 51 pm

@coderaiser
Copy link
Author

Here is possible solution align-spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant