question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semi-colons stripped from multi-line default exports

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
joefiorinicommented, Jan 18, 2017

Thanks @existentialism! When I saved the file with the above example in it, I can confirm that it put the semi-colon back!

0reactions
joefiorinicommented, Jan 18, 2017

@existentialism @vjeux thanks for the quick feedback! you all rock! 🤘

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found