Tabs and spaces are mixed when `use-tabs: true`
See original GitHub issueHi, first of all thank you for the lib 👍
Issue
When I configured prettyhtml to useTabs
it indents using tabs except for the HTML attributes. Attributes indented using spaces. Which I guess should be indented using tabs. See the example below.
Example
Ascii chars:
·
Represents a space char
→
Represents a tab char
Options:
{
useTabs: true,
tabWidth: 2,
printWidth: 80
}
Input:
<div class="test">
··<prism-editor
····class="my-editor"
····:code="code"
····@change="changeCode"
····language="html"
··/>
</div>
Expected Output:
<div class="test">
→ <prism-editor
→ → class="my-editor"
→ → :code="code"
→ → @change="changeCode"
→ → language="html"
→ />
</div>
Got:
<div class="test">
→ <prism-editor
→ ··class="my-editor"
→ ··:code="code"
→ ··@change="changeCode"
→ ··language="html"
→ />
</div>
you can also test it on prettyhtml.netlify.com
- Click
VUE
example button - Click the
Use Tabs
option on the left - Click
Run
button on the top right
You should see that attributes are indented using spaces not with tabs.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Tabs and spaces are mixed with this code snippet. · Issue #188
... tabWidth: 4, useTabs: true };. What I did: Ran prettier-eslint . What happened: Tabs and spaces were mixed for indentation.
Read more >What are the downsides of mixing tabs and spaces? [duplicate]
1. The first downside is that it quickly becomes a mess. One of the most used Visual Studio extensions is Productivity Power Tools....
Read more >python - "inconsistent use of tabs and spaces in indentation"
If you mix tabs and spaces, it may break (see question) or look broken if you have other than 8-space expansion of tabs....
Read more >Why do some people mix tabs and spaces in their code? - Quora
There are two things to consider when deciding whether to use tabs or spaces. Tabs take no more and generally less storage space...
Read more >(Python) inconsistent use of tabs and spaces in indentation
The Python "TabError: inconsistent use of tabs and spaces in indentation" occurs when we mix tabs and spaces in the same code block....
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
The fix was released with prettyhtml@0.1.7
🎉 🎉 😄