Newline inserted after ES6 module import/export
See original GitHub issueHey,
I’m running jsbeautifier on a collection of Ember.JS ES6 modules and I’ve noticed a small issue with export statements.
Suppose I have a module that exports as below
export default DS.FixtureAdapter.extend();
jsbeautifier will add a newline after export
export
default DS.FixtureAdapter.extend();
It’s a minor problem that is only an issue for us as we enforce a jsbeautifier run before a commit is accepted. So, if a developer removes the newline, the file in question will be included in the commit even though it may have nothing to do with the changes being commited.
Issue Analytics
- State:
- Created 10 years ago
- Comments:54 (14 by maintainers)
Top Results From Across the Web
How to break long import statements into multiple lines in ...
Yes, the ES6 spec does allow whitespace - which includes newlines - between every token (unless otherwise restricted).
Read more >typescript import newline with single import
I see a similar setting in webstorm: "ES6 import/export". The problem is when I set this to "wrap always" it only wraps import...
Read more >Appendix B: ES6 - Fullstack React
This appendix is a non-exhaustive list of new syntactic features and methods that were added to JavaScript in ES6. These features are the...
Read more >eslint-plugin-import
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
Read more >eslint-plugin-import
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@the-simian The correct option is
"brace_style": "collapse-preserve-inline"
, in the “Brace style” section if you go through the Atom preferences. The “preserve_newlines” option is for preservation of newlines across the whole file. You definitely want that one to be true, though. 😃I am still experiencing this issue with
import
. I am using1.6.3
becomes
for those of you that it works correctly, can you post your .rc file json with the correct properties pointed out? I have no idea why it isn’t working at all.
that did not fix it (as posted above)