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

Inaccurate Indentation Failures #611

Closed
allenhartwig opened this issue Apr 15, 2016 · 8 comments
Closed

Inaccurate Indentation Failures #611

allenhartwig opened this issue Apr 15, 2016 · 8 comments
Labels

Comments

@allenhartwig
Copy link

Lint fails on indentation with odd results. Eg: "Indentation of 0..." (when the line does have indentation) "..., expected 2" (what it has)

What version of Sass-Lint are you using?
1.5.1

Please show your full configuration:
sass-lint.yaml

rules:
  indentation:
    - 2

What did you do? Please include the actual source code causing the issue.
sass-lint -c sass-lint.yaml test.sass -v -q -f compact
test.sass

table
  width: 100%

  a
    &:link
      text-decoration: none

    &:visited
      text-decoration: none

    &:active
      text-decoration: underline

What did you expect to happen?
Lint passes

What actually happened? Please include the actual, raw output from ESLint.
Lint fails with

test.sass: line 4, col 1, Error - Indentation of 0, expected 2 (indentation)
test.sass: line 5, col 1, Error - Indentation of 0, expected 2 (indentation)
test.sass: line 6, col 1, Error - Indentation of 0, expected 4 (indentation)
test.sass: line 9, col 1, Error - Indentation of 0, expected 4 (indentation)
test.sass: line 12, col 1, Error - Indentation of 0, expected 4 (indentation)
@DanPurdy
Copy link
Member

There's quite a few issues surrounding this already yes. Sass syntax is notorious for it as well as using crlf line endings or hard tabs.. The other issues have a more in depth description but unfortunately until we can get 1.6 out and investigate this with the latest version of the AST we use we can't fix it, out hands are tied.. I recommend just disabling it for now unfortunately if you match any of the criteria I mention above. 😭

@allenhartwig
Copy link
Author

I'm using LF and soft tabs (2 spaces). Should I still be seeing this issue?

@DanPurdy
Copy link
Member

You're using sass syntax not scss right? There's still issues with scss in certain places but it's definitely more stable than sass syntax purely down to the differences the AST we're using handles those formats.

@allenhartwig
Copy link
Author

Yes, sass syntax.

Are there any other known issues right now, or is it just indentation?

@mboisvertdupras
Copy link

mboisvertdupras commented Apr 24, 2016

I'd just like to add I'm seeing this as well (I guess that's to be expected at the moment) using Sass syntax.

(Using sass-lint 1.7.0)

@bgriffith bgriffith added the bug label Apr 28, 2016
@KathrynCrawford
Copy link

Wanted to add I am seeing this, with scss syntax. If I do 2 spaces it will fix the issue, but one tab will trigger a warning. I'm only having this issue in my partials though (files starting with _) my main.scss file is not triggering this warning at all. I'm using sass-lint 1.4.2 in Atom.

@DanPurdy
Copy link
Member

@Kathrynwatts Tabs were never supported in the indentation rule as described in the documentation, this was purely down to the fact that until our 1.6.0 update the AST we use didn't support tabs.

I've just updated this rule to hopefully fix the majority of issues we have with indentation and also to allow you to specify the tab character. Should be available with our 1.8.0 update

@DanPurdy
Copy link
Member

@allenhartwig this will be fixed in our 1.8 update. Closing as it's already merged in ready to go.

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

5 participants