Skip to content
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 SVG tags whitelist in selector-type-no-unknown rule (#4472) #4495

Merged
merged 4 commits into from Dec 27, 2019
Merged

Fix SVG tags whitelist in selector-type-no-unknown rule (#4472) #4495

merged 4 commits into from Dec 27, 2019

Conversation

webschik
Copy link
Contributor

Fix for selector-type-no-unknown rule

Closes #4472

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to change this line to compare tags in correct case, rather ignoring case completely:

- svgTags.includes(tagNameLowerCase) ||
+ svgTags.includes(tagName) ||

While in HTML tag case is ignored, for SVG it's important. It will help user to find typo in their tags, if we compare case for SVG tags.

.gitignore Outdated Show resolved Hide resolved
@@ -85,6 +85,10 @@ testRule(rule, {
code: 'circle {}',
description: 'svg tags',
},
{
code: '.test foreignObject { color: white }',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't spot it right away:

Suggested change
code: '.test foreignObject { color: white }',
code: 'foreignObject { }',

It's for consistency with other test cases. Could you also adjust description to case-sensitive svg tags, please?

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@fanich37 fanich37 self-requested a review December 27, 2019 20:26
@hudochenkov hudochenkov merged commit 9cd0557 into stylelint:master Dec 27, 2019
@hudochenkov
Copy link
Member

  • Fixed: selector-type-no-unknown false positives for SVG tags (#4495).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

FP 'selector-type-no-unknown' for 'foreignObject' from svg
3 participants