Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): update to TypeScript 4.1 #7573

Merged
merged 7 commits into from
Nov 23, 2020
Merged

feat(cli): update to TypeScript 4.1 #7573

merged 7 commits into from
Nov 23, 2020

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Sep 19, 2020

This PR updates Deno to TypeScript 4.1 beta in advance of TypeScript 4.1 being released to give an early view into any issues.

TypeScript 4.1 tightens up Promise definitions and there are quite a few instances in the code base where the type checking is failing due to this.

@kitsonk kitsonk marked this pull request as draft September 19, 2020 05:08
@Skillz4Killz
Copy link

Hey 👋

I was wondering what the plans are for --noUncheckedIndexedAccess? This was added in TS 4.1 and is probably one of the greatest additions to TS since forever and I did not see any mention of it. Recently, Deno made an update which enabled stricter configurations in tsconfig by default for imports. I believe this should also apply to noUncheckedIndexedAccess. It prevents so many issues/bugs because without it the types provided by TS are just plain wrong. One of the best parts I love about Deno is that you can remove all the extra files like tsconfig, eslintrc, prettier etc... Having to create a tsconfig just to have this enabled is kinda silly. I believe Deno by default should always encourage safety/strictness!

Thank You

@kitsonk
Copy link
Contributor Author

kitsonk commented Sep 19, 2020

@Skillz4Killz my personal opinion is that we don't enable it by default, as mentioned in the PR for it, the TypeScript core team says that they won't make it part of --strict mode (yet) and they don't think it is a sensible default (unlike the rest of the strict options):

  • We do not intend to make this part of the --strict family with its current behavorial limitations, so anything starting with strict is a no-go
    • If, in the future, we find a way to make this palatable (i.e. can be turned on with nearly zero false positives), we can make it be an alias for a new --strictIndexSignatures setting
  • We don't really think this is a great mode to be in by default, so the name should connote "Here be dragons" in terms of ergonomics

While I agree it is a really useful feature for very strongly typed code, I don't think we can unleash it as a default on everyone. People can of course still enable it via use of the --config flag. We may want to experiment with std though, just as we ensured that std was strict safe before we turned it on by default.

@kitsonk kitsonk force-pushed the ts-41 branch 2 times, most recently from 60db772 to b356148 Compare November 5, 2020 03:42
@kitsonk kitsonk changed the title [WIP] Update to TypeScript 4.1 feat(cli): update to TypeScript 4.1 Nov 19, 2020
@kitsonk kitsonk marked this pull request as ready for review November 19, 2020 22:51
@kitsonk kitsonk requested a review from bartlomieju November 19, 2020 22:51
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

std/node/_fs/_fs_writeFile_test.ts Show resolved Hide resolved
@bartlomieju
Copy link
Member

TypeScript 4.1 tightens up Promise definitions and there are quite a few instances in the code base where the type checking is failing due to this.

Maybe we should hold off this update till Deno 1.6.0 then?

@bartlomieju bartlomieju added this to the 1.6.0 milestone Nov 21, 2020
@kitsonk kitsonk merged commit 276f529 into denoland:master Nov 23, 2020
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants