-
-
Notifications
You must be signed in to change notification settings - Fork 608
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: safe checking if params are present for at rule #871
fix: safe checking if params are present for at rule #871
Conversation
FWIW I've run again |
@Antonio-Laguna Just add comment about this exception in code.
Because it is script for CI. Use |
Anyway good work, thanks! |
To be next to where the infraction happens
@evilebottnawi I've caught an error with |
@Antonio-Laguna just add comment about check what some plugins remove |
Not sure I'm understanding you correctly. Where do I add a comment? |
// Due reusing `ast` from `postcss-loader` some plugins can remove `params` property, we need check this situation
if (atrule.params) {
// eslint-disable-next-line no-param-reassign
atrule.params = replaceImportsInString(atrule.params.toString());
} |
Ahh gotcha! |
Seems that circle ci is still unhappy :/ |
@Antonio-Laguna don't worry about CI |
Thanks! |
This PR contains a:
Motivation / Use-Case
Tried today to use https://github.com/jonathantneal/postcss-font-magician to autoload Google Fonts and suddenly it was all broken with this error on the CSS:
Digging a bit deeper I found that they use the
atRule
API by PostCSS as seen here: https://github.com/jonathantneal/postcss-font-magician/blob/master/index.js#L152 Double checked the API https://api.postcss.org/postcss.html#.atRule and it doesn't seem that theparams
parameter is something that's needed.I've double checked that all tests are still passing. Wasn't sure where to add a test for this little thing. Happy to add it wherever you may find it useful.