Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
#4326 - TypeError: Cannot read property 'param' of undefined (#4895)
Browse files Browse the repository at this point in the history
* creating rule

* rule written

* rule replicated

* isolated rule

* added test files back in

* captured case of this.contentTags being undefined

* added documentation to test
  • Loading branch information
ChaiWithJai authored and Josh Goldberg committed Dec 8, 2019
1 parent c4e16a0 commit 5ba08f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rules/completed-docs/tagExclusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export class TagExclusion extends Exclusion<ITagExclusionDescriptor> {
return true;
}

if (this.contentTags === undefined) {
return false;
}

const matcherBody = this.contentTags[tagWithContent[0]];
if (matcherBody === undefined) {
continue;
Expand Down
5 changes: 5 additions & 0 deletions test/rules/completed-docs/defaults/edge-case/test.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Snippet where no error occurs (But completed-docs correctly gives an error on the lack of jsdoc).
* @returns {Promise<Object>}
*/
export const handler = async () => { ... }
13 changes: 13 additions & 0 deletions test/rules/completed-docs/defaults/edge-case/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"rules": {
"completed-docs": [
true,
{
"variables": {
"visibilities": ["exported"],
"tags": { "existence": [""] }
}
}
]
}
}

0 comments on commit 5ba08f0

Please sign in to comment.