-
Notifications
You must be signed in to change notification settings - Fork 13
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
add pure ignore comment for CSS Modules #80
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.
Looks good, today/tomorrow I plan to finish everything here and make a release
What about just ignoring the error, i.e. don't fall and don't mix |
Ah you mean - you still would have to write I like the idea as it is simpler to implement and more explicit 👍 |
we basically just need to suppress errors on these comments, they should not have any effect on the generated code |
1374f5e
to
c812ff4
Compare
Sounds good - I changed it so now the comment:
@alexander-akait can you please take another look? :) |
Good job |
should we also remove the I guess the generated css would be more readable without those extra comments |
@jantimon Yeah, sounds good for me If it doesn't hurt performance |
@jantimon can you rebase? |
d3cd217
to
16fcd6b
Compare
16fcd6b
to
73e1c62
Compare
@alexander-akait done - the only conflict was the readme |
@@ -615,13 +651,17 @@ module.exports = (options = {}) => { | |||
context.options = options; | |||
context.localAliasMap = localAliasMap; | |||
|
|||
if (pureMode && context.hasPureGlobals) { | |||
const ignoreComment = pureMode ? getIgnoreComment(rule) : undefined; |
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.
Let's avoid extra loops when mode is not pure
- better perf
Add support for selectively opting out of pure CSS Module requirements via
/* cssmodules-pure-ignore */
commentsInitially I started with the
@
prefix (@cssmodules-pure-ignore
), but removed based on feedback from @jaggli for cleaner syntax.fixes #78
Examples
The comment can include additional explanation text:
Test Cases
Please let me know if you have more ideas for tests