pascalduez / stylelint-config-css-modules

CSS modules shareable config for stylelint
The Unlicense
112 stars 2 forks source link

:export support #4

Closed sobolevn closed 6 years ago

sobolevn commented 6 years ago

Hi! Thanks for putting all this stuff together. It really helps.

I have a question about handling an :export case. That's what I mean:

$some-var: blue; // scss syntax

:export {
   global-var: $some-var;
}

What I get is: [stylelint] Unexpected unknown property "global-var" (property-no-unknown) How to handle this situation?

Thanks!

pascalduez commented 6 years ago

Hi,

I think this have to be handled on your side with the property-no-unknown rule. Make your own whitelist or use a prefix. Not sure whether there's some sort of wildcard enabled config for I could add here.

Dupe of #3

pascalduez commented 6 years ago

Another solution would be to disable locally with comments.

sobolevn commented 6 years ago

Thanks, now using this setup:

:export {
  // Any values that need to be accessible from JavaScript
  // outside of a Vue component can be defined here, prefixed
  // with `var-` to avoid conflicts with existing variables.
  // For example:
  $var-color-white: $color-white;
}
pascalduez commented 5 years ago

As of stylelint-config-css-modules@2.0.0 this is supported without any additional tweak.