Allow javascript (or typescript) config file
See original GitHub issueSuggestion
I suggest allowing a tsconfig.js or tsconfig.ts as an optional alternative to tsconfig.json.
Use Cases
What do you want to use this for? Primarily to add comments to the tsconfig file.
What shortcomings exist with current approaches? JSON does not allow comments. You can’t even hack in comments by adding fake fields like "_explanationOfTypeRoots"
, as the build complains about unknown compiler options and stops.
Examples
Many tools and frameworks allow javascript config files. Jest, for example. jest --init
produces a heavily commented config file, which is very useful for beginners.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:18 (2 by maintainers)
Top Results From Across the Web
TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript project... Compiler Options. Top Level....
Read more >Working with JavaScript in Visual Studio Code
It is possible to have mixed TypeScript and JavaScript projects. To start migrating to TypeScript, rename your jsconfig.json file to tsconfig.json and set...
Read more >how to load a js config file in a typescript npm package that ...
create a config.js file with export default 'hello world' · type npx someLibrary and see "hello world" in the terminal.
Read more >TypeScript configuration - Angular
It is a superset of JavaScript with design-time support for type safety and ... A given Angular workspace contains several TypeScript configuration files....
Read more >How to Add TypeScript to a JavaScript Project - freeCodeCamp
Typescript config file · We read all the files in the src or test or config directory (using the include flag). · We...
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 FreeTop 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
Top GitHub Comments
This makes little sense to me when so many other JS libraries support them.
#39441 names a few but there are plenty more that all allow this behaviour. If every one of them had a discussion on the same security concerns, then wouldn’t looking through their discussions yield the information needed to implement it in a safe and responsible fashion?
Oh, nice! I was under the impression that comments were not allowed in JSON, but it makes sense that someone would write a parser that allows them. Thank you for your response, I am closing the issue because I no longer think this feature is necessary.