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.

Configure `tsconfig.json` to only load `@types/node` for Node programs

See original GitHub issue

Configure tsconfig.json to only load @types/node for Node programs, and not to pollute code which runs on the browser with the following types.

Issue brought up in https://github.com/jpmorganchase/modular/pull/8#discussion_r428988654 and https://github.com/jpmorganchase/modular/pull/1#discussion_r428815379 (although the latter is more from ESLint’s perspective).

I suspect ‘solution-style tsconfig.json’ are the right approach but these are very new so might lack support.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
sebinsuacommented, May 26, 2020

@sanjayk I will not let anybody write code which looks like C# or Java. Trust me! 😆

(I like to write TypeScript code which is basically like simplistic JavaScript, to avoid complicated types and to try to only put types on function arguments and returns instead of interleaving them all over the place.)

1reaction
sebinsuacommented, May 26, 2020

My perspective is that we can make the code-base better by using TypeScript. Easier to understand, easier for others to contribute to, etc.

Does an excellent JavaScript engineer need TypeScript to help them refactoring some code? Generally not.

However, I’ve worked on JavaScript projects before with 100s of files, where refactoring caused lots of runtime errors that I had to painstakingly fix one-by-one. It is much easier to do this with a type-checker: you can often do what would have otherwise been extremely difficult refactors that might have taken a week or so or in just a day. Static typing is also a useful tool for power users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - What is a tsconfig.json - TypeScript
The tsconfig.json file specifies the root files and the compiler options required ... uses Node.js version 12 and above, then you could use...
Read more >
ts-node - npm
ts-node automatically finds and loads tsconfig.json . Most ts-node options can be specified in a "ts-node" object using their programmatic, ...
Read more >
Some tsconfig.json options are unintentionally overridden ...
We use ts-node when running Node.js Pulumi programs and policy packs. ... to only set the default values when tsconfig.json doesn't exist.
Read more >
How to use TypeScript with Node.js - Section.io
To initialize the Typescript project with Node.js, create a tsconfig.json file in the project root directory. The config file stores the options ...
Read more >
Configuration | ts-node - TypeStrong · GitHub
ts-node automatically finds and loads tsconfig.json . Most ts-node options can be specified in a "ts-node" object using their programmatic, camelCase names. We ......
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