Skip to content

Commit d36b6d5

Browse files
JoshuaKGoldbergbrettz9
authored andcommitted
Account for null node
1 parent f77cf2a commit d36b6d5

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5312,6 +5312,23 @@ export function transient<T>(target?: T): T {
53125312
* @internal
53135313
*/
53145314
// Settings: {"jsdoc":{"mode":"typescript"}}
5315+
5316+
interface WebTwain {
5317+
/**
5318+
* Converts the images specified by the indices to base64 synchronously.
5319+
* @function WebTwain#ConvertToBase64
5320+
* @returns {Base64Result}
5321+
5322+
ConvertToBase64(): Base64Result;
5323+
*/
5324+
5325+
/**
5326+
* Converts the images specified by the indices to base64 asynchronously.
5327+
* @function WebTwain#ConvertToBase64
5328+
* @returns {boolean}
5329+
*/
5330+
ConvertToBase64(): boolean;
5331+
}
53155332
````
53165333

53175334

src/rules/checkTagNames.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ export default iterateJsdoc(({
123123
return false;
124124
}
125125

126-
if (context.getFilename().endsWith('.d.ts') && node.parent.type === 'Program') {
126+
if (context.getFilename().endsWith('.d.ts') && [
127+
'Program', null, undefined,
128+
].includes(node?.parent?.type)) {
127129
return false;
128130
}
129131

test/rules/assertions/checkTagNames.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,5 +1282,26 @@ export default {
12821282
},
12831283
},
12841284
},
1285+
{
1286+
code: `
1287+
interface WebTwain {
1288+
/**
1289+
* Converts the images specified by the indices to base64 synchronously.
1290+
* @function WebTwain#ConvertToBase64
1291+
* @returns {Base64Result}
1292+
1293+
ConvertToBase64(): Base64Result;
1294+
*/
1295+
1296+
/**
1297+
* Converts the images specified by the indices to base64 asynchronously.
1298+
* @function WebTwain#ConvertToBase64
1299+
* @returns {boolean}
1300+
*/
1301+
ConvertToBase64(): boolean;
1302+
}
1303+
`,
1304+
parser: require.resolve('@typescript-eslint/parser'),
1305+
},
12851306
],
12861307
};

0 commit comments

Comments
 (0)