Closed dhess closed 2 months ago
Upstream tidy uses the TypeScript “disposable” pattern by copy-pasting some boilerplate-y code: https://github.com/zxch3n/tidy/blob/master/src/dispose.ts
tidy
If I understand correctly, this pattern is built into (in preview form) recent versions of TypeScript: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html. It can be enabled as follows:
{ "compilerOptions": { "target": "es2022", "lib": ["es2022", "esnext.disposable", "dom"] } }
Assuming we implement #1186, we should look into enabling this and refactoring the vendored code to use it.
I don't think we can easily use using, but we can use the built-in Disposable interface.
using
Disposable
Upstream
tidy
uses the TypeScript “disposable” pattern by copy-pasting some boilerplate-y code: https://github.com/zxch3n/tidy/blob/master/src/dispose.tsIf I understand correctly, this pattern is built into (in preview form) recent versions of TypeScript: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html. It can be enabled as follows:
Assuming we implement #1186, we should look into enabling this and refactoring the vendored code to use it.