vscode/.eslintplugin
Matt Bierner ae91138701
Add eslint rule for potentially unsafe disposable patterns (#209555)
`DisposableStore`/`MutableDisposable` properties should almost always be `readonly`. Otherwise it's easy to accidentally overwrite the property and leak the previous value. This commonly happens with code such as:

```ts
class Foo {
     private disposables = new DisposableStore();

     bar() {
         this.disposables = new DisposableStore(); // leaks old values
         ...
     }
```

This change adds an eslint rule to enforce this and adopts `readonly` for the caught cases. I only needed to add 2 suppression comments, which seems like an acceptable tradeoff for helping catch a common mistake
2024-04-04 10:34:45 -07:00
..
code-amd-node-module.ts
code-declare-service-brand.ts
code-ensure-no-disposables-leak-in-test.ts eng: add a lint rule for ensureNoDisposablesAreLeakedInTestSuite (#200089) 2023-12-05 14:35:27 -08:00
code-import-patterns.ts
code-layering.ts
code-must-use-result.ts
code-must-use-super-dispose.ts make sure super.dispose is called inside overridden dispose methods (#200342) 2023-12-08 13:45:44 +01:00
code-no-global-document-listener.ts aux window - reduce deprecated $window usages (#197800) 2023-11-09 09:09:02 +01:00
code-no-look-behind-regex.ts
code-no-native-private.ts
code-no-nls-in-standalone-editor.ts
code-no-potentially-unsafe-disposables.ts Add eslint rule for potentially unsafe disposable patterns (#209555) 2024-04-04 10:34:45 -07:00
code-no-runtime-import.ts Allow type imports only in webview preloads (#204639) 2024-02-07 10:00:30 -08:00
code-no-standalone-editor.ts
code-no-test-async-suite.ts
code-no-test-only.ts
code-no-unexternalized-strings.ts
code-no-unused-expressions.ts
code-parameter-properties-must-have-explicit-accessibility.ts Fix injected services becoming public by mistake (#209513) 2024-04-04 08:06:16 +02:00
code-translation-remind.ts
index.js
tsconfig.json
utils.ts
vscode-dts-cancellation.ts
vscode-dts-create-func.ts
vscode-dts-event-naming.ts
vscode-dts-interface-naming.ts
vscode-dts-literal-or-types.ts
vscode-dts-provider-naming.ts
vscode-dts-region-comments.ts
vscode-dts-string-type-literals.ts
vscode-dts-use-thenable.ts
vscode-dts-vscode-in-comments.ts