matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Throwing an Error on config set due to outdated Stylelint install #262

Open JonathanWolfe opened 7 years ago

JonathanWolfe commented 7 years ago

Originally a bug over on vscode-stylefmt

If setting a config option the installed Stylelint version doesn't support, then the whole formatter stops and throws an error.

Recommendations:

Maybe wrap your config set methods in try-catches to handle these errors gracefully (with maybe a console.warn about the rule)?

This kind of error is hard for you to fix because you can't control what rules people will put into their configs and what version of stylelint npm will install exactly. It was exasperated by vscode because it installs the minimum possible version of a dependency linsted in a plugin (e.g. @^7.5.0 installs 7.5.0 even if 7.8.0 is available).