Change `useTabs` to `true` by default
See original GitHub issueSince we’re changing the defaults for several options in 2.0, I’ve decided to request that we do so for useTabs
as well.
Tabs have several advantages over spaces:
- Always 1 byte per indentation level, regardless of tabstop width.
- Indent size is customisable (those of us who prefer 4 characters can use a tabstop width of 4, and those who prefer 2 characters can use a tabstop width of 2)
See also: #6888
Issue Analytics
- State:
- Created 4 years ago
- Reactions:550
- Comments:344 (69 by maintainers)
Top Results From Across the Web
How can I customize the tab-to-space conversion factor?
By default, Visual Studio Code will try to guess your indentation options depending ... useTabs": true // This made it finally work for...
Read more >Options - Prettier
If you change any options, it's recommended to do it via a configuration file. ... editing real codebases, which justifies the default value...
Read more >Use tabs in Chrome - Computer - Google Support
To change the order of your tabs, drag a tab along the top of the browser window. Pin a tab: Right-click the tab...
Read more >Sublime Text 3 uses tabs instead of spaces for indentation
Also, anytime I modify the file Preferences.sublime-settings indirectly, ... So if your file is saved to use tabs (for example by another ...
Read more >VisualStudio: Automatically turn tabs into spaces - Super User
If you'd like to use another default, you can modify the editor.insertSpaces and editor.tabSize settings. "editor.insertSpaces": true, "editor.
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 main reason I would like to see this change is for refreshable braille displays that are used by blind programmers a lot. Each space wastes one braille cell and takes away valuable braille realestate. So if the default indentation of a project is 4 spaces per level, a 3rd level indentation wastes 12 braaille cells before code starts. On a 40 cell display, which is the most commonly used with notebooks, this is more than a quarter of the available cells wasted with no information. If each indentation level was represented by only one tab character, there would be three cells occupied by a tab character each, and on the 4th cell, the code would start. That’s less than 10 percent occupied on the same length display, but all cells contain valuable information that is easily discoverable and immediately comprehensible.
Hey folks! It’s been about six months since the last comment and we have not seen arguments against switching to tabs in Prettier 3.0 by default (regardless of when it gets released). Can we say that there is a consensus about the change, which is justified by the accessibility benefits?
I think that some of the current downvotes can be attributed to making the change in Prettier 2.0 instead of 3.0. When I opened the issue today, I noticed my own 👎 and switched it over to 👍. Please do this too if you are in the same situation 🙂
I’m keen to use tabs in my own repos (especially the new ones), but feel a bit hesitant to swim against the tide (i.e. the community defaults). If Prettier embraces this accessibility improvement, tabs can become a norm quite soon!