Skip to content

Commit 657c67c

Browse files
simonseyockbrettz9
authored andcommitted
fix(valid-types): parse name paths as permissive.
1 parent 88cc18c commit 657c67c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/rules/validTypes.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ export default iterateJsdoc(({
1717
} = context.options[0] || {};
1818
const {mode} = settings;
1919

20-
const tryParseIgnoreError = (path) => {
20+
const tryParsePathIgnoreError = (path) => {
2121
try {
22-
if (mode === 'permissive') {
23-
tryParse(path);
24-
} else {
25-
parse(path, mode);
26-
}
22+
tryParse(path);
2723

2824
return true;
2925
} catch {
@@ -36,7 +32,7 @@ export default iterateJsdoc(({
3632
// eslint-disable-next-line complexity
3733
jsdoc.tags.forEach((tag) => {
3834
const validNamepathParsing = function (namepath, tagName) {
39-
if (tryParseIgnoreError(namepath)) {
35+
if (tryParsePathIgnoreError(namepath)) {
4036
return true;
4137
}
4238
let handled = false;
@@ -45,21 +41,21 @@ export default iterateJsdoc(({
4541
switch (tagName) {
4642
case 'module': {
4743
if (!namepath.startsWith('module:')) {
48-
handled = tryParseIgnoreError(`module:${namepath}`);
44+
handled = tryParsePathIgnoreError(`module:${namepath}`);
4945
}
5046
break;
5147
}
5248
case 'memberof': case 'memberof!': {
5349
const endChar = namepath.slice(-1);
5450
if (['#', '.', '~'].includes(endChar)) {
55-
handled = tryParseIgnoreError(namepath.slice(0, -1));
51+
handled = tryParsePathIgnoreError(namepath.slice(0, -1));
5652
}
5753
break;
5854
}
5955
case 'borrows': {
6056
const startChar = namepath.charAt();
6157
if (['#', '.', '~'].includes(startChar)) {
62-
handled = tryParseIgnoreError(namepath.slice(1));
58+
handled = tryParsePathIgnoreError(namepath.slice(1));
6359
}
6460
}
6561
}

0 commit comments

Comments
 (0)