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

TypeScript 4.7 Support #4800

Closed
bradzacher opened this issue Apr 9, 2022 · 3 comments · Fixed by #4829, #5027, #5067 or #5082
Closed

TypeScript 4.7 Support #4800

bradzacher opened this issue Apr 9, 2022 · 3 comments · Fixed by #4829, #5027, #5067 or #5082
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure dependencies Issue about dependencies of the package New TypeScript Version

Comments

@bradzacher
Copy link
Member

bradzacher commented Apr 9, 2022

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-rc/

This issue is just to track all of the new features and their implementation state in this project.
As with all releases, we will not necessarily to support all features until closer to the full release when everything the features are stabilised.

Please be patient.

🔲 New Extensions

We'll want to add .cjs, .mjs, .mts, and .cts (as well as .d.cts and .d.mts) to our parser tooling so that we can correctly detect file types and default supported extensions.

Some code pointers to start off:
[1] [2] [3] [4] [5]

Essentially just search for .ts and go from there.

✅ Instantiation Expressions (#4938)

This will require AST changes.

Babel: babel/babel#14457

// extend Expression
type Expression = Expression | TSExpressionWithTypeArguments;

// Add new node
interface TSExpressionWithTypeArguments {
  type: "TSExpressionWithTypeArguments";
  expression: Expression;
  typeParameters: TSTypeParameterInstantiation;
}

extends Constraints on infer Type Variables (#4830)

This is already supported and will not require AST changes

✅ Optional Variance Annotations for Type Parameters (#4831)

This will require AST changes.

Babel: babel/babel#14359

// extend TSTypeParameter
interface TSTypeParameter {
  in?: boolean;
  out?: boolean;
}

lib.d.ts Updates (#4829)

We will need to regenerate our types within scope-manager.


Other changes with no impact to us

  • ECMAScript Module Support in Node.js
  • type in package.json
  • CommonJS Interop
  • package.json Exports, Imports, and Self-Referencing
    • Though with the next major we'll probably want to explore this to lock down our APIs and prevent deep dist imports whilst also providing nicely structured deep imports (i.e. map utils/dist/foo => utils/foo)
  • Control over Module Detection
  • Control-Flow Analysis for Computed Properties
    • This will just make all of our rules more accurate for free!
  • Improved Function Inference in Objects and Methods
  • Resolution Customization with moduleSuffixes
  • resolution-mode
  • Groups-Aware Organize Imports
  • Object Method Snippet Completions
  • Type Parameters No Longer Assignable to {} in strictNullChecks
  • readFile Method is No Longer Optional on LanguageServiceHost
  • readonly Tuples Have a readonly length Property
@bradzacher bradzacher added dependencies Issue about dependencies of the package AST PRs and Issues about the AST structure labels Apr 9, 2022
@sosukesuzuki
Copy link
Contributor

Can I work on this? I know it is premature as TS 4.7 is still in beta, but after the RC version is released, typescript-eslint needs to support the feature as soon as possible.

@bradzacher
Copy link
Member Author

If you'd like to put up some early PRs based on the beta - feel free!

Though as you mention, we won't consider merging them till after the RC is released.

@bradzacher
Copy link
Member Author

4.7 is now in RC!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure dependencies Issue about dependencies of the package New TypeScript Version
Projects
None yet
2 participants