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

False positives for variable-for-property #714

Closed
GabrielCousin opened this issue May 16, 2016 · 1 comment
Closed

False positives for variable-for-property #714

GabrielCousin opened this issue May 16, 2016 · 1 comment

Comments

@GabrielCousin
Copy link

Hi! I don't think the following is due to a misconfiguration, but please don't hesitate to tell me if I fucked up :) Thanks in advance.

What version of Sass Lint are you using? 1.7.0

Configuration:

variable-for-property:
  - 2
  - properties:
      - color
      - background
      - background-color

What did you do? Sass-lint is returning false positives in those cases:

.t-neutral {
  color: $gray-chateau !important;
}
.Btn--raw {
  color: rgba($white, .8);
  background-color: $transparent;
}

What did you expect to happen? Previous examples should pass the test.

What actually happened?

error    Values for properties of type 'color' may only be variables    variable-for-property
error  Values for properties of type 'background-color' may only be variables  variable-for-property

If you're using a IDE plugin have you tried the CLI too? Only tried CLI

@DanPurdy
Copy link
Member

Hi @GabrielCousin thanks for this report. Briefly looking at your examples I think your first is an error on our part as the important flag should be respected and ignored.

Your second example I think is a valid lint error, you aren't using a variable for that property you're using a function that passes a variable. In the true sense of the rule the result of the rgba function should be assigned to a variable as currently it isn't reusable in a variabilised form. I believe even the ruby based scss-lint would raise an error with that.

I'll get the important flag fixed, @bgriffith what do you think about the second one?

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

No branches or pull requests

2 participants