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

Sass-lint process fails if selector has no space between it and opening brace #301

Closed
micahgodbolt opened this issue Oct 13, 2015 · 4 comments
Labels

Comments

@micahgodbolt
Copy link
Member

The following causes sass-lint to fail and return "Warning: Cannot read property 'type' of undefined Use --force to continue."

a{
  background: red;
}

But this is fine (space after the a tag)

a {
  background: red;
}
@DanPurdy
Copy link
Member

There's something really odd happening here...

a {
  color: red;
}

.test{ <----
  color: red;
}

.test {
  color: red;
}

even a block like that in the middle of a file will cause all the other errors and warnings to disappear..

add the space again or change it to the following and all is fine!

.test .again{
  content: 'this works fine'
}

@DanPurdy DanPurdy added the bug label Oct 13, 2015
@DanPurdy
Copy link
Member

It's the brace style rule. Looking into it now.

@DanPurdy
Copy link
Member

@bgriffith you did this rule, fancy looking at this?

this line here https://github.com/sasstools/sass-lint/blob/develop/lib/rules/brace-style.js#L49

too late for me to look now but if you use a block as show above there is no last space to check for and so it fails when it starts check for that content, guessing this will be the only case where a space or newline isn't present and thus we can fairly certainly assume that someone has just missed a space before brace and work from there. Might have to provide a default space character though...

@bgriffith
Copy link
Member

Hey @micahgodbolt this should be fixed by #303. If you have a spare minute it would be greatly appreciated if you could test if this fixes your issue 👍

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