We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@else
Snippet: https://github.com/csstree/stylelint-validator/blob/v2.0.0/lib/syntax-extension/sass/index.js
is causing the error
At-rule '@else' should contain a prelude (csstree/validator)
with code
@if ($value == 0) { @return 0; } @else if ($value == 1) { @return 10; } @else { @return $delta; } }
As the else scss at-rule, doesn`t have a prelude, it looked like the simple solution would be:
else
// /lib/syntax-extension/sass/index.js#L56 syntaxConfig.atrules.else = { prelude: null };
// /test/preprocessors.js#L80 // Add braces to ensure xxx is or is not seen as prelude tr.ok('@else {}'); // Add missing else if tr.ok('@else if {}');
But then the tr.ok('@else if {}'); assertion fails with At-rule '@else' should not contain a prelude (csstree/validator).
tr.ok('@else if {}');
At-rule '@else' should not contain a prelude (csstree/validator)
If we analyse the AST of the first code snippet (available here), the else if at-rule takes everything starting from if as prelude.
else if
if
What should be the correct configuration for the else and else-if at-rule?
else-if
I've already forked the repo and tinkered with, without any success. Can you be of further assistance?
The text was updated successfully, but these errors were encountered:
02f7cc1
Fixed in 2.1.0
Sorry, something went wrong.
No branches or pull requests
Problem
Snippet: https://github.com/csstree/stylelint-validator/blob/v2.0.0/lib/syntax-extension/sass/index.js
is causing the error
At-rule '@else' should contain a prelude (csstree/validator)
with code
Analysis
As the
else
scss at-rule, doesn`t have a prelude, it looked like the simple solution would be:But then the
tr.ok('@else if {}');
assertion fails withAt-rule '@else' should not contain a prelude (csstree/validator)
.If we analyse the AST of the first code snippet (available here), the
else if
at-rule takes everything starting fromif
as prelude.What should be the correct configuration for the
else
andelse-if
at-rule?I've already forked the repo and tinkered with, without any success. Can you be of further assistance?
The text was updated successfully, but these errors were encountered: