Skip to content

Commit

Permalink
CR fix comment on unsupported cases and remove TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
omril1 committed Sep 29, 2022
1 parent 585e197 commit befa01f
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
Expand Up @@ -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 =>
({
Expand Down Expand Up @@ -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;',
Expand Down Expand Up @@ -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;',
// },
// ],
// },
// ],
// },
],
});

0 comments on commit befa01f

Please sign in to comment.