-
Notifications
You must be signed in to change notification settings - Fork 885
docs update - Add hasFix
metadata for the indent rule
#3529
Conversation
I think the docs description is misleading then. We need #3395 before declaring this rule as having a proper fixer. |
I mean... it does have a fixer right now technically... but I see what you mean since the current one doesn't work in 100% of cases. The docs do mention that it only works when certain options are set though, which seems sufficient enough to add this badge. My use case & thought process: I work on a project with mixed tabs/spaces and I want to normalize them.
|
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.
ok, fair enough, if you think the documentation caveat is good enough :)
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.
hm actually we should elaborate the docs about the required option for auto-fixing... we should say it doesn't auto-fix indent size, just indent style (tab vs. spaces)
@adidahiya Check out my latest changes, would adding text like that be sufficient? |
@ChrisMBarr looks good, but linting failed |
PR checklist
Overview of change:
Add the
hasFix
property to the metadata of theindent
rule.The docs for this rule mention auto-fixing, but the green "🔧 Has Fixer" badge doesn't appear, which could lead people to assume (like I did) that this rule has no fixer.
Future Suggestions:
Perhaps make the
hasFix
property required instead of optional so that rule authors are required to correctly set this properly. Further more, maybe add a check to see ifhasFix: false
is set but the rule contains a call on theLint.Replacement
, orLint.RuleFailure
has something passed into the 6th parameter for a fix.