Skip to content

style: indent lines with tabs instead of spaces #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2022
Merged

Conversation

Belco90
Copy link
Member

@Belco90 Belco90 commented Aug 18, 2022

Checks

  • I have read the contributing guidelines.
  • If some rule is added/updated/removed, I've regenerated the rules list (npm run generate:rules-list)
  • If some rule meta info is changed, I've regenerated the plugin shared configs (npm run generate:configs)

Changes

  • Configure prettier to indent lines with tabs rather than spaces
  • Set up lint-staged using a js config file, so ignored files can be excluded properly

Context

There was no ticket for this. However, Prettier is considering switching to tabs by default in v3. This is a great change, you can find the motivation behind it here: prettier/prettier#7475

I think we should switch to tabs now to improve the accessibility of the code. The tab size can be customized in GitHub here: https://github.com/settings/appearance

@Belco90 Belco90 added the chore Changes that affect the build system, CI config or other changes that don't modify src/test files label Aug 18, 2022
@Belco90 Belco90 requested a review from a team August 18, 2022 15:43
@Belco90 Belco90 self-assigned this Aug 18, 2022
Copy link
Member

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Not sure if we already need to do it before the Prettier discussion is resolved though. 🤔
I would personally wait for it & do it together with the Prettier v3 update.

@Belco90
Copy link
Member Author

Belco90 commented Aug 18, 2022

Not sure if we already need to do it before the Prettier discussion is resolved though. 🤔
I would personally wait for it & do it together with the Prettier v3 update.

Not sure what Prettier discussion you are referring to, but the original issue for v3 is still open.

Since the first alpha for Prettier v3 was released a few days ago with no change related to using tabs, I'd just switch to tabs in our codebase. If they do the change in v3, we are ready for it. If not, we made our codebase more accessible, even if Prettier didn't change its defaults!

@Belco90 Belco90 merged commit 08ac914 into main Aug 19, 2022
@Belco90 Belco90 deleted the indent_lines_with_tabs branch August 19, 2022 08:46
@MichaelDeBoey
Copy link
Member

@Belco90 I was indeed referring to the original issue that's still open.

If not, we made our codebase more accessible

I think that's the whole discussion, that it's not 100% sure it's more accessible.
If it was 100% sure, Prettier would switch in a second.
Since it's not, that's why the discussion is still open.

I think we should have waited to see what the outcome of the discussion is, especially since the only reason we're doing this change is because of something that's not 100% resolved/clear.

@github-actions
Copy link

github-actions bot commented Sep 3, 2022

🎉 This PR is included in version 5.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that affect the build system, CI config or other changes that don't modify src/test files released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants