Skip to content

Support for Tabs #908

@JedWatson

Description

@JedWatson

I know this was already discussed in #34 but after conversation with @vjeux where he said

Can you open an issue for supporting tabs btw

... I am 😁

We just applied prettier to a relatively fresh codebase and it switched from our company standard (tabs) to spaces. This caused confusion, conflict, and broken hearts.

I'm not going to reopen the discussion of whether tabs are a good idea, but since they're a well established part of our project standards across hundreds of repos, including that we have programmers who prefer 2 or 4 spaces and like being able to choose, I think tab support for prettier would be a massive improvement and significantly help ease adoption into existing projects.

re line character count, I think that for users with tabs it would be safe to assume a tab is 4 characters for wrapping purposes. 8 will wrap too aggressively, and many* editors default to 4 spaces when displaying tabs.

If people want more precise line wrapping rules, they can always use spaces 😉

re "but you can reformat the code however you want then format it back when you commit it", that's maybe a thing that could happen, but seems super awkward as a primary workflow to enforce imo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions