Skip to content
Permalink
Browse files

fix(eslint-plugin): [no-unsafe-member-access] ignore MemberExpression…

…'s whose parents are either TSClassImplements or TSInterfaceHeritage (#2753)
  • Loading branch information
hsmitty93 committed Nov 11, 2020
1 parent abe33fb commit 535db3bf27ee1d7824ada9acd91d1b7833064628
@@ -71,7 +71,8 @@ export default util.createRule({
}

return {
MemberExpression: checkMemberExpression,
// ignore MemberExpression if it's parent is TSClassImplements or TSInterfaceHeritage
':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression': checkMemberExpression,
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
@@ -66,6 +66,12 @@ function foo(x?: string[]) {
x?.[(1 as any)++];
}
`,
`
class B implements FG.A {}
`,
`
interface B extends FG.A {}
`,
],
invalid: [
...batchedSingleLineTests({

0 comments on commit 535db3b

Please sign in to comment.
You can’t perform that action at this time.