ahmednuaman / grunt-scss-lint

A Grunt task to lint your SCSS
MIT License
141 stars 35 forks source link

grunt task failed – Fatal error: Cannot read property '1' of null #61

Closed rastersysteme closed 10 years ago

rastersysteme commented 10 years ago

This is my setup:

node --version

v0.10.26

grunt --version

grunt-cli v0.1.12
grunt v0.4.5

package.json:

"grunt-scss-lint": "0.3.1"

Gruntfile.js grunt task configuration:

scsslint: {
    allFiles: [
        'sass/_test.scss'
    ],
    options: {
        compact: true
    }
}

grunt task:

grunt.registerTask('check-scss', [
    'scsslint'
]);

_test.scss:

.test {
    .foo,
    .bar {
        margin: 10px;
    }

    .foo,
    .bar {
        padding: 10px;
    }
}

By running grunt check-scss the task ended with a fatal error:

Running "scsslint:allFiles" (scsslint) task
Running scss-lint on allFiles
Fatal error: Cannot read property '1' of null

Now, if I set compactto false, the task ran through:

Running "scsslint:allFiles" (scsslint) task
Running scss-lint on allFiles
source/sass/blocks/_test.scss:7 [W] Merge rule `.foo,
    .bar` with rule on line 2
Warning: Task "scsslint:allFiles" failed. Use --force to continue.

Then I made another test with no comma separated selector in my SCSS-file:

.test {
    .foo {
        margin: 10px;
    }

    .foo {
        padding: 10px;
    }
}

I expected the same result but both tasks ran through!

with compact true:

Running "scsslint:allFiles" (scsslint) task
Running scss-lint on allFiles

source/sass/blocks/_test.scss
  6: Merge rule `.foo` with rule on line 2

Warning: Task "scsslint:allFiles" failed. Use --force to continue.

with compact false:

Running "scsslint:allFiles" (scsslint) task
Running scss-lint on allFiles
source/sass/blocks/_test.scss:6 [W] Merge rule `.foo` with rule on line 2
Warning: Task "scsslint:allFiles" failed. Use --force to continue.
ahmednuaman commented 10 years ago

Okay will look ASAP

ahmednuaman commented 10 years ago

Yep I see this too, fixing.

ahmednuaman commented 10 years ago

Pushed, let's see if Travis is happy