eslint-plugin-jsdoc 65.3.10 → 65.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -914,13 +914,24 @@ export default iterateJsdoc(({
|
|
|
914
914
|
return;
|
|
915
915
|
}
|
|
916
916
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
917
|
+
// Type parameters of a function type or signature (e.g.,
|
|
918
|
+
// `<T>(x: T) => T` or `{<T>(x: T): T}`) are in scope anywhere
|
|
919
|
+
// within that function type
|
|
920
|
+
/**
|
|
921
|
+
* @type {import('jsdoc-type-pratt-parser').NonRootResult & {
|
|
922
|
+
* _parent?: import('jsdoc-type-pratt-parser').NonRootResult,
|
|
923
|
+
* typeParameters?: import('jsdoc-type-pratt-parser').TypeParameterResult[]
|
|
924
|
+
* }|undefined}
|
|
925
|
+
*/
|
|
926
|
+
let ancestor = parent;
|
|
927
|
+
while (ancestor) {
|
|
928
|
+
if (ancestor.typeParameters?.some((typeParam) => {
|
|
920
929
|
return value === typeParam.name.value;
|
|
921
|
-
})
|
|
922
|
-
|
|
923
|
-
|
|
930
|
+
})) {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
ancestor = ancestor._parent;
|
|
924
935
|
}
|
|
925
936
|
|
|
926
937
|
if (parent?.type === 'JsdocTypeInfer' && value === parent.element.value) {
|
|
@@ -77,11 +77,10 @@ export default iterateJsdoc(({
|
|
|
77
77
|
|
|
78
78
|
// eslint-disable-next-line no-console -- Warning user
|
|
79
79
|
console.warn('⚠️ typescript is not installed. `jsdoc/no-unnecessary-type-assertion` will not work. To disable this warning, you must disable the rule.');
|
|
80
|
+
return;
|
|
80
81
|
} finally {
|
|
81
82
|
tsAttempted = true;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
return;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
const types = utils.getTags('type');
|