-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
TypeScript 5.2 Support #7155
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
Comments
Can I work on this? (Of course, I all know that this won't be accepted until the RC is released) |
Feel free! |
Would be nice to have new
To allow AsyncDisposableStack.adopt<void>(value: void, onDisposeAsync: (value: void) => void | PromiseLike<void>): void Use case const dox = async (): Promise<void> => {}
const undox = async (): Promise<void> => {}
stack.adopt(
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
await dox(),
undox,
) |
@loynoir By passing Based on my reading of the spec - I think you'd be better to use {
using stack = new AsyncDisposableStack();
await dox();
stack.defer(undox);
// ...
// undox is called
} |
I don't know if it's too late to change proposal-explicit-resource-management to enforce pair-using. And |
What do you mean by a "guaranteed pair"? The idea behind
|
? > var ADS=require('core-js-pure/full/async-disposable-stack/index.js')
[Function: AsyncDisposableStack]
> var stack=new ADS()
AsyncDisposableStack {}
> stack.adopt(undefined,()=>console.log(42))
undefined
> await stack.disposeAsync()
42
await dox() |
What I'm saying is that code could be rewritten and it would do the same: // yours
stack.adopt(await a(), b);
// same as
await a();
stack.adopt(undefined, b);
// same as
await a();
stack.defer(b);
// same as
stack.defer((await a(), b)); I.e. you're just using I don't think that this is something we'll look to support. |
Same for machine, not same for human. await a_long_long_long_init(
p0_long_long_long(),
p1_long_long_long(),
p2_long_long_long(),
)
// oops, no `b`, no err
|
But again - there's nothing enforcing you do this. This is just a convention you've created. Your code could also be refactored to be I think I've gathered enough information to say that we won't be looking to have such a feature with the initial release. It doesn't seem like it's going to be a common pattern for the reason provided. Its too early to tell exactly how people will use the new api and syntax so we're not looking to introduce lint rules about them for now. |
The RC is out - so we should look to implementing this soon |
I upgraded to 5.2 and my linting started failing with:
Before 5.2, this was a warning:
I had a hard time figuring out where these errors were coming from because ESLint would not provide a stack trace, but I'm pretty sure it's coming either from this project or the I mention this because I don't see it mentioned in the original issue. Is this something you're aware of/is your responsibility? (Sorry if this is a red herring... I had to do a bunch of guesswork with |
This would be a reasonable place to file that! But:
Make sure you're on the latest version of our tooling. We haven't used |
The only mention of typescript-eslint/packages/typescript-estree/src/node-utils.ts Lines 517 to 522 in 9dcc1d1
|
Thanks for the pointers! You saved me a lot of time in chasing this down: ultimately, a caching issue resolved by removing |
This will be released with our next release |
Question on this -- during the period when there's a new TS release and this plugin has caught up with it, there does not seem to be any way to resolve yarn dependencies other than pinning back TypeScript, which I do not want to do. Why can't |
https://typescript-eslint.io/users/dependency-versions#version-warning-logs For a lot of new TS versions our tooling will "just work" before we have official support - new syntax sometimes will also "just work". It's the rare case that our tooling actively breaks due to a TS release. So why should we force people to wait for us to explicitly version bump when it's likely things will work fine? |
Okay, its just a very annoying situation if you happen to be building a new project in the 5 days when this is being sorted out, and you don't want to see that loud warning every time you run eslint. I ended up hacking yarn.lock to work around it. I get the reasoning though. |
https://typescript-eslint.io/packages/parser#warnonunsupportedtypescriptversion |
…eslint/typescript-eslint#7155 (comment) Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
* yarn lock again whoops Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * aws-sdk client config service updated Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * updated oclif Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * updated express Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * fs-extra Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * lodash Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * mustache Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * prompt-sync Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * tmp Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * uuid Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * xml2js Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * eslint Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * ajv Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * aws-sdk Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * axios Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * dotenv Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * fast-xml-parser Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * moment Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * table Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * typescript Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * winston Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * yaml Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * can't update @typescript-eslint until their next release: typescript-eslint/typescript-eslint#7155 (comment) Signed-off-by: Amndeep Singh Mann <amann@mitre.org> * gotta pull back the typescript version too Signed-off-by: Amndeep Singh Mann <amann@mitre.org> --------- Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-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.
✅ using Declarations and Explicit Resource Management (#7479)
This will require new AST based on the estree AST
✅ lib.d.ts Updates (#7451)
We will need to regenerate our types within
scope-manager
.Other changes with no impact to us
labeledElementDeclarations
May Holdundefined
ElementsThe text was updated successfully, but these errors were encountered: