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 add lint rule for AMD node imports 2023-07-04 11:31:36 +02:00
code-declare-service-brand.ts eslint: add a new rule to enforce declare _serviceBrand: undefined (#165396) 2022-11-03 10:32:37 -07:00
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 from ESM land bring over amdX-util and bring over one of its usages (#186748) 2023-06-30 09:05:06 -07:00
code-layering.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
code-must-use-result.ts eng: add a basic 'must use result' and ensure assertSnapshot result is used (#194744) 2023-10-03 20:08:56 +01:00
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 Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
code-no-native-private.ts add lint-rule to discourage native private fields (#186735) 2023-06-30 06:13:18 -07:00
code-no-nls-in-standalone-editor.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
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 Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
code-no-test-async-suite.ts Warn on async suites (#188378) 2023-07-28 17:04:23 +01:00
code-no-test-only.ts Add eslint rule for suite.only (#170994) 2023-01-10 19:57:05 +01:00
code-no-unexternalized-strings.ts Introduce localize2 function (#194750) 2023-10-04 12:57:38 -07:00
code-no-unused-expressions.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
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 Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
index.js Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
tsconfig.json Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
utils.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-cancellation.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-create-func.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-event-naming.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-interface-naming.ts Alexr00/showLocalAPI (#173798) 2023-02-09 09:53:24 +01:00
vscode-dts-literal-or-types.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-provider-naming.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-region-comments.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-string-type-literals.ts add lint rule to prevent type discrimination properties in API types (#180829) 2023-04-25 11:22:28 -07:00
vscode-dts-use-thenable.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00
vscode-dts-vscode-in-comments.ts Re-enable running our eslint rules using ts-node (#159495) 2022-08-30 08:40:04 +02:00