Multi-line comments & strings are incorrectly indented when Prettier is run.
See original GitHub issueDecription
- Multi-line comments are incorrectly indented when Prettier is run.
Example multi-line comment:
/**
* A component for auto-generating a table of contents for a page. All
* elements with an [id] attribute defined will be shown in the TOC.
*/
After multiple saves can end up like so:
/**
* A component for auto-generating a table of contents for a page. All
* elements with an [id] attribute defined will be shown in the TOC.
*/
Branch
- Develop
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Rationale - Prettier
Once an object literal becomes multiline, Prettier won't collapse it back. If in Prettier-formatted code, we add a property to an object literal,...
Read more >Why does prettier indent multi-line strings? · Issue #869 - GitHub
Let say you have a multiline string as a single argument and then you add a second argument, then the entire string gets...
Read more >Prettier and eslint indents not working together - Stack Overflow
ESLint's indent rule and Prettier's indentation styles do not match - they're completely separate implementations and are two different ...
Read more >Multiline template strings that don't break indentation
Solution 1: Ignore all space and tab characters following a newline until the first non-space or tab character. The problem with this is...
Read more >SyntaxError: unterminated string literal - JavaScript | MDN
What went wrong? ... There is an unterminated string literal somewhere. String literals must be enclosed by single ( ' ) or double...
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
@christianmemije It might be because of the two-space offset we do inside of script tags. It does the same thing in the prettier play groung link
Fixed in #1820