Skip to content

Commit

Permalink
fix: add test coverage for TSParameterProperty and actually check it
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Aug 1, 2019
1 parent 2d53b12 commit 7b10c1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/typedef.ts
Expand Up @@ -76,7 +76,7 @@ export default util.createRule<[Options], MessageIds>({
annotationNode = param.left;
break;
case AST_NODE_TYPES.TSParameterProperty:
annotationNode = undefined;
annotationNode = param.parameter;
break;
default:
annotationNode = param;
Expand Down
11 changes: 11 additions & 0 deletions packages/eslint-plugin/tests/rules/typedef.test.ts
Expand Up @@ -381,6 +381,17 @@ ruleTester.run('typedef', rule, {
},
],
},
{
code: `class Test {
public constructor(public x) { }
}`,
errors: [
{
column: 28,
messageId: 'expectedTypedef',
},
],
},
// Property declarations
{
code: `type Test = {
Expand Down

0 comments on commit 7b10c1e

Please sign in to comment.