-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support id selectors #80
base: master
Are you sure you want to change the base?
Conversation
@@ -51,7 +51,7 @@ export const getRegularClassesMap = (ast: gASTNode): classMapType => { | |||
fp.map('content'), | |||
fp.filter({ type: 'ident' }), | |||
fp.flatMap('content'), | |||
fp.filter({ type: 'class' }), | |||
fp.filter(node => node.is('class') || node.is('id')), |
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.
Love the initiative! A small suggestion here: This function is intended to return regular classes. What do you think about creating a new one for retrieving id
s or renaming the function?
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.
Renamed the function because it would be a shame to have to go over the ast one more time just for that
test({ | ||
code: ` | ||
import s from './id.scss'; | ||
|
||
export default Foo = () => ( | ||
<div id={s.scopedId}></div> | ||
); | ||
`, | ||
}), |
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.
Does this work with no-unused-class
as well?
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.
Added tests for no-unused-class as well as an error test for no-undef-class
Fixes #54