Open shoogstoel opened 1 year ago
Great suggestion. I was just thinking I know I had written something just like this and where was it so I was poking around and I put it instead in a set of stylelint plugins that we'll be releasing soon from the @spectrum-tools namespace: stylelint-no-unused-custom-properties and stylelint-no-unknown-custom-properties. Both plugins will support ignoreList and allowList properties. Shouldn't be too bad to work those into this plugin but if you wanted to tackle that, PRs are appreciated.
I'd love to approach it like:
allowList
, type: string[], if this is set, only properties defined in this array will be evaluated.ignoreList
, type: string[], if this is set, any properties defined in this array will not be removed if found unused.What do you think? Do those properties and definitions make sense?
Thanks for the plugin, great job.
I ran into an issue where I was using certain custom properties during runtime. As they are technically unused during build time, the plugin went ahead and removed them (correctly so, given the current capabilities).
I'd love to have the option to exclude certain files and/or properties.