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

Ignoring Less variables #3

Closed
notethis opened this Issue Feb 9, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@notethis

notethis commented Feb 9, 2017

I took this lovely plugin for a whirl today, it correctly discovered some issues where my team had written invalid syntax, however the majority of the errors it reported was the csstree/validator rule choking on Less variables, ex:

src/Component/Component.less
 28:13  ✖  Can't parse value "@link-hover-color"   csstree/validator
 54:9   ✖  Can't parse value "@icon-color"         csstree/validator

Any idea how to mute or ignore Less variables (I'm assuming the same goes for Sass variables).

Thanks!

@lahmatiy

This comment has been minimized.

Show comment
Hide comment
@lahmatiy

lahmatiy Feb 9, 2017

Member

Hi @notethis!

Could you provide an example of such rule?
Yep, I think we can add an ignore rule for these declarations.

Member

lahmatiy commented Feb 9, 2017

Hi @notethis!

Could you provide an example of such rule?
Yep, I think we can add an ignore rule for these declarations.

@lahmatiy

This comment has been minimized.

Show comment
Hide comment
@lahmatiy

lahmatiy Feb 9, 2017

Member

Something like that?

#header {
  color: @icon-color;
}
Member

lahmatiy commented Feb 9, 2017

Something like that?

#header {
  color: @icon-color;
}
@notethis

This comment has been minimized.

Show comment
Hide comment
@notethis

notethis Feb 9, 2017

Yep! Standard less syntax:

.foo:hover {
   color: @link-hover-color; 
   padding: @link-padding 0;
}
etc.

notethis commented Feb 9, 2017

Yep! Standard less syntax:

.foo:hover {
   color: @link-hover-color; 
   padding: @link-padding 0;
}
etc.
@lahmatiy

This comment has been minimized.

Show comment
Hide comment
@lahmatiy

lahmatiy Feb 9, 2017

Member

Ok. Will take a look later. As first step I'll mute those warning.
Probably in future we will be able to substitute variable value when possible, since less/sass variables are static.

Member

lahmatiy commented Feb 9, 2017

Ok. Will take a look later. As first step I'll mute those warning.
Probably in future we will be able to substitute variable value when possible, since less/sass variables are static.

@lahmatiy

This comment has been minimized.

Show comment
Hide comment
@lahmatiy

lahmatiy Feb 13, 2017

Member

Try out 1.0.6. Should be fine now.

Member

lahmatiy commented Feb 13, 2017

Try out 1.0.6. Should be fine now.

@KarolAltamirano

This comment has been minimized.

Show comment
Hide comment
@KarolAltamirano

KarolAltamirano Feb 13, 2017

@lahmatiy I'm still seeing an error in Sass when there is a variable definition, i.e. $color01: #eee;

2:1  ✖  Unknown property: $color01        csstree/validator
3:1  ✖  Unknown property: $color02        csstree/validator
4:1  ✖  Unknown property: $color03        csstree/validator

could you please have a look.

Thanks a lot.

KarolAltamirano commented Feb 13, 2017

@lahmatiy I'm still seeing an error in Sass when there is a variable definition, i.e. $color01: #eee;

2:1  ✖  Unknown property: $color01        csstree/validator
3:1  ✖  Unknown property: $color02        csstree/validator
4:1  ✖  Unknown property: $color03        csstree/validator

could you please have a look.

Thanks a lot.

@lahmatiy

This comment has been minimized.

Show comment
Hide comment
@lahmatiy

lahmatiy Feb 13, 2017

Member

@KarolAltamirano It's another issue. I don't know why a var declaration treats as a regular declaration by postcss :( Can you fill an issue?

Member

lahmatiy commented Feb 13, 2017

@KarolAltamirano It's another issue. I don't know why a var declaration treats as a regular declaration by postcss :( Can you fill an issue?

@KarolAltamirano

This comment has been minimized.

Show comment
Hide comment
@KarolAltamirano

KarolAltamirano Feb 13, 2017

@lahmatiy thanks for your fast reply, I've just created new issue #4

KarolAltamirano commented Feb 13, 2017

@lahmatiy thanks for your fast reply, I've just created new issue #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment