Skip to content

Commit

Permalink
fix(eslint-plugin): fix property access on undefined error (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored and bradzacher committed Jan 24, 2020
1 parent 06731e7 commit d89e8e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -51,7 +51,7 @@ export default util.createRule<[], MessageIds>({

// TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502
if (
!param.default ||
!param?.default ||
param.default.getText() !== sourceCode.getText(arg)
) {
return;
Expand Down
Expand Up @@ -17,6 +17,7 @@ ruleTester.run('no-unnecessary-type-arguments', rule, {
valid: [
`f<>();`,
`f<string>();`,
`expect().toBe<>();`,
`class Foo extends Bar<> {}`,
`class Foo extends Bar<string> {}`,
`class Foo implements Bar<> {}`,
Expand Down

0 comments on commit d89e8e8

Please sign in to comment.