Convert configs from .json to .js or .ts
See original GitHub issueI’m submitting a discussion request
-
Language: all
-
Loader/bundler: all
Current behavior:
Config files are now mostly in .json format which does not allow comments. https://stackoverflow.com/questions/244777/can-comments-be-used-in-json
- What is the desired behavior? Have most config files in .js format Like webpack.config.js
module.exports = {
// same json, but now it can have comments along
}
- What is the motivation / use case for changing the behavior?
I think it would be useful to have commented config files. It improves usage by new developers. And is generally a good practice. Like in website usage - every additional step increases drop rate. Figuring out what that line means and how to use it now requires… If it’s not mentioned in the docs -> hours of googling and parsing the issues That is for the patient ones
Some drawbacks: I guess that now configs are read and modified as objects and are written the same way by the CLI. Maintaining that ease of modifying config with CLI would be a challenge.
there is a jsonc parser by MS https://github.com/Microsoft/node-jsonc-parser
but no writer of course…
Well It is a dream of improving something for newcomers Not actionable
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
I think most coders will disagree 😃
bump