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

BEM Depth issue with intepolated placeholder #782

Closed
nicolas-goudry opened this issue Jul 11, 2016 · 5 comments · Fixed by #818
Closed

BEM Depth issue with intepolated placeholder #782

nicolas-goudry opened this issue Jul 11, 2016 · 5 comments · Fixed by #818
Labels

Comments

@nicolas-goudry
Copy link

Hello,

There's an issue with bem-depth rule. I manually configured sass-lint, here is my config.

The error is happening because function is trying to split a null value. Here is the stack trace:

C:\react-poc\node_modules\sass-lint\lib\rules\bem-depth.js:12
  var elements = str.split('__').length;
                    ^

TypeError: Cannot read property 'split' of null
    at bemDepth (C:\react-poc\node_modules\sass-lint\lib\rules\bem-depth.js:12:21)
    at Node.<anonymous> (C:\react-poc\node_modules\sass-lint\lib\rules\bem-depth.js:37:17)
    at C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:305:54
    at Node.traverse (C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:279:6)
    at Node.traverse (C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:284:36)
    at Node.traverse (C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:284:36)
    at Node.traverse (C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:284:36)
    at Node.traverseByTypes (C:\react-poc\node_modules\gonzales-pe\lib\gonzales.js:304:11)
    at Object.module.exports.detect (C:\react-poc\node_modules\sass-lint\lib\rules\bem-depth.js:29:9)
    at C:\react-poc\node_modules\sass-lint\index.js:124:27
    at Array.forEach (native)
    at Function.sassLint.lintText (C:\react-poc\node_modules\sass-lint\index.js:123:11)
    at C:\react-poc\node_modules\sass-lint\index.js:222:23
    at Array.forEach (native)
    at Function.sassLint.lintFiles (C:\react-poc\node_modules\sass-lint\index.js:219:12)
    at lint (C:\react-poc\node_modules\sasslint-webpack-plugin\lib\linter.js:18:25)

This is happening with a sass-lint test file: sass-lint/tests/sass/placeholder-name-format.sass and rule is at line 57:

%#{$var}
  content: ''

Thanks for this great work anyway, I removed the rule from config for now and it's working as expected!

@DanPurdy
Copy link
Member

What version of sass-lint?

@nicolas-goudry
Copy link
Author

It's latest 1.8.2

@nicolas-goudry
Copy link
Author

Forgot to mention that I use it with sasslint-webpack-plugin, but doesn't seem to be related.

@DanPurdy
Copy link
Member

DanPurdy commented Aug 8, 2016

@nicolas-goudry thanks for this, I've finally found some time to look into it and I've found the problem. It'll be fixed in the next version we release.

@nicolas-goudry
Copy link
Author

Cool to hear that, we will be able to use it next time you release 😄 ! Thanks a lot !

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

Successfully merging a pull request may close this issue.

2 participants