!xfqwqigUlAuUTEIPwA:matrix.org

TypeScript

1327 Members
A superset of JavaScript that compiles to clean JavaScript output. https://www.typescriptlang.org/49 Servers

Load older messages


SenderMessageTime
21 Sep 2020
@gitter_aishasadat123:matrix.orgAishasadat123 (Gitter) (edited) ... the diffrent in ... => ... the different in ... 08:37:28
@gitter_rraziel:matrix.orgRaziel (Gitter) You can go the lazy route of using date-fns' differenceInDays 08:40:17
@gitter_rraziel:matrix.orgRaziel (Gitter) (or just look at its source if you don't want the dependency) 08:40:34
@gitter_aishasadat123:matrix.orgAishasadat123 (Gitter) @rraziel sorry i did not understand 08:46:09
@gitter_rraziel:matrix.orgRaziel (Gitter) https://date-fns.org/v1.29.0/docs/differenceInDays 08:49:30
@gitter_aishasadat123:matrix.orgAishasadat123 (Gitter) @rraziel i work but it does not show 08:57:02
@gitter_aishasadat123:matrix.orgAishasadat123 (Gitter)if you have time can you check my code?08:57:18
@gitter_dj-foxxy:matrix.orgPeter Sutton (Gitter) How do I prevent tsc printing errors and warnings for a given file path? A library I'm using has bad types. I want to suppress this path node_modules/indigo-player/src/types.ts 11:38:57
@shuixx:matrix.orgshuixx joined the room.13:24:43
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)Is there a way to tell TS to use strictNullChecks from within a file (no tsconfig.json)15:17:45
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)Like a pre-processor directive of sorts15:17:55
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter) microsoft/TypeScript#11386 15:19:56
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter) FML The answer seems to be "no" 15:20:01
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter) 15:48:44
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter) We're at TS 4 and this still doesn't work =( 15:48:51
@gitter_webstrand:matrix.orgwebstrand (Gitter)Are you trying to write scripts? Or just incorporate strict code into an otherwise non-strict project?15:50:24
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)trying to be unintrusive as possible, while adding types to untyped js code15:52:21
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter) I don't want to rearrange existing code just to fit TS stuff 15:52:42
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)Convincing the team to adopt it is going to be hard if it requires too many changes15:53:00
@gitter_rraziel:matrix.orgRaziel (Gitter)Not if you show the changes improve quality rather than just letting it compile15:54:22
@gitter_webstrand:matrix.orgwebstrand (Gitter)Well, depending on your build process, I think you can build specific files as isolatedModules, with strict checks enabled.15:55:25
@gitter_webstrand:matrix.orgwebstrand (Gitter) unless you're using JS annotations? 15:56:02
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)Yeah, JS annotations15:56:14
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)

I've already shown them the many places where it is awesome, I believe.
Caught a bunch of unused code, a bunch of missing validations, etc. by just adding a simple tsconfig.json with checkJs:true

But it still needs to be usable.

15:56:35
@gitter_keithlayne:matrix.orgKeith Layne (Gitter) you should have gone jsconfig.json so as not to scare them 15:57:05
@gitter_anyhowstep:matrix.orgAnyhowStep (Gitter)And being unable to selectively enable flags and the lack of narrowing by nested properties seem pretty bad15:57:11
@gitter_webstrand:matrix.orgwebstrand (Gitter)you might get away with writing a small compiler front-end?15:57:45
@gitter_keithlayne:matrix.orgKeith Layne (Gitter)hah15:57:56
@gitter_webstrand:matrix.orgwebstrand (Gitter)Then you just preload your preferred tsconfig15:58:01
@gitter_keithlayne:matrix.orgKeith Layne (Gitter) is there a build process already? Or are you just using vscode or noEmit or something? 15:59:35

There are no newer messages yet.


Back to Room List