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.

Suggestion

As a professional TypeScript developer, I start new TS projects all the time. I use tsc --init sometimes, but more often than not I copy tsconfig.json files from other projects because I find the tsconfig.json file that is generated to be horribly spammy.

Having a tsc --init command is valuable to me, because quite often I want to bootstrap a project quickly, but the comments get in my way, as they make it harder to read what the actual config of a project is, and generally look really messy. If I ever run tsc --init the first thing I do is strip out these comments.

I’d really appreciate a tsc --init-basic (or something like it) that provides the same basic configuration set but without any comments.

  • Note; I suspect this would be super simple to implement, and I’m looking for opportunities to start contributing, so if anyone can point me towards the appropriate area in the codebase, I’d be happy to submit this change myself.

🔍 Search Terms

tsconfig comments init

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn’t be a breaking change in existing TypeScript/JavaScript code
  • This wouldn’t change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript’s Design Goals.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
fatcerberuscommented, Oct 2, 2021

I quickly hacked together the Regular Expression I used and it’s not the prettiest, but it works

ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚​N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ

🚎

1reaction
MartinJohnscommented, Oct 1, 2021

@andrewbranch I’m generally opposing any new flags or options that bring no real benefit, and I’d say this flag brings no real benefit. It adds bloat (code and feature wise) and is just another option to do the same thing, causing slight fragmentation. Also there’s a possible risk of those two init configs diverging, although I believe the code already is smarter than that and the file(s) would be / is generated dynamically.

If a lot of people consider this a value worth adding, I’d say go ahead. But for a few individual cases there are plenty of alternative options (e.g. extending config from npm package, copy existing file, have a local command that generates the file), although these would have to be maintained to make use of new flags in newer versions.

I can see the appeal, but my gut feeling towards such features is a no.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I generate a tsconfig.json file? - Stack Overflow
The correct command is --init not init : $ tsc --init. Try to run in your console the following to check the version:...
Read more >
tsc-init - npm
A command to initialize TypeScript and Webpack. Latest version: 2.1.0, last published: 5 years ago. Start using tsc-init in your project by ...
Read more >
tsc --init - Medium
“tsc --init” · tsc is the TypeScript compiler and has a command line interface with plenty of available options. · *Let's go over...
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
How to generate a tsconfig.json file | bobbyhadz
Install typescript globally: npm install typescript@latest -g . Generate a tsconfig file by running: tsc --init . Open your terminal in your project's...
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