Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Fix]
no-invalid-html-attribute
: allow 'shortcut icon' onlink
#3174[Fix]
no-invalid-html-attribute
: allow 'shortcut icon' onlink
#3174Changes from all commits
4c3d00f
e0af60b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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.
Hmm but it actually does that - it's the opposite of
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.
The test fails when I remove it
This comment was marked as outdated.
Sorry, something went wrong.
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.
Ahh no, we shouldn't remove it - it is the testcase for the
notPaired
branch (in contrast tonotAlone
)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'm basically saying that the autofix output should never have leading or trailing spaces.
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.
Yeah that also confused me, but apparently that's "how things used to be" in
master
as well:https://github.com/yannickcr/eslint-plugin-react/blob/0d8946212a1ba560b12e2e01807033e19dc774f7/tests/lib/rules/no-invalid-html-attribute.js#L355
https://github.com/yannickcr/eslint-plugin-react/blob/0d8946212a1ba560b12e2e01807033e19dc774f7/tests/lib/rules/no-invalid-html-attribute.js#L378
https://github.com/yannickcr/eslint-plugin-react/blob/0d8946212a1ba560b12e2e01807033e19dc774f7/tests/lib/rules/no-invalid-html-attribute.js#L403
https://github.com/yannickcr/eslint-plugin-react/blob/0d8946212a1ba560b12e2e01807033e19dc774f7/tests/lib/rules/no-invalid-html-attribute.js#L416
https://github.com/yannickcr/eslint-plugin-react/blob/0d8946212a1ba560b12e2e01807033e19dc774f7/tests/lib/rules/no-invalid-html-attribute.js#L477
Apparently it only runs one cycle when fixing and we would need to find a way to kind of
while
loop so long until it can't fix any more issues - but that sounds like a major refactor to me 🤔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.
fair point. altho it seems like adding
.trim()
to the attribute contents wouldn't be that difficult?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.
Good idea! But where would I run this, I think I haven't fully grasped when/how fix runs. Would this be part of fix? Or would we just always in the end after all checks run another trim as it's never good/valid to keep it?
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.
Adding a single fixer on program exit that trimmed any attribute strings that had been previously autofixed (we’d have to track that manually) would be good. I think that should wait for a followup PR, tho, because it was a pre-existing problem.
I’ll land this tomorrow, as-is.