-
-
Notifications
You must be signed in to change notification settings - Fork 929
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 isStandardSyntaxAtRule.test.js
that use callbacks
#4957
Fix isStandardSyntaxAtRule.test.js
that use callbacks
#4957
Conversation
const scss = require('postcss-scss'); | ||
const postcssLess = require('postcss-less'); | ||
const postcssSass = require('postcss-sass'); | ||
const postcssScss = require('postcss-scss'); |
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.
[note] I've renamed the variables not to hide local variables with the same name, e.g.
const sass = '@mixin mixin()\n @content';
const scss = '@mixin mixin() { @content; };';
lessAtRules(less, (atRule) => { | ||
expect(isStandardSyntaxAtRule(atRule)).toBeFalsy(); | ||
}); | ||
const rules = lessAtRules('@my-variable: 10px; .top { margin-top: @my-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.
[note] I think the one-line is easier to read here such as '@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }'
.
it('ignore `@content` inside mixins newline', () => { | ||
const sass = '@mixin mixin()\n @content'; | ||
// eslint-disable-next-line jest/no-disabled-tests -- TODO: `postcss-sass` parser does not support `@mixin`. | ||
it.skip('ignore `@content` inside mixins newline', () => { |
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 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 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.
Has anybody left an issue on postcss-sass
about this? Maybe we can submit a fix upstream 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.
I found a PR to add the support of @mixin
at-rule, but it seems WIP (and too old). 😢
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.
LGTM 💯
it('ignore `@content` inside mixins newline', () => { | ||
const sass = '@mixin mixin()\n @content'; | ||
// eslint-disable-next-line jest/no-disabled-tests -- TODO: `postcss-sass` parser does not support `@mixin`. | ||
it.skip('ignore `@content` inside mixins newline', () => { |
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.
Has anybody left an issue on postcss-sass
about this? Maybe we can submit a fix upstream as well.
This is a part of #4881.
It seems
postcss-sass
does not support@mixin
, so maybe the following test case is incorrect:stylelint/lib/utils/__tests__/isStandardSyntaxAtRule.test.js
Lines 70 to 80 in 65ab12e
In this PR, I've marked the case above as skipped.