Use "Yaml", "Toml" or "JS" instead of "JSON" for Nx related files
See original GitHub issueDescription
The basic idea, behind it is, JSON, is not suited for configuration files. Personally, I like Yaml, TOML, but JS is a very nice alternative as well. There are a number of guides that describe why JSON isn’t a very good candidate for configuration files, but here are the top issues for me:
- Too much noise, especially in long JSON Files, makes it hard to find the information you want.
- Cannot handle Long String and different types of Numbers properly.
- Lack of programmatic nature. Can be extremely useful for configuration files.
It is also, a step towards other projects allowing more than JSON
for their configs. ESLint, and Prettier use all of the above options. It would be good if Nx
allowed it as well.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:5
Top Results From Across the Web
JSON vs XML vs TOML vs CSON vs YAML - Zion & Zion
Here's the ultimate breakdown: If you are writing code for other code to read, use YAML. If you are writing code that writes...
Read more >JSON vs. YAML vs. TOML - Martin Ueding
There are a bunch of data formats which can store structured data. The most popular seem to be JSON and YAML. A relatively...
Read more >YAML vs JSON – Which is better? - Linux Hint
YAML is an abbreviation of Yet Another Markup Language and is used to define configurations. It is lightweight and represents data in a...
Read more >How to create Kubernetes YAML files | by Piotr - ITNEXT
It is relatively straightforward to create a simple YAML file, but for production use, many more settings are required.
Read more >Dockerizing a Node.js Web Application - Semaphore Tutorial
json file that pm2 can use to run our application in production. $ npm install --save pm2. To make it easier to run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
one big issue is we can’t use comments in JSON. There are workaround but I think we should move to yaml. I think yaml is the choice for configuration file now after k8s is getting popular.
I also recommend https://jsonnet.org/, which adds tons of useful features to JSON: functions, imports, conditionals, etc.
It would allow creating helper functions, so the config like this:
will become