Skip to content

Commit

Permalink
Account for null node
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg authored and brettz9 committed Apr 10, 2023
1 parent f77cf2a commit d36b6d5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5312,6 +5312,23 @@ export function transient<T>(target?: T): T {
* @internal
*/
// Settings: {"jsdoc":{"mode":"typescript"}}

interface WebTwain {
/**
* Converts the images specified by the indices to base64 synchronously.
* @function WebTwain#ConvertToBase64
* @returns {Base64Result}

ConvertToBase64(): Base64Result;
*/

/**
* Converts the images specified by the indices to base64 asynchronously.
* @function WebTwain#ConvertToBase64
* @returns {boolean}
*/
ConvertToBase64(): boolean;
}
````


Expand Down
4 changes: 3 additions & 1 deletion src/rules/checkTagNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export default iterateJsdoc(({
return false;
}

if (context.getFilename().endsWith('.d.ts') && node.parent.type === 'Program') {
if (context.getFilename().endsWith('.d.ts') && [
'Program', null, undefined,
].includes(node?.parent?.type)) {
return false;
}

Expand Down
21 changes: 21 additions & 0 deletions test/rules/assertions/checkTagNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,5 +1282,26 @@ export default {
},
},
},
{
code: `
interface WebTwain {
/**
* Converts the images specified by the indices to base64 synchronously.
* @function WebTwain#ConvertToBase64
* @returns {Base64Result}
ConvertToBase64(): Base64Result;
*/
/**
* Converts the images specified by the indices to base64 asynchronously.
* @function WebTwain#ConvertToBase64
* @returns {boolean}
*/
ConvertToBase64(): boolean;
}
`,
parser: require.resolve('@typescript-eslint/parser'),
},
],
};

0 comments on commit d36b6d5

Please sign in to comment.