-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
Allow enforcing tabs over spaces #82
Comments
That would seem to be in conflict with: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md010 I prefer tabs semantically, but tend to feel that documentation (Markdown) should render as uniformly as possible (spaces). Do you have a specific example of where tabs would be necessary in Markdown? |
Not necessary, but practical. My use case is that my team at work uses tabs everywhere and wants to keep it standard in all our files. |
The Markdown spec at https://daringfireball.net/projects/markdown/basics contains the string "4 spaces or 1 tab" twice. Lint rule MD010 doesn't seem valid, at least not as a blanket rule. |
@giskard22 I agree with your reading of the specification. That said, there are many projects that impose additional standards and forbidding tab characters like MD010 does is somewhat common. Linking tools will often go beyond what’s allowed by the specification in order to standardize, avoid unwanted practices, and so on. For scenarios where rule MD010 does not apply, it can be disabled. |
You having seen "many projects" imposing different standards shouldn't undermine the usability of your project. Linting tools shouldn't promote unwanted practices nor force different standards.
|
I’ll look at deprecating/replacing this rule in a future release. |
As I research this more, rule http://spec.commonmark.org/0.28/#tabs Many places where a tab could be used are not places I think everyone would agree it should be used, so I think the proposed rule to enforce tabs may need multiple options to support every scenario. So I will leave this issue as a request to add a new rule for tabs. And separately, I will look at disabling |
I would like to chime in on this, even though it is over 2 years old at this point and add a request for supporting tabs as well. I would propose that the following rules are modified with a rule to check for tabs, spaces, or consistent styling.
adding a consistent option to Thank you |
+1 for implementing a new rule for enforcing indentation with tabs instead of spaces! While space indentation may be more common in Markdown, I think in a large multi-language project, it's more important that the coding style is fairly consistent across the whole project, rather than orthodox to each individual language. |
+1 to tabs over spaces though I will note that YAML requires spaces, so as long as it doesn't mess with the YAML blocks. |
I also have a use case that (see |
Huh, I'd forgotten that I filed this issue. Since filing it I've come to the conclusion that a linter should not be used for formatting concerns such as enforcing tabs vs spaces. Closing this issue and unsubscribing from it, as I use Prettier or dprint to enforce formatting instead of markdownlint. As of #594, you can use a built-in Markdownlint // .markdownlint.json
{
"extends": "markdownlint/style/prettier"
} I've got a longer blog post about it here: https://blog.joshuakgoldberg.com/configuring-markdownlint-alongside-prettier (apologies for the shameless self promotion). If someone else wants to file a new version of this issue, nothing's stopping you. Just know that I'll silently judge you for using a linter for formatting! 😉 |
I appreciate your post, but I disagree.
There's been some valuable discussion on this here, and others still want the feature, so please reopen this issue @JoshuaKGoldberg. |
For teams where the code style is tabs instead of spaces, linting needs a way to enforce that 4x
gets replaced with tabs.
The text was updated successfully, but these errors were encountered: