-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for TOML? #150
Comments
This is actually already doable via loaders. This functionality was recently added by davidtheclark in this pull request. If anything about it is unclear please let me know and I'll try to help out. |
@olsonpm cool! I wonder if we can make TOML supported by default instead of requiring additional setting |
I don't think we'll be adding more defaults. It's just too hard a line to draw on when to stop adding out-of-the-box supported languages and syntaxes - which is one of the reasons making it an option works well. |
Thanks @foray1010. I like the article: I find it convincing and I'll try using TOML more often :) @olsonpm is right, though, that we won't be adding another default for TOML — not unless we see common reliance on it among cosmiconfig users. The "users" of cosmiconfig are not, however, the end users of tools like stylelint, but the authors of tools like stylelint. If stylelint users want TOML configuration, that's a feature request for stylelint; if lint-staged users want TOML configuration, that's a feature request for lint-staged. If stylelint and lint-staged and some other users then express that they'd like cosmiconfig to turn on TOML by default, we'd consider it.
Cosmiconfig should not be in control of this — that is, should not be making the decisions about adding more default configuration formats to libraries, unless those libraries want them. So I'm happy to leave this issue open to see if library authors do want to add TOML to the defaults. |
Chiming in here just to say that I also think toml is superior to json and yaml. The Rust (cargo.toml) and Python (pyproject.toml) community seems to think so too. |
Chiming in with an additional point of data, since I'm in favor of this: Prettier has had TOML support since August 2018. |
This comment was marked as spam.
This comment was marked as spam.
Just checking if there is any new opinions on this, I also need TOML and I'd reckon at this point it's caught some more traction enough to justify it as part of default loaders. |
Sounds like a good idea. What's the go-to lightweight parser for this? The apparently most popular parser, |
Hi there, I see that this issue seem to be currently blocked by the lack of libraries. I don't want it to sound like self-promo but I'm the maintainer of https://www.npmjs.com/package/smol-toml, a lightweight TOML parser compliant with the 1.0.0 spec. Some prominent tools such as knip, rust-cache and unjs's confbox have adopted it, so I think it has seen quite a handful of real-world TOML files and I haven't heard about parsing issues for a while (which is something I'm happy about!). I think it can fit the needs of cosmiconfig and bring native TOML support to this already very handy lib |
Would you mind me adding support for TOML? Because TOML looks simpler and less error-prone
There is a good article explaining the reason why TOML is better than YAML
https://arp242.net/weblog/yaml_probably_not_so_great_after_all.html
The text was updated successfully, but these errors were encountered: