Configure `tsconfig.json` to only load `@types/node` for Node programs
See original GitHub issueConfigure 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:
- Created 3 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top 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 >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
@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.)
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.