SimenB / stylint

Improve your Stylus code with Stylint
https://simenb.github.io/stylint/
GNU General Public License v2.0
348 stars 62 forks source link

Support for :export syntax #417

Closed daniel-shuy closed 6 years ago

daniel-shuy commented 6 years ago

stylint: 1.5.8 OS: Windows

The :export syntax is not officially documented, however it can be used in Stylus files to export variables to JavaScript. See stylus/stylus#2316.

Currently stylint complains that :export and the keys within the :export block are not valid properties.

daniel-shuy commented 6 years ago

Apparently :export is not a Stylus feature, but a css-modules feature. Apparently my css-loader module for Webpack was converting my Stylus files to css-modules.

Would it be right for stylint to support the :export syntax?

SimenB commented 6 years ago

Would the mixins config option be enough for you? https://github.com/SimenB/stylint/blob/master/README.md#transparent-mixins--custom-properties--array-

daniel-shuy commented 6 years ago

customProperties wouldn't be sufficient because stylint would still complain about the keys.

Apparently, simply annotating the entire :export block with @css to denote it as literal CSS does the job, thanks.