Skip to content
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

Nested map causes error #531

Closed
thasmo opened this issue Feb 16, 2016 · 13 comments
Closed

Nested map causes error #531

thasmo opened this issue Feb 16, 2016 · 13 comments

Comments

@thasmo
Copy link

thasmo commented Feb 16, 2016

Using gulp-sass-lint this SCSS ...

$base-colors: (
    'blue': (
        'base': #00f,
    ),
    'red': (
        'base': #f00,
    ),
);

... causes this error:

TypeError: Cannot read property 'forEach' of undefined
    at Function.sassLint.warningCount (S:\Project\web\gulp.boilerplate\node_modules\sass-lint\index.js:65:10)
    at Function.sassLint.resultCount (S:\Project\web\gulp.boilerplate\node_modules\sass-lint\index.js:83:23)
    at Function.sassLint.outputResults (S:\Project\web\gulp.boilerplate\node_modules\sass-lint\index.js:220:12)
    at DestroyableTransform._transform (S:\Project\web\gulp.boilerplate\node_modules\gulp-sass-lint\index.js:64:10)
    at DestroyableTransform.Transform._read (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_transform.js:160:12)
    at doWrite (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_writable.js:335:12)
    at writeOrBuffer (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_writable.js:321:5)
    at DestroyableTransform.Writable.write (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_writable.js:248:11)
    at DestroyableTransform.ondata (S:\Project\web\gulp.boilerplate\node_modules\readable-stream\lib\_stream_readable.js:583:20)
@thasmo
Copy link
Author

thasmo commented Feb 16, 2016

This works:

$base-colors: (
    'blue': #00f,
    'red': #f00,
);

@thasmo
Copy link
Author

thasmo commented Feb 16, 2016

Oh, seems like nesting in general creates this error. Same error for this:

.footer {
    .bottom {
        display: block;
    }
}

@DanPurdy
Copy link
Member

Sorry but there must be something else going on here. I've tested your examples and both work. We have countless examples of nested blocks in our tests too.

What version of sass-lint are you using?

@thasmo
Copy link
Author

thasmo commented Feb 16, 2016

I'm using gulp-sass-lint version 1.1.1 which should install sass-lint version 1.5.0, no? That's what it says in node_modules/sass-lint/package.json: "version": "1.5.0".

@DanPurdy
Copy link
Member

Yep. What platform are you working on? Windows? OSX?

hard tabs / soft tabs?

@thasmo
Copy link
Author

thasmo commented Feb 16, 2016

Running on Windows 10 64-bit, Node 5.6.0, using hard tabs.

@DanPurdy
Copy link
Member

Ok, could you try soft tabs/spaces in that file and see if you get the same error?

I;ve got a feeling it will be down to the hard tabs not working correctly in the current version of our AST. If it is this then #495 will look to fix it.

@thasmo
Copy link
Author

thasmo commented Feb 16, 2016

True, spaces work.

@DanPurdy
Copy link
Member

Ok, I'll label this as an AST issue for now then. It's a long standing problem that we should see eliminated in our 1.6.0 update which will land once i get round to finishing our last rule update.

@thasmo
Copy link
Author

thasmo commented Feb 17, 2016

Thanks! :)

@DanPurdy
Copy link
Member

No problem, thanks for the report 👍

@bgriffith
Copy link
Member

@thasmo Fixed in 1.6

@thasmo
Copy link
Author

thasmo commented Apr 22, 2016

Yay, awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants