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.

Template literal with curly brace and newline triggers a 'semi-colon expected' error

See original GitHub issue

Verified that code compiles and renders in the browser with no issues.

I’m using multiple embedded strings in a template literal for the transition property, and the plugin has no problem when everything is on the same line: screen shot 2018-12-17 at 1 40 00 am

My code formatter automatically transforms the string to take up two lines, and that’s when I get errors (on lines 91 and 93): screen shot 2018-12-17 at 1 40 35 am

screen shot 2018-12-17 at 1 40 55 am

Possibly related to #74 and #71

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:16
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
snehalbaghelcommented, Oct 18, 2020

@mjbvz If you can point me to where the fix needs to be done I can make a PR.

0reactions
stanislawderacommented, Jul 26, 2022

I’m getting the same issue now. Is that related?

export const Wrapper = styled.div`
  background-color: red;

  div {
    padding: ${({ theme }) => theme.spacing.md}
      ${({ theme }) => theme.spacing.sm};
  }
`

When I remove the newline everything starts working:

padding: ${({ theme }) => theme.spacing.md} ${({ theme }) => theme.spacing.sm}; // works
// produces error
padding: ${({ theme }) => theme.spacing.md}
  ${({ theme }) => theme.spacing.sm};

Is there any way to fix it (after 2 years since last comment on this issue)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expecting newline or semicolon error on WebStorm
After having done a bad manipulation on WebStorm, I now have errors such as expecting newline or semicolon". For ...
Read more >
template-curly-spacing - ESLint - Pluggable JavaScript Linter
This rule has one option which has either "never" or "always" as value. "never" (by default) - Disallows spaces inside of the curly...
Read more >
Google C++ Style Guide
The compiler deduces the type from the variable's initializer, following the same rules as function template argument deduction with the same initializer (so ......
Read more >
Ruby Style Guide
Should I Terminate Expressions with ; ? One Expression Per Line; Operator Method Call; Spaces and Operators; Safe navigation; Spaces and Braces; No...
Read more >
Java Basics - Java Programming Tutorial
You can use the following template to write your Java programs. ... There is no need to put a semi-colon after the closing...
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