-
Notifications
You must be signed in to change notification settings - Fork 244
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
♻️ Refine icon font detection #1148
♻️ Refine icon font detection #1148
Conversation
lluerich
commented
Feb 25, 2021
- adds selectors
- selector is now case-insensitive
- print warning instead of failure
- update copy to match other warnings
@@ -26,6 +26,14 @@ const ICON_FONT_IDENTIFIERS = [ | |||
className: "ociton-", |
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.
typo? ociton
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.
Oh sorry, fixed.
fontFamilies: ["icon"], | ||
}, | ||
{ | ||
className: "icon-", |
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.
This is a super generic name which I wouldn't warn about without the font name.
@@ -35,7 +43,7 @@ export class NoIconFontIsUsed extends Rule { | |||
run({ $ }: Context) { | |||
// check for known classnames | |||
const iconFontCandidates = ICON_FONT_IDENTIFIERS.filter((identifier) => { | |||
return $(`[class*=${identifier.className}]`).length > 0; | |||
return $(`[class*=${identifier.className} i]`).length > 0; |
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.
Out of curiosity, what does the i
do here?
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.
case sensitivity?
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.
Exactly :)