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
Update to postcss-less@3 #3687
Update to postcss-less@3 #3687
Changes from all commits
7e43357
0b2637c
8c51872
0dc9fcf
c88b938
ac854e0
451dc46
57cc636
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,9 +72,13 @@ const rule = function(actual, options) { | |
}); | ||
} | ||
|
||
root.walkAtRules(/^media$/i, atRule => | ||
check(atRule, atRule.params, atRuleParamIndex) | ||
); | ||
root.walkAtRules(atRule => { | ||
if (!/^media$/i.test(atRule.name) && !atRule.variable) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, there were a bunch of tests for |
||
return; | ||
} | ||
|
||
check(atRule, atRule.params, atRuleParamIndex); | ||
}); | ||
root.walkDecls(decl => check(decl, decl.value, declarationValueIndex)); | ||
}; | ||
}; | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,17 +7,21 @@ | |||||||||||||||||||
* @param {atRule} postcss at-rule node | ||||||||||||||||||||
* @return {boolean} If `true`, the declaration is standard | ||||||||||||||||||||
*/ | ||||||||||||||||||||
module.exports = function(atRule /*: postcss$atRule*/) /*: boolean*/ { | ||||||||||||||||||||
module.exports = function(atRule /*: Object*/) /*: boolean*/ { | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps someone better than me at Flow can help out with this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no clue about Flow, to be honest. Maybe new properties should be added to this lines? stylelint/flow-typed/postcss.js Lines 30 to 38 in 6f86f23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @CAYdenberg Any chance you've got a spare moment to check on this Flow issue please? |
||||||||||||||||||||
// Ignore scss `@content` inside mixins | ||||||||||||||||||||
if (!atRule.nodes && atRule.params === "") { | ||||||||||||||||||||
return false; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
// Ignore detached ruleset `@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }` | ||||||||||||||||||||
// Ignore Less mixins | ||||||||||||||||||||
if (atRule.mixin) { | ||||||||||||||||||||
return false; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
// Ignore Less detached ruleset `@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }` | ||||||||||||||||||||
if ( | ||||||||||||||||||||
!atRule.nodes && | ||||||||||||||||||||
atRule.raws.afterName === "" && | ||||||||||||||||||||
atRule.params[0] === "(" | ||||||||||||||||||||
atRule.variable || | ||||||||||||||||||||
(!atRule.nodes && atRule.raws.afterName === "" && atRule.params[0] === "(") | ||||||||||||||||||||
) { | ||||||||||||||||||||
return false; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
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.
There were a bunch of tests for
@variable
syntax, hence this change even though it's non-standard syntax. Perhaps those tests should be updated instead?