Comments (3)
There are special libraries on npm for that.
But I don’t use it and have something like:
let test: string = id
from check-dts.
Ah that makes a lot of sense, thanks! That works perfectly (as expected, warning when using the wrong type):
![image](https://private-user-images.githubusercontent.com/2801252/320923283-7c29a0be-f487-436a-9d7a-a4a0105b3be0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY5MDkxNjgsIm5iZiI6MTcxNjkwODg2OCwicGF0aCI6Ii8yODAxMjUyLzMyMDkyMzI4My03YzI5YTBiZS1mNDg3LTQzNmEtOWQ3YS1hNGEwMTA1YjNiZTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MjhUMTUwNzQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTM3YjY4Zjk0NGVlNDA2YjcxNGE1ODViNzNjZjg0YWQ3OGU5YjVmZTdkNTM0YTVlNGI3MGY3MWE3YTQ1YTVlMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._6JN3P1eSflC5mqmEokh5GaNzjefuCkYtucdSovf1ks)
Do you want me to do a PR adding this as an example? Maybe in the FAQ? Closing for now since it's solved
from check-dts.
Sure, good idea. Let’s add it to docs.
from check-dts.
Related Issues (13)
- Node.js v15 compatibility? HOT 8
- Different behavior for different end of line characters HOT 4
- Not working in NodeJS <12.16.0 HOT 3
- Error when project has JavaScript files HOT 15
- DataCloneError when using with TypeScript 4.5.0-dev.x HOT 3
- 'extends' option does not supported HOT 2
- Checking IntelliSense? HOT 9
- Duplicated if statements HOT 2
- TypeError: Cannot read properties of undefined (reading 'text') when an error does not have the file prop HOT 6
- Support comments in tsconfig.json HOT 1
- Shows `undefined` instead of list of errors HOT 2
- Add custom tsconfig.json support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from check-dts.