Semi-colons stripped from multi-line default exports
See original GitHub issueI am running prettier against master for all the great jsx fixes. I’m still seeing it strip semi-colons from some default exports.
My original code:
export default ({ children }) => (
<Provider store={store} key="provider">
<IntlProvider locale="en">
{children}
</IntlProvider>
</Provider>
);
Prettier-formatted code:
export default ({ children }) => (
<Provider store={store} key="provider">
<IntlProvider locale="en">
{children}
</IntlProvider>
</Provider>
)
I know there have been other issues around semi-colons in default exports but it seems this is an edge case that hasn’t been fixed yet.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
vue.js - How to solve "semi-colon expected" warnings (css ...
Place this snippet into it: module.exports = { extends: ["stylelint-config-standard"], rules ...
Read more >Support multiline ES6 export ... from syntax #3025 - GitHub
The issue here is that JsFileParser is regex based and doesn't detect multiline import or export statements, as @au-phiware mentoined. @au- ...
Read more >Lexical grammar - JavaScript - MDN Web Docs
Some input elements are insignificant to the interpreter, and will be stripped after this step — they include white space and comments. The ......
Read more >Airbnb JavaScript Style Guide()
AirbnbStyleGuide'; export default es6;. 10.4 Only import from a path in one place. eslint: no-duplicate-imports. Why? Having multiple lines that import from ...
Read more >TypeScript static code analysis: Default export names and file ...
Default export names and file names should match ... Extra semicolons should be removed ... By convention, a file that exports only one...
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 Free
Top 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
Thanks @existentialism! When I saved the file with the above example in it, I can confirm that it put the semi-colon back!
@existentialism @vjeux thanks for the quick feedback! you all rock! 🤘