You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include any relevant parts of your configuration
No configuration used. I used the CLI tool without configuration.
What did you do? Please include the actual source code causing the issue.
I created a test file named test.scss:
@mixin testcase($important: null) {
@if ($important == true) {$important: !important;}
width: auto $important;
}
body {
@include testcase(true);
}
I ran scss test.scss test.css which produced no errors and a valid css file.
But if i run sass-lint test.scss the linter crashes.
What did you expect to happen?
That sass-lint does not crash. I would propose, that sass-lint ignores bangs like these.
What actually happened? Please include any error messages given to you by Sass Lint.
sass-lint crashes with the following error message:
/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/lib/rules/space-before-bang.js:16
if (!previous.is('space')) {
^
TypeError: Cannot read property 'is' of undefined
at Node.<anonymous> (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/lib/rules/space-before-bang.js:16:20)
at /home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:305:54
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:279:6)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
at Node.traverse (/home/nyon/.nvm/versions/node/v7.7.4/lib/node_modules/sass-lint/node_modules/gonzales-pe/lib/gonzales.js:284:36)
If you're using a IDE plugin have you tried the CLI too?
I've only used the CLI tool.
Possible Fix
I fixed it by inserting guarding code into the space-before-bang linting rule. I'm not sure whether this has side effects. I doubt it would:
// file: lib/rules/space-before-bang.js
// ...
ast.traverseByTypes(['important', 'default'], function (block, i, parent) {
var previous = parent.content[i - 1];
if(previous === undefined) {
return null;
}
if (!previous.is('space')) {
if (parser.options.include) {
// ...
The text was updated successfully, but these errors were encountered:
What version of Sass Lint are you using?
1.10.2
Please include any relevant parts of your configuration
No configuration used. I used the CLI tool without configuration.
What did you do? Please include the actual source code causing the issue.
I created a test file named test.scss:
I ran
scss test.scss test.css
which produced no errors and a valid css file.But if i run
sass-lint test.scss
the linter crashes.What did you expect to happen?
That sass-lint does not crash. I would propose, that sass-lint ignores bangs like these.
What actually happened? Please include any error messages given to you by Sass Lint.
sass-lint crashes with the following error message:
If you're using a IDE plugin have you tried the CLI too?
I've only used the CLI tool.
Possible Fix
I fixed it by inserting guarding code into the
space-before-bang
linting rule. I'm not sure whether this has side effects. I doubt it would:The text was updated successfully, but these errors were encountered: