-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
Conversation
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 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?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, 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?
@@ -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 comment
The 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 comment
The 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
declare class postcss$atRule extends postcss$node { | |
name: string; | |
params: string; | |
raws: { | |
before?: string, | |
after?: string, | |
afterName?: string | |
}; | |
} |
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.
@CAYdenberg Any chance you've got a spare moment to check on this Flow issue please?
|
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.
Thank you for picking this up!
no-extra-semicolons
was changed. Maybe it needs new tests?
Please, add tests for isStandardSyntaxAtRule
.
@@ -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 comment
The 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
declare class postcss$atRule extends postcss$node { | |
name: string; | |
params: string; | |
raws: { | |
before?: string, | |
after?: string, | |
afterName?: string | |
}; | |
} |
@ hudochenkov Thanks for the review! I've added a new test for
|
Is there anything blocking this PR or can we get it in? |
@hudochenkov Have your concerns been addressed? |
postcss-less@3 no longer emits a Import node, it's regular AtRule nodes now
111fd91
to
57cc636
Compare
I rebased this on FAIL lib/__tests__/ignore.test.js
● using ignoreFiles with input files that would cause a postcss syntax error › no-syntax-error.css found
expect(received).not.toBe(expected) // Object.is equality
Expected: -1
Received: -1
307 |
308 | it("no-syntax-error.css found", () => {
> 309 | expect(results[0].source.indexOf("no-syntax-error.css")).not.toBe(-1);
| ^
310 | });
311 |
312 | it("no-syntax-error.css linted", () => {
at Object.toBe (lib/__tests__/ignore.test.js:309:66) Anyone got an idea why? |
@jeddy3 maybe |
@jwilsson Thanks for this! Sorry about the delay in getting it merged. |
Closes #3686
The biggest change is probably the removal of
Import
nodes frompostcss-less
, they will now always be a usualAtRule
node. I've removed tests and doc notes around that.Otherwise, it should be pretty straightforward. I've left some inline notes too.