-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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.2 Syntax Support #2935
Comments
Hi, I'm implementing |
It's a little bit of a breaking change on the side of lint fixers - because they now have to handle the new case, and if they don't then they'll break code. Hmmm... we also have Another example - we have I'm not sure what is better. I think it's probably best to just go with adding the |
I think so too. However, I concern that if adding Also I'm personally not positive about adding |
semver gets kind of fuzzy in this regard. But exactly what the definition of a "backwards incompatible change" isn't well defined. From an AST POV - this is purely a feature additon (minor bump), and for all consumption cases it's consistent and non-breaking. It's only breaking for those that are making code emission decisions based off of the AST. I don't know - it's the first time I've had to make one of these decisions 😅 . |
Thank you. So let's add |
the type A = abstract new () => object;
interface B {
abstract new (): object; // 'abstract' modifier cannot appear on a type member. (1070)
} would this restriction have implications on AST design? |
No. Method signatures are an entirely different AST node to function types. |
The noPropertyAccessFromIndexSignature flag, if turned on and code is changed to appease tsc, causes the @typescript-eslint/dot-notation rule to be triggered. I'm mentioning it here because that flag is under the |
As that is not syntax, I have filed #3104. Happy to accept a PR! |
That's what I get for skimming the issue title and focussing on 4.2... Thanks, and sorry about that! |
i started working on this and there seem to be some additional changes: new node will be needed |
https://devblogs.microsoft.com/typescript/announcing-typescript-4-2-beta/
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.
Leading/Middle Rest Elements in Tuple Types
This will not require any AST changes.
Smarter Type Alias Preservation
This will not require any AST changes.
Having a quick look on ts-ast-viewer, it looks like the types API continues to work as it did previously, but there is additional information stored on the type (the internal
origin
property) which stores the de-normalised union.I don't think this will impact any of our rules, but we'll find out with tests.
Template Literal Expressions Have Template Literal Types
This will not require any AST changes.
Having a quick look on ts-ast-viewer, it just means the types will be template literal types.
I don't think we've gone through and fully checked compat with our rules and template literal types yet - but given this will increase the prevalence of template literal types, we might have to go through and check our rules.
abstract
Construct SignaturesThis will require AST changes.
--noPropertyAccessFromIndexSignature
This will not require any AST changes.
The
dot-notation
extension rule will require work so that it can coexist with this compiler option (#3104).Other changes with no impact to us
in
Operator No Longer Allows Primitive Types on the Right Side)--explainFiles
to understand why files have been included in a programnoImplicitAny
Errors Apply to Looseyield
ExpressionsThe text was updated successfully, but these errors were encountered: