Skip to content

Commit 4da4aeb

Browse files
committedMay 9, 2024·
fix(valid-types): disable checking of types/names within import tags; fixes #1226
1 parent e343ab5 commit 4da4aeb

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
 

‎docs/rules/valid-types.md

+4
Original file line numberDiff line numberDiff line change
@@ -880,5 +880,9 @@ function quux() {
880880
function quux() {
881881

882882
}
883+
884+
/**
885+
* @import { TestOne, TestTwo } from "./types"
886+
*/
883887
````
884888

‎src/rules/validTypes.js

+6
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ export default iterateJsdoc(({
212212
continue;
213213
}
214214

215+
if (tag.tag === 'import') {
216+
// A named import will look like a type, but not be valid; we also don't
217+
// need to check the name/namepath
218+
continue;
219+
}
220+
215221
if (tag.tag === 'borrows') {
216222
const thisNamepath = /** @type {string} */ (
217223
utils.getTagDescription(tag)

‎test/rules/assertions/validTypes.js

+7
Original file line numberDiff line numberDiff line change
@@ -1853,5 +1853,12 @@ export default {
18531853
}
18541854
`
18551855
},
1856+
{
1857+
code: `
1858+
/**
1859+
* @import { TestOne, TestTwo } from "./types"
1860+
*/
1861+
`,
1862+
}
18561863
],
18571864
};

0 commit comments

Comments
 (0)
Please sign in to comment.