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

Placeholder name format doesn't ignore variables #625

Closed
bgriffith opened this issue Apr 21, 2016 · 3 comments
Closed

Placeholder name format doesn't ignore variables #625

bgriffith opened this issue Apr 21, 2016 · 3 comments
Labels

Comments

@bgriffith
Copy link
Member

bgriffith commented Apr 21, 2016

Current the placeholder-name-format rule will incorrectly flag up variables.

$var: 'foo';

%#{$var} {
  font-size: 18px;
}

Will incorrectly return Placeholder %#{$var} should be written in lowercase with hyphens.

Sass 1.5.1, develop branch

@nicolas-goudry
Copy link

nicolas-goudry commented Jul 11, 2016

Hello,

I think this issue is not fixed. I manually configured sass-lint, here is my config.

The error is happening with bemDepth.js 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: ''

Did I do something wrong or did I found a non resolved bug?

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

@DanPurdy
Copy link
Member

DanPurdy commented Jul 11, 2016

@nicolas-goudry This is a separate issue, this issue is to do with the placeholder name format rule, yours is the bem depth rule, it just so happens the error is in the test file for this rule.

Could you please open a new issue and include the information that is requested, we can then investigate it for you. Thanks! 👍

@nicolas-goudry
Copy link

@DanPurdy It's done, thanks! ==> #782

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

No branches or pull requests

3 participants