-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[editorconfig]: All md files except in test use tab #1111
Conversation
.editorconfig
Outdated
@@ -13,5 +13,5 @@ end_of_line = lf | |||
insert_final_newline = true | |||
trim_trailing_whitespace = true | |||
translate_tabs_to_spaces = true | |||
indent_style = space | |||
indent_style = tab | |||
indent_size = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when indent_style is set to tab, it may be desirable to leave indent_size unspecified so readers may view the file using their preferred indentation width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran into issues with that, I think - most likely because of the asterisk. all files have an indent size of 2...need to override to say something else. We could remove the asterisk, I suppose. Basically saying we only want these specific file types to have these specific qualities. I tried doing something like this, and it didn't seem to work very well - but it could just be my editor + plug-in interaction (tested in both Sublime and VSC, with same unexpected results):
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.json, *.js]
indent_style = space
indent_size = 2
[*.md, !test/*md]
indent_style = tab
For some reason, when I tried various permutations of this inheritance stack I always got spaces in MD files...?? Could just be something in my environment, though it's not obvious to me what.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At one point, I was also tempted to just do this:
[*.json, *.js]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
And call it a day...literally only effect JS and JSON. Not sure what would have things like YML though. Also not sure how broad our lint rules go either. Would like to get this to match those as much as possible where possible - just not a deal-breaker if they don't or can't.
.editorconfig
Outdated
@@ -13,5 +13,5 @@ end_of_line = lf | |||
insert_final_newline = true | |||
trim_trailing_whitespace = true | |||
translate_tabs_to_spaces = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this rule? it doesn't show on up https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be either a deprecated feature - or a Sublime Text specific thing (see first sentence after code): sindresorhus/editorconfig-sublime#12
Automatically converts tabs to spaces on new files. Probably a horrible idea all around anyway. Good catch. ;)
Removed.
@@ -12,6 +12,5 @@ charset = utf-8 | |||
end_of_line = lf | |||
insert_final_newline = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of funny that this file doesn't have a new line at the end 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dude! I thought that was hilarious. I was literally expecting it to happen as soon as I hit save...so disappointed. 🤣
Does eslint only do JS? (Revealing my over-dependance on If so, could literally get rid of the other rules and just apply them to JS files. The objective is to keep developers from failing lint, if their editor can apply the config. Give them the check with the |
es = EcmaScript I'm retarded sometimes... https://youtu.be/j9ndS6yu3Kk |
by default eslint only lints .js files. You can specify a |
* All md files except in test use tab * Remove translate_tabs_to_spaces
Marked version: 0.3.17
Description
tl;dr: PR changes editorconfig to use tabs not spaces while still ignoring MD files in test directory.
Looking at the CommonMark specification and considering the future regarding #1104 and #1103 (comment) a lot of the examples use honest tabs...not spaces in Markdown...makes sense given the nature of plain text editors (this was why @davisjam's initial contributions didn't pass lint - he uses VIM, which doesn't do spaced tabs).
So, not too sure what to do here regarding ignoring that
/test
folder. Or maybe ignoring markdown files all together like Federico had mentioned in the initial PR #1082 - think I forgot to put it back into WIP status or something and we hadn't really talked more about the GH Pages thing yet.Plus, that's why we call it software and not hardware - can be easy to change in the future, if we do it right.
Thoughts?
Tagging @intcreator as well, as it's something to consider as we move toward creating all the tests ever.
Contributor
Committer
In most cases, this should be a different person than the contributor.