-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: add test for tabs in no-extra-spacing-attrs #202
Conversation
} | ||
}); | ||
} | ||
|
||
/** |
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.
I moved this logic into the return { [Tag](node){} }
function because otherwise I found that we were recalculating several variables that had already been calculated, and it also let me present the logic in a more linear way that I found easier to understand. This did result in one existing test being changed slightly... See https://github.com/yeonjuan/html-eslint/pull/202/files#diff-dc2d2c159cee6aaa292bf260ddb4613296b2d20c77543ba6c0705e29ed1a993eR312. I hope that's OK!
@@ -309,7 +309,7 @@ ruleTester.run("no-extra-spacing-attrs", rule, { | |||
output: "<img src='foo.png' />", | |||
errors: [ | |||
{ | |||
messageId: "unexpectedAfter", | |||
messageId: "unexpectedBeforeSelfClose", |
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.
I agree! This rule is doing more than its name implies. I think it would be a good idea to rename the rule in the future. |
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.
LGTM!! 🎉 Thank you for your contribution.
This adds two things to
no-extra-spacing-attrs
:disallowTabs
option to enforce using only spaces inside a tagBecause this rule can now have an effect when a tag has no attributes, in the future may want to rename the rule to just
no-extra-spacing
... Just a thought!Thanks! :)