ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

feature_request(config): support YAML configuration format #31

Closed Kristinita closed 6 years ago

Kristinita commented 6 years ago

1. Summary

It would be nice, if Supermacy will support YAML configuration files. supermacy.yaml for example.

2. Argumentation

I think, JSON — bad idea. Main reason — I can't write comments, why I use those or other options. Another arguments:

3. Related issues:

Thanks.

ThisIsManta commented 6 years ago

I will add support for YMAL later. But personally, I hate YAML because of its less strict syntax. For example, string literals may or may not be wrapped in double-quotes. Arrays can be written in either [] or multiple lines with a hyphen in front of each line. This drives me crazy as I am a highly consistent person.

Regarding your concern with JSON as a configuration file, JSON5 exists. In fact, you can write Stylus Supremacy option files in JSON with comments now. I may consider replacing comment-json npm module with a nice JSON5 npm module in the future.

Kristinita commented 6 years ago

I will add support for YAML later.

Thanks, we wait it.

Kristinita commented 6 years ago

Regarding your concern with JSON as a configuration file, JSON5 exists. In fact, you can write Stylus Supremacy option files in JSON with comments now.

Supremacy and Stylint use one configuration file — .stylintrc. I use Stylint via Grunt — grunt-stylint. Grunt parser doesn't support comments in JSON file.

Thanks.

ThisIsManta commented 6 years ago

You can pass YAML as a formatting option file by writing the command stylus-supremacy -p options.yml at version 2.11. Just make sure that the file has .yml or .yaml extension.

Cheers!