odd output for template literals
See original GitHub issuegiven the following code:
insertRule(`*, *:before, *:after {
box-sizing: inherit;
}`)
I get the following output:
insertRule(
`*, *:before, *:after {
box-sizing: inherit;
}`,
)
The formatting of the last two lines seems odd to me. I’m not sure why a comma is added or why the line with the closing bracket is on the same indentation as the closing parenthesis.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick ( ` ) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >Inadvisable template literal tricks
Introduced in ES2015, template strings are a new kind of JavaScript string. ... and passes in the tagged string as an odd arrangement...
Read more >Getting weird error when concatenating template-literals
The output should just be a string that I can insert into the document. Any help would be appreciated. javascript · html ·...
Read more >Template Literals in JavaScript: The Complete Guide
Template literals are, as the name suggests, designed to create templates with ... Demystifying the strange but incredibly practical syntax ... The output:...
Read more >ES6 Template Literals: Techniques and Tools - SitePoint
Evaluating Expressions in Template Strings ... Template literals also solve another problem: they can evaluate variables within the string. The ${ ...
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
I thought the formatting for an optional
styled-component
rule was a little odd (although not terrible), but thought I’d throw another template literal example here to consider. This one has nested template literals.formats to
@hundsim This issue should be fixed. If you’re having formatting issues, please open a new issue and fill out the template so we can more easily track them.