SimenB / stylint

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

Is there a config option to disable invalid property warnings? #239

Open corysimmons opened 8 years ago

corysimmons commented 8 years ago

I make PostCSS plugins that use invalid properties.

I intentionally namespace them (e.g. lost-columnd: 1/2) so there's virtually zero chance they'll ever conflict with W3C.

Is it possible to disable invalid property warning via .stylintrc?

Or, even better, would it be possible to make it so you can ignore a namespace? (I plan on making a lot of these foo- libraries in the coming months.

rossPatton commented 8 years ago

there is actually!

technically, it's to be used with transparent mixins, but you should be able to use them with custom properties as well.

i see now that while it's mentioned in the docs, it's not in the example config (and the naming apparently could be better)

in your .stylintrc or options config just do:

{
  mixins: ['lost-columnd']
}

lemme know if that works

corysimmons commented 8 years ago

Is that just an array of each property? It might get pretty hairy having to manually type in dozens of properties. Is it possible to throw a little regex in there?

{
  mixins: ['lost-'*]
}

I know this seems specific, but I really am about to drop a bunch of tools that do this kinda stuff and I <3 Stylus.

rossPatton commented 8 years ago

yeah, it was just a quick and dirty fix for another user who wanted transparent mixins to not trip the invalid property rule. i could look into using regex for it.

corysimmons commented 8 years ago

That'd be awesome, thanks!

fdeneux commented 8 years ago

+1 That would be awesome indeed.

PhiLhoSoft commented 8 years ago

there is actually! technically, it's to be used with transparent mixins, but you should be able to use them with custom properties as well.

Some remarks:

It might get pretty hairy having to manually type in dozens of properties.

Yes, but on the other hand, it prevent typos, which is the point of this setting. :smile: Akin to your remark, I might benefit from giving "-webkit-text-stroke-*" but then I can get no warning on -webkit-text-stroke-widht for example. Not against the suggestion (we are free to avoid regexes anyway), just a heads up. :wink: