question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convert configs from .json to .js or .ts

See original GitHub issue

I’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:open
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
3cpcommented, Feb 20, 2019

if you need to comment code it generally means something needs to be improved.

I think most coders will disagree 😃

0reactions
Alexander-Tarancommented, Aug 10, 2021

bump

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting .json files to .ts files using tsc - Stack Overflow
js files. Now, I can convert the . ts files to . js files and store it into a different folder using the...
Read more >
How to Set Up Environment Variables using JSON files with ...
In today's JavaScript world, it's possible to read JSON Modules as follows: import config from '../../config.json' ...
Read more >
JSON.stringify() - JavaScript - MDN Web Docs
The JSON.stringify() static method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is ...
Read more >
Convert Cypress Specs from JavaScript to TypeScript
You might be thinking of converting the specs from JavaScript to TypeScript language. ... Step 13: Move to cypress.config.ts file ...
Read more >
jsconfig.json Reference - Visual Studio Code
Below are jsconfig "compilerOptions" to configure the JavaScript language support. Tip: Do not be confused by compilerOptions , since no actual compilation is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found