pascalduez / stylelint-config-css-modules

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

Add support for :export and :import selectors #5

Closed dprgarner closed 5 years ago

dprgarner commented 5 years ago

There have been a couple of issues raised on this repo to support whitelisting properties in :export selectors. I think the solutions offered there are work-arounds and miss the point: it doesn't make sense to compare properties in an :export block against a whitelist of known CSS properties when the ICSS spec allows all properties nested in :export to be arbitrary. At the time the issues were raised, stylelint didn't support arbitrary whitelisting of properties under a given selector. Since then, I've added the ignoreSelectors option, which was released in stylelint@11.

This PR adds configuration to skip property-no-unknown checks on :export and :import selectors. This should prevent a CSS modules user from needing any /* stylelint-disable */ comments or whitelisted variable names to use the :export syntax. The downside of this is that the config will only be valid in stylelint v11 onwards, which means the peerDependencies need restricting. This makes this change backwards-incompatible, and should come with a new major release.

pascalduez commented 5 years ago

Available as of stylelint-config-css-modules@2.0.0.