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.

Add TypeScript support

See original GitHub issue

Issue To Be Solved

Add support for TypeScript, so that autocomplete and other developer tooling works.

(Optional): Suggest A Solution

Solution 1: Rewrite in TypeScript

Pretty self explanatory. Would probably take weeks because TypeScript usually messes you up at edge cases. This would automatically generate type definitions when building to JavaScript.

Solution 2: Add TypeScript declaration file

Create .d.ts file. This would have to be maintained “separately” if the code base stays in plain JavaScript. Separately means here that you might forget to update the .d.ts file and functions don’t conform to it.


Comparison

Solution 1 (rewrite) is certainly more work than solution 2 (type declarations). TypeScript is widely used right now and many developers would consider it easier to contribute to the codebase after solution 1, if it was fully written in TypeScript - (which may or may not be objectively true).

(Optional): Context

Its not blocking anything, but it makes development a little harder because you always have to check out the docs and (depending on the strictness of your config) TypeScript constantly yells at you for missing types.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
janhesterscommented, Dec 12, 2021

I made a PR with the typings I did for my personal project here. So far it has types for config and onceSealed. Commits / feeback welcome!

0reactions
hotrungnhancommented, Apr 19, 2022

@justinbarry why dont your guy support typescript by default , or using typescript in the future ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do...
Read more >
How to Add TypeScript to a JavaScript Project - freeCodeCamp
How to convert a JavaScript application to support TypeScript. · Install typescript · Typescript config file · Create your first .TS file in...
Read more >
Add TypeScript support to an existing codebase | by Billel
Add TypeScript support to an existing codebase · Install typescript npm package and node type definitions. Just run npm i --save-dev typescript @types/node ......
Read more >
Adding TypeScript - Create React App
Global installs of create-react-app are no longer supported. To add TypeScript to an existing Create React App project, first install it:.
Read more >
Adding TypeScript-support to your Node.js project
If your application already has build tooling set up via webpack, the easiest way to add TypeScript support is by using the ts-loader...
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