From befa01f0c8c9166748c491fad01d0d800a368bb9 Mon Sep 17 00:00:00 2001 From: Omri Luzon Date: Thu, 29 Sep 2022 03:35:03 +0300 Subject: [PATCH] CR fix comment on unsupported cases and remove TODO comments --- .../tests/rules/prefer-optional-chain.test.ts | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts index 0a5aee2d2af..58b309edcc8 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts @@ -133,11 +133,6 @@ const baseCases = [ code: 'foo.bar && foo.bar?.() && foo.bar?.().baz', output: 'foo.bar?.()?.baz', }, - // TODO: deepest left node already pre-optional chained - // { - // code: 'foo?.bar && foo.bar?.() && foo.bar?.().baz', - // output: 'foo?.bar?.()?.baz', - // }, ].map( c => ({ @@ -209,7 +204,7 @@ ruleTester.run('prefer-optional-chain', rule, { // currently do not handle 'this' as the first part of a chain 'this && this.foo;', '!this || !this.foo;', - // currently do not handle mixed TSNonNullExpression in properties + // intentionally do not handle mixed TSNonNullExpression in properties '!entity.__helper!.__initialized || options.refresh;', '!foo!.bar || !foo!.bar.baz;', '!foo!.bar!.baz || !foo!.bar!.baz!.paz;', @@ -1324,21 +1319,5 @@ foo?.bar(/* comment */a, }, ], }, - // TODO: deepest left node already pre-optional chained - // { - // code: '!foo?.bar || !foo?.bar.baz;', - // output: null, - // errors: [ - // { - // messageId: 'preferOptionalChain', - // suggestions: [ - // { - // messageId: 'optionalChainSuggest', - // output: '!foo?.bar?.baz;', - // }, - // ], - // }, - // ], - // }, ], });