eslint-plugin-jsdoc 48.2.12 → 48.2.14
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.
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _parseImports = require("parse-imports");
|
|
8
8
|
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
9
|
+
var _iterateJsdoc = _interopRequireWildcard(require("../iterateJsdoc.cjs"));
|
|
9
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
12
|
const extraTypes = ['null', 'undefined', 'void', 'string', 'boolean', 'object', 'function', 'symbol', 'number', 'bigint', 'NaN', 'Infinity', 'any', '*', 'never', 'unknown', 'const', 'this', 'true', 'false', 'Array', 'Object', 'RegExp', 'Date', 'Function'];
|
|
@@ -72,11 +73,12 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
72
73
|
return stripPseudoTypes(preferredType.replacement);
|
|
73
74
|
}).filter(Boolean);
|
|
74
75
|
}
|
|
75
|
-
const
|
|
76
|
+
const comments = sourceCode.getAllComments().filter(comment => {
|
|
76
77
|
return /^\*\s/u.test(comment.value);
|
|
77
78
|
}).map(commentNode => {
|
|
78
79
|
return (0, _iterateJsdoc.parseComment)(commentNode, '');
|
|
79
|
-
})
|
|
80
|
+
});
|
|
81
|
+
const typedefDeclarations = comments.flatMap(doc => {
|
|
80
82
|
return doc.tags.filter(({
|
|
81
83
|
tag
|
|
82
84
|
}) => {
|
|
@@ -85,6 +87,54 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
85
87
|
}).map(tag => {
|
|
86
88
|
return tag.name;
|
|
87
89
|
});
|
|
90
|
+
const importTags = /** @type {string[]} */comments.flatMap(doc => {
|
|
91
|
+
return doc.tags.filter(({
|
|
92
|
+
tag
|
|
93
|
+
}) => {
|
|
94
|
+
return tag === 'import';
|
|
95
|
+
});
|
|
96
|
+
}).flatMap(tag => {
|
|
97
|
+
const {
|
|
98
|
+
type,
|
|
99
|
+
name,
|
|
100
|
+
description
|
|
101
|
+
} = tag;
|
|
102
|
+
const typePart = type ? `{${type}} ` : '';
|
|
103
|
+
const imprt = 'import ' + (description ? `${typePart}${name} ${description}` : `${typePart}${name}`);
|
|
104
|
+
let imports;
|
|
105
|
+
try {
|
|
106
|
+
// Should technically await non-sync, but ESLint doesn't support sync rules;
|
|
107
|
+
// thankfully, the Wasm load time is safely fast
|
|
108
|
+
imports = (0, _parseImports.parseImportsSync)(imprt);
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return [...imports].flatMap(({
|
|
113
|
+
importClause
|
|
114
|
+
}) => {
|
|
115
|
+
/* c8 ignore next */
|
|
116
|
+
const {
|
|
117
|
+
default: dflt,
|
|
118
|
+
named,
|
|
119
|
+
namespace
|
|
120
|
+
} = importClause || {};
|
|
121
|
+
const types = [];
|
|
122
|
+
if (dflt) {
|
|
123
|
+
types.push(dflt);
|
|
124
|
+
}
|
|
125
|
+
if (namespace) {
|
|
126
|
+
types.push(namespace);
|
|
127
|
+
}
|
|
128
|
+
if (named) {
|
|
129
|
+
for (const {
|
|
130
|
+
binding
|
|
131
|
+
} of named) {
|
|
132
|
+
types.push(binding);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return types;
|
|
136
|
+
});
|
|
137
|
+
}).filter(Boolean);
|
|
88
138
|
const ancestorNodes = [];
|
|
89
139
|
let currentNode = node;
|
|
90
140
|
// No need for Program node?
|
|
@@ -137,7 +187,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
137
187
|
}) => {
|
|
138
188
|
return name;
|
|
139
189
|
/* c8 ignore next */
|
|
140
|
-
}) : []).concat(extraTypes).concat(typedefDeclarations).concat(definedTypes).concat( /** @type {string[]} */definedPreferredTypes).concat(settings.mode === 'jsdoc' ? [] : [...(settings.mode === 'typescript' ? typescriptGlobals : []), ...closureGenericTypes]));
|
|
190
|
+
}) : []).concat(extraTypes).concat(typedefDeclarations).concat(importTags).concat(definedTypes).concat( /** @type {string[]} */definedPreferredTypes).concat(settings.mode === 'jsdoc' ? [] : [...(settings.mode === 'typescript' ? typescriptGlobals : []), ...closureGenericTypes]));
|
|
141
191
|
|
|
142
192
|
/**
|
|
143
193
|
* @typedef {{
|
|
@@ -175,7 +225,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
175
225
|
const typeTags = utils.filterTags(({
|
|
176
226
|
tag
|
|
177
227
|
}) => {
|
|
178
|
-
return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
|
|
228
|
+
return tag !== 'import' && utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
|
|
179
229
|
}).map(tagToParsedType('type'));
|
|
180
230
|
const namepathReferencingTags = utils.filterTags(({
|
|
181
231
|
tag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndefinedTypes.cjs","names":["_iterateJsdoc","_interopRequireWildcard","require","_jsdoccomment","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","typedefDeclarations","getAllComments","comment","test","value","commentNode","parseComment","flatMap","doc","tags","tag","isNamepathDefiningTag","name","ancestorNodes","currentNode","_currentNode","parent","push","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","type","allDefinedTypes","Set","variables","concat","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc.js';\nimport {\n getJSDocComment,\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Awaited',\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\n/**\n * @param {string|false|undefined} [str]\n * @returns {undefined|string|false}\n */\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n\n // When is this ever `null`?\n const globalScope = /** @type {import('eslint').Scope.Scope} */ (\n scopeManager.globalScope\n );\n\n const\n /**\n * @type {{\n * definedTypes: string[],\n * disableReporting: boolean,\n * markVariablesAsUsed: boolean\n * }}\n */ {\n definedTypes = [],\n disableReporting = false,\n markVariablesAsUsed = true,\n } = context.options[0] || {};\n\n /** @type {(string|undefined)[]} */\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = /** @type {string[]} */ (Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter(Boolean));\n }\n\n const typedefDeclarations = sourceCode.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n })\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n /**\n * @param {import('eslint').Rule.Node} ancestorNode\n * @returns {import('comment-parser').Spec[]}\n */\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdoc.tags.filter((tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags([\n 'template',\n ]);\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n /* c8 ignore next */\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(definedTypes)\n .concat(/** @type {string[]} */ (definedPreferredTypes))\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n /**\n * @typedef {{\n * parsedType: import('jsdoc-type-pratt-parser').RootResult;\n * tag: import('comment-parser').Spec|import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * line?: import('../iterateJsdoc.js').Integer\n * }\n * }} TypeAndTagInfo\n */\n\n /**\n * @param {string} propertyName\n * @returns {(tag: (import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * name?: string,\n * type?: string,\n * line?: import('../iterateJsdoc.js').Integer\n * })|import('comment-parser').Spec & {\n * namepathOrURL?: string\n * }\n * ) => undefined|TypeAndTagInfo}\n */\n const tagToParsedType = (propertyName) => {\n return (tag) => {\n try {\n const potentialType = tag[\n /** @type {\"type\"|\"name\"|\"namepathOrURL\"} */ (propertyName)\n ];\n return {\n parsedType: mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode),\n tag,\n };\n } catch {\n return undefined;\n }\n };\n };\n\n const typeTags = utils.filterTags(({\n tag,\n }) => {\n return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n }).map(tagToParsedType('type'));\n\n const namepathReferencingTags = utils.filterTags(({\n tag,\n }) => {\n return utils.isNamepathReferencingTag(tag);\n }).map(tagToParsedType('name'));\n\n const namepathOrUrlReferencingTags = utils.filterAllTags(({\n tag,\n }) => {\n return utils.isNamepathOrUrlReferencingTag(tag);\n }).map(tagToParsedType('namepathOrURL'));\n\n const tagsWithTypes = /** @type {TypeAndTagInfo[]} */ ([\n ...typeTags,\n ...namepathReferencingTags,\n ...namepathOrUrlReferencingTags,\n // Remove types which failed to parse\n ].filter(Boolean));\n\n for (const {\n tag,\n parsedType,\n } of tagsWithTypes) {\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n if (!disableReporting) {\n report(`The type '${value}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(value)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(value);\n /* c8 ignore next 3 */\n } else {\n context.markVariableAsUsed(value);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n type: 'boolean',\n },\n markVariablesAsUsed: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AAK8B,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,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ACF,CAAC,CAAC;AAAAqC,MAAA,CAAA/F,OAAA,GAAAA,OAAA,CAAApB,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"noUndefinedTypes.cjs","names":["_parseImports","require","_jsdoccomment","_iterateJsdoc","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","comments","getAllComments","comment","test","value","commentNode","parseComment","typedefDeclarations","flatMap","doc","tags","tag","isNamepathDefiningTag","name","importTags","type","description","typePart","imprt","imports","parseImportsSync","err","importClause","dflt","named","namespace","types","push","binding","ancestorNodes","currentNode","_currentNode","parent","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","allDefinedTypes","Set","variables","concat","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","url","schema","additionalProperties","properties","items","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import { parseImportsSync } from 'parse-imports';\nimport {\n getJSDocComment,\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc.js';\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Awaited',\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\n/**\n * @param {string|false|undefined} [str]\n * @returns {undefined|string|false}\n */\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n\n // When is this ever `null`?\n const globalScope = /** @type {import('eslint').Scope.Scope} */ (\n scopeManager.globalScope\n );\n\n const\n /**\n * @type {{\n * definedTypes: string[],\n * disableReporting: boolean,\n * markVariablesAsUsed: boolean\n * }}\n */ {\n definedTypes = [],\n disableReporting = false,\n markVariablesAsUsed = true,\n } = context.options[0] || {};\n\n /** @type {(string|undefined)[]} */\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = /** @type {string[]} */ (Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter(Boolean));\n }\n\n const comments = sourceCode.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n });\n\n const typedefDeclarations = comments\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n\n const importTags = /** @type {string[]} */ (comments.flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return tag === 'import';\n });\n }).flatMap((tag) => {\n const {\n type, name, description\n } = tag;\n const typePart = type ? `{${type}} `: '';\n const imprt = 'import ' + (description\n ? `${typePart}${name} ${description}`\n : `${typePart}${name}`);\n\n let imports;\n try {\n // Should technically await non-sync, but ESLint doesn't support sync rules;\n // thankfully, the Wasm load time is safely fast\n imports = parseImportsSync(imprt);\n } catch (err) {\n return null;\n }\n\n return [...imports].flatMap(({importClause}) => {\n /* c8 ignore next */\n const {default: dflt, named, namespace} = importClause || {};\n const types = [];\n if (dflt) {\n types.push(dflt);\n }\n if (namespace) {\n types.push(namespace);\n }\n if (named) {\n for (const {binding} of named) {\n types.push(binding);\n }\n }\n\n return types;\n });\n }).filter(Boolean));\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n /**\n * @param {import('eslint').Rule.Node} ancestorNode\n * @returns {import('comment-parser').Spec[]}\n */\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdoc.tags.filter((tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags([\n 'template',\n ]);\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n /* c8 ignore next */\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(importTags)\n .concat(definedTypes)\n .concat(/** @type {string[]} */ (definedPreferredTypes))\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n /**\n * @typedef {{\n * parsedType: import('jsdoc-type-pratt-parser').RootResult;\n * tag: import('comment-parser').Spec|import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * line?: import('../iterateJsdoc.js').Integer\n * }\n * }} TypeAndTagInfo\n */\n\n /**\n * @param {string} propertyName\n * @returns {(tag: (import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * name?: string,\n * type?: string,\n * line?: import('../iterateJsdoc.js').Integer\n * })|import('comment-parser').Spec & {\n * namepathOrURL?: string\n * }\n * ) => undefined|TypeAndTagInfo}\n */\n const tagToParsedType = (propertyName) => {\n return (tag) => {\n try {\n const potentialType = tag[\n /** @type {\"type\"|\"name\"|\"namepathOrURL\"} */ (propertyName)\n ];\n return {\n parsedType: mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode),\n tag,\n };\n } catch {\n return undefined;\n }\n };\n };\n\n const typeTags = utils.filterTags(({\n tag,\n }) => {\n return tag !== 'import' && utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n }).map(tagToParsedType('type'));\n\n const namepathReferencingTags = utils.filterTags(({\n tag,\n }) => {\n return utils.isNamepathReferencingTag(tag);\n }).map(tagToParsedType('name'));\n\n const namepathOrUrlReferencingTags = utils.filterAllTags(({\n tag,\n }) => {\n return utils.isNamepathOrUrlReferencingTag(tag);\n }).map(tagToParsedType('namepathOrURL'));\n\n const tagsWithTypes = /** @type {TypeAndTagInfo[]} */ ([\n ...typeTags,\n ...namepathReferencingTags,\n ...namepathOrUrlReferencingTags,\n // Remove types which failed to parse\n ].filter(Boolean));\n\n for (const {\n tag,\n parsedType,\n } of tagsWithTypes) {\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n if (!disableReporting) {\n report(`The type '${value}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(value)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(value);\n /* c8 ignore next 3 */\n } else {\n context.markVariableAsUsed(value);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n type: 'boolean',\n },\n markVariablesAsUsed: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAMA,IAAAE,aAAA,GAAAC,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,7 @@ const jsdocTags = exports.jsdocTags = {
|
|
|
103
103
|
const typeScriptTags = exports.typeScriptTags = {
|
|
104
104
|
...jsdocTags,
|
|
105
105
|
// https://github.com/microsoft/TypeScript/issues/22160
|
|
106
|
+
// https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#the-jsdoc-import-tag
|
|
106
107
|
import: [],
|
|
107
108
|
// https://www.typescriptlang.org/tsconfig/#stripInternal
|
|
108
109
|
internal: [],
|
package/dist/tagNames.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagNames.cjs","names":["jsdocTagsUndocumented","modifies","jsdocTags","exports","abstract","access","alias","async","augments","author","borrows","callback","class","classdesc","constant","constructs","copyright","default","deprecated","description","enum","event","example","external","file","fires","function","generator","global","hideconstructor","ignore","implements","inheritdoc","inheritDoc","inner","instance","interface","kind","lends","license","listens","member","memberof","mixes","mixin","module","name","namespace","override","package","param","private","property","protected","public","readonly","requires","returns","see","since","static","summary","this","throws","todo","tutorial","type","typedef","variation","version","yields","typeScriptTags","import","internal","overload","satisfies","template","undocumentedClosureTags","closurePrimitive","customElement","expose","hidden","idGenerator","meaning","mixinClass","mixinFunction","ngInject","owner","typeSummary","wizaction","typeScriptTagsInClosure","closureTags","define","dict","export","externs","final","implicitCast","noalias","nocollapse","nocompile","noinline","nosideeffects","polymer","polymerBehavior","preserve","record","return","struct","suppress","unrestricted"],"sources":["../src/tagNames.js"],"sourcesContent":["/**\n * @typedef {{\n * [key: string]: string[]\n * }} AliasedTags\n */\n\n/**\n * @type {AliasedTags}\n */\nconst jsdocTagsUndocumented = {\n // Undocumented but present; see\n // https://github.com/jsdoc/jsdoc/issues/1283#issuecomment-516816802\n // https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594\n modifies: [],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst jsdocTags = {\n ...jsdocTagsUndocumented,\n abstract: [\n 'virtual',\n ],\n access: [],\n alias: [],\n async: [],\n augments: [\n 'extends',\n ],\n author: [],\n borrows: [],\n callback: [],\n class: [\n 'constructor',\n ],\n classdesc: [],\n constant: [\n 'const',\n ],\n constructs: [],\n copyright: [],\n default: [\n 'defaultvalue',\n ],\n deprecated: [],\n description: [\n 'desc',\n ],\n enum: [],\n event: [],\n example: [],\n exports: [],\n external: [\n 'host',\n ],\n file: [\n 'fileoverview',\n 'overview',\n ],\n fires: [\n 'emits',\n ],\n function: [\n 'func',\n 'method',\n ],\n generator: [],\n global: [],\n hideconstructor: [],\n ignore: [],\n implements: [],\n inheritdoc: [],\n\n // Allowing casing distinct from jsdoc `definitions.js` (required in Closure)\n inheritDoc: [],\n\n inner: [],\n instance: [],\n interface: [],\n kind: [],\n lends: [],\n license: [],\n listens: [],\n member: [\n 'var',\n ],\n memberof: [],\n 'memberof!': [],\n mixes: [],\n mixin: [],\n\n module: [],\n name: [],\n namespace: [],\n override: [],\n package: [],\n param: [\n 'arg',\n 'argument',\n ],\n private: [],\n property: [\n 'prop',\n ],\n protected: [],\n public: [],\n readonly: [],\n requires: [],\n returns: [\n 'return',\n ],\n see: [],\n since: [],\n static: [],\n summary: [],\n\n this: [],\n throws: [\n 'exception',\n ],\n todo: [],\n tutorial: [],\n type: [],\n typedef: [],\n variation: [],\n version: [],\n yields: [\n 'yield',\n ],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst typeScriptTags = {\n ...jsdocTags,\n\n // https://github.com/microsoft/TypeScript/issues/22160\n import: [],\n\n // https://www.typescriptlang.org/tsconfig/#stripInternal\n internal: [],\n\n // https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#overload-support-in-jsdoc\n overload: [],\n\n // https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#satisfies-support-in-jsdoc\n satisfies: [],\n\n // `@template` is also in TypeScript per:\n // https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc\n template: [],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst undocumentedClosureTags = {\n // These are in Closure source but not in jsdoc source nor in the Closure\n // docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java\n closurePrimitive: [],\n customElement: [],\n expose: [],\n hidden: [],\n idGenerator: [],\n meaning: [],\n mixinClass: [],\n mixinFunction: [],\n ngInject: [],\n owner: [],\n typeSummary: [],\n wizaction: [],\n};\n\nconst {\n /* eslint-disable no-unused-vars */\n inheritdoc,\n internal,\n overload,\n satisfies,\n\n // Will be inverted to prefer `return`\n returns,\n /* eslint-enable no-unused-vars */\n ...typeScriptTagsInClosure\n} = typeScriptTags;\n\n/**\n * @type {AliasedTags}\n */\nconst closureTags = {\n ...typeScriptTagsInClosure,\n ...undocumentedClosureTags,\n\n // From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler\n // These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js\n // except for the experimental `noinline` and the casing differences noted below\n\n // Defined as a synonym of `const` in jsdoc `definitions.js`\n define: [],\n\n dict: [],\n export: [],\n externs: [],\n final: [],\n\n // With casing distinct from jsdoc `definitions.js`\n implicitCast: [],\n\n noalias: [],\n nocollapse: [],\n nocompile: [],\n noinline: [],\n nosideeffects: [],\n polymer: [],\n polymerBehavior: [],\n preserve: [],\n\n // Defined as a synonym of `interface` in jsdoc `definitions.js`\n record: [],\n\n return: [\n 'returns',\n ],\n\n struct: [],\n suppress: [],\n\n unrestricted: [],\n};\n\nexport {\n closureTags,\n jsdocTags,\n typeScriptTags,\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,qBAAqB,GAAG;EAC5B;EACA;EACA;EACAC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EAChB,GAAGF,qBAAqB;EACxBI,QAAQ,EAAE,CACR,SAAS,C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AC;AAED,MAAM;EACJ;EACAzD,UAAU;EACVyC,QAAQ;EACRC,QAAQ;EACRC,SAAS;EAET;EACAlB,OAAO;EACP;EACA,GAAGiC;AACL,CAAC,GAAGnB,cAAc;;AAElB;AACA;AACA;AACA,MAAMoB,WAAW,GAAAxF,OAAA,CAAAwF,WAAA,GAAG;EAClB,GAAGD,uBAAuB;EAC1B,GAAGb,uBAAuB;EAE1B;EACA;EACA;;EAEA;EACAe,MAAM,EAAE,EAAE;EAEVC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EAET;EACAC,YAAY,EAAE,EAAE;EAEhBC,OAAO,EAAE,EAAE;EACXC,UAAU,EAAE,EAAE;EACdC,SAAS,EAAE,EAAE;EACbC,QAAQ,EAAE,EAAE;EACZC,aAAa,EAAE,EAAE;EACjBC,OAAO,EAAE,EAAE;EACXC,eAAe,EAAE,EAAE;EACnBC,QAAQ,EAAE,EAAE;EAEZ;EACAC,MAAM,EAAE,EAAE;EAEVC,MAAM,EAAE,CACN,SAAS,CACV;EAEDC,MAAM,EAAE,EAAE;EACVC,QAAQ,EAAE,EAAE;EAEZC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"tagNames.cjs","names":["jsdocTagsUndocumented","modifies","jsdocTags","exports","abstract","access","alias","async","augments","author","borrows","callback","class","classdesc","constant","constructs","copyright","default","deprecated","description","enum","event","example","external","file","fires","function","generator","global","hideconstructor","ignore","implements","inheritdoc","inheritDoc","inner","instance","interface","kind","lends","license","listens","member","memberof","mixes","mixin","module","name","namespace","override","package","param","private","property","protected","public","readonly","requires","returns","see","since","static","summary","this","throws","todo","tutorial","type","typedef","variation","version","yields","typeScriptTags","import","internal","overload","satisfies","template","undocumentedClosureTags","closurePrimitive","customElement","expose","hidden","idGenerator","meaning","mixinClass","mixinFunction","ngInject","owner","typeSummary","wizaction","typeScriptTagsInClosure","closureTags","define","dict","export","externs","final","implicitCast","noalias","nocollapse","nocompile","noinline","nosideeffects","polymer","polymerBehavior","preserve","record","return","struct","suppress","unrestricted"],"sources":["../src/tagNames.js"],"sourcesContent":["/**\n * @typedef {{\n * [key: string]: string[]\n * }} AliasedTags\n */\n\n/**\n * @type {AliasedTags}\n */\nconst jsdocTagsUndocumented = {\n // Undocumented but present; see\n // https://github.com/jsdoc/jsdoc/issues/1283#issuecomment-516816802\n // https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594\n modifies: [],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst jsdocTags = {\n ...jsdocTagsUndocumented,\n abstract: [\n 'virtual',\n ],\n access: [],\n alias: [],\n async: [],\n augments: [\n 'extends',\n ],\n author: [],\n borrows: [],\n callback: [],\n class: [\n 'constructor',\n ],\n classdesc: [],\n constant: [\n 'const',\n ],\n constructs: [],\n copyright: [],\n default: [\n 'defaultvalue',\n ],\n deprecated: [],\n description: [\n 'desc',\n ],\n enum: [],\n event: [],\n example: [],\n exports: [],\n external: [\n 'host',\n ],\n file: [\n 'fileoverview',\n 'overview',\n ],\n fires: [\n 'emits',\n ],\n function: [\n 'func',\n 'method',\n ],\n generator: [],\n global: [],\n hideconstructor: [],\n ignore: [],\n implements: [],\n inheritdoc: [],\n\n // Allowing casing distinct from jsdoc `definitions.js` (required in Closure)\n inheritDoc: [],\n\n inner: [],\n instance: [],\n interface: [],\n kind: [],\n lends: [],\n license: [],\n listens: [],\n member: [\n 'var',\n ],\n memberof: [],\n 'memberof!': [],\n mixes: [],\n mixin: [],\n\n module: [],\n name: [],\n namespace: [],\n override: [],\n package: [],\n param: [\n 'arg',\n 'argument',\n ],\n private: [],\n property: [\n 'prop',\n ],\n protected: [],\n public: [],\n readonly: [],\n requires: [],\n returns: [\n 'return',\n ],\n see: [],\n since: [],\n static: [],\n summary: [],\n\n this: [],\n throws: [\n 'exception',\n ],\n todo: [],\n tutorial: [],\n type: [],\n typedef: [],\n variation: [],\n version: [],\n yields: [\n 'yield',\n ],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst typeScriptTags = {\n ...jsdocTags,\n\n // https://github.com/microsoft/TypeScript/issues/22160\n // https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#the-jsdoc-import-tag\n import: [],\n\n // https://www.typescriptlang.org/tsconfig/#stripInternal\n internal: [],\n\n // https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#overload-support-in-jsdoc\n overload: [],\n\n // https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#satisfies-support-in-jsdoc\n satisfies: [],\n\n // `@template` is also in TypeScript per:\n // https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc\n template: [],\n};\n\n/**\n * @type {AliasedTags}\n */\nconst undocumentedClosureTags = {\n // These are in Closure source but not in jsdoc source nor in the Closure\n // docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java\n closurePrimitive: [],\n customElement: [],\n expose: [],\n hidden: [],\n idGenerator: [],\n meaning: [],\n mixinClass: [],\n mixinFunction: [],\n ngInject: [],\n owner: [],\n typeSummary: [],\n wizaction: [],\n};\n\nconst {\n /* eslint-disable no-unused-vars */\n inheritdoc,\n internal,\n overload,\n satisfies,\n\n // Will be inverted to prefer `return`\n returns,\n /* eslint-enable no-unused-vars */\n ...typeScriptTagsInClosure\n} = typeScriptTags;\n\n/**\n * @type {AliasedTags}\n */\nconst closureTags = {\n ...typeScriptTagsInClosure,\n ...undocumentedClosureTags,\n\n // From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler\n // These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js\n // except for the experimental `noinline` and the casing differences noted below\n\n // Defined as a synonym of `const` in jsdoc `definitions.js`\n define: [],\n\n dict: [],\n export: [],\n externs: [],\n final: [],\n\n // With casing distinct from jsdoc `definitions.js`\n implicitCast: [],\n\n noalias: [],\n nocollapse: [],\n nocompile: [],\n noinline: [],\n nosideeffects: [],\n polymer: [],\n polymerBehavior: [],\n preserve: [],\n\n // Defined as a synonym of `interface` in jsdoc `definitions.js`\n record: [],\n\n return: [\n 'returns',\n ],\n\n struct: [],\n suppress: [],\n\n unrestricted: [],\n};\n\nexport {\n closureTags,\n jsdocTags,\n typeScriptTags,\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,qBAAqB,GAAG;EAC5B;EACA;EACA;EACAC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EAChB,GAAGF,qBAAqB;EACxBI,QAAQ,EAAE,CACR,SAAS,CACV;EACDC,MAAM,EAAE,EAAE;EACVC,KAAK,EAAE,EAAE;EACTC,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,CACR,SAAS,CACV;EACDC,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,QAAQ,EAAE,EAAE;EACZC,KAAK,EAAE,CACL,aAAa,CACd;EACDC,SAAS,EAAE,EAAE;EACbC,QAAQ,EAAE,CACR,OAAO,CACR;EACDC,UAAU,EAAE,EAAE;EACdC,SAAS,EAAE,EAAE;EACbC,OAAO,EAAE,CACP,cAAc,CACf;EACDC,UAAU,EAAE,EAAE;EACdC,WAAW,EAAE,CACX,MAAM,CACP;EACDC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE,EAAE;EACXnB,OAAO,EAAE,EAAE;EACXoB,QAAQ,EAAE,CACR,MAAM,CACP;EACDC,IAAI,EAAE,CACJ,cAAc,EACd,UAAU,CACX;EACDC,KAAK,EAAE,CACL,OAAO,CACR;EACDC,QAAQ,EAAE,CACR,MAAM,EACN,QAAQ,CACT;EACDC,SAAS,EAAE,EAAE;EACbC,MAAM,EAAE,EAAE;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C,QAAQ,EAAE,EAAE;EAEZC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"debug": "^4.3.4",
|
|
12
12
|
"escape-string-regexp": "^4.0.0",
|
|
13
13
|
"esquery": "^1.5.0",
|
|
14
|
+
"parse-imports": "^2.0.0",
|
|
14
15
|
"semver": "^7.6.2",
|
|
15
16
|
"spdx-expression-parse": "^4.0.0"
|
|
16
17
|
},
|
|
@@ -140,5 +141,5 @@
|
|
|
140
141
|
"test-cov": "cross-env TIMING=1 c8 --reporter text npm run test-no-cov",
|
|
141
142
|
"test-index": "npm run test-no-cov -- test/rules/index.js"
|
|
142
143
|
},
|
|
143
|
-
"version": "48.2.
|
|
144
|
+
"version": "48.2.14"
|
|
144
145
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
parseComment,
|
|
3
|
-
} from '../iterateJsdoc.js';
|
|
1
|
+
import { parseImportsSync } from 'parse-imports';
|
|
4
2
|
import {
|
|
5
3
|
getJSDocComment,
|
|
6
4
|
parse as parseType,
|
|
7
5
|
traverse,
|
|
8
6
|
tryParse as tryParseType,
|
|
9
7
|
} from '@es-joy/jsdoccomment';
|
|
8
|
+
import iterateJsdoc, {
|
|
9
|
+
parseComment,
|
|
10
|
+
} from '../iterateJsdoc.js';
|
|
10
11
|
|
|
11
12
|
const extraTypes = [
|
|
12
13
|
'null', 'undefined', 'void', 'string', 'boolean', 'object',
|
|
@@ -109,13 +110,15 @@ export default iterateJsdoc(({
|
|
|
109
110
|
.filter(Boolean));
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
const
|
|
113
|
+
const comments = sourceCode.getAllComments()
|
|
113
114
|
.filter((comment) => {
|
|
114
115
|
return (/^\*\s/u).test(comment.value);
|
|
115
116
|
})
|
|
116
117
|
.map((commentNode) => {
|
|
117
118
|
return parseComment(commentNode, '');
|
|
118
|
-
})
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const typedefDeclarations = comments
|
|
119
122
|
.flatMap((doc) => {
|
|
120
123
|
return doc.tags.filter(({
|
|
121
124
|
tag,
|
|
@@ -127,6 +130,51 @@ export default iterateJsdoc(({
|
|
|
127
130
|
return tag.name;
|
|
128
131
|
});
|
|
129
132
|
|
|
133
|
+
|
|
134
|
+
const importTags = /** @type {string[]} */ (comments.flatMap((doc) => {
|
|
135
|
+
return doc.tags.filter(({
|
|
136
|
+
tag,
|
|
137
|
+
}) => {
|
|
138
|
+
return tag === 'import';
|
|
139
|
+
});
|
|
140
|
+
}).flatMap((tag) => {
|
|
141
|
+
const {
|
|
142
|
+
type, name, description
|
|
143
|
+
} = tag;
|
|
144
|
+
const typePart = type ? `{${type}} `: '';
|
|
145
|
+
const imprt = 'import ' + (description
|
|
146
|
+
? `${typePart}${name} ${description}`
|
|
147
|
+
: `${typePart}${name}`);
|
|
148
|
+
|
|
149
|
+
let imports;
|
|
150
|
+
try {
|
|
151
|
+
// Should technically await non-sync, but ESLint doesn't support sync rules;
|
|
152
|
+
// thankfully, the Wasm load time is safely fast
|
|
153
|
+
imports = parseImportsSync(imprt);
|
|
154
|
+
} catch (err) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return [...imports].flatMap(({importClause}) => {
|
|
159
|
+
/* c8 ignore next */
|
|
160
|
+
const {default: dflt, named, namespace} = importClause || {};
|
|
161
|
+
const types = [];
|
|
162
|
+
if (dflt) {
|
|
163
|
+
types.push(dflt);
|
|
164
|
+
}
|
|
165
|
+
if (namespace) {
|
|
166
|
+
types.push(namespace);
|
|
167
|
+
}
|
|
168
|
+
if (named) {
|
|
169
|
+
for (const {binding} of named) {
|
|
170
|
+
types.push(binding);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return types;
|
|
175
|
+
});
|
|
176
|
+
}).filter(Boolean));
|
|
177
|
+
|
|
130
178
|
const ancestorNodes = [];
|
|
131
179
|
|
|
132
180
|
let currentNode = node;
|
|
@@ -193,6 +241,7 @@ export default iterateJsdoc(({
|
|
|
193
241
|
)
|
|
194
242
|
.concat(extraTypes)
|
|
195
243
|
.concat(typedefDeclarations)
|
|
244
|
+
.concat(importTags)
|
|
196
245
|
.concat(definedTypes)
|
|
197
246
|
.concat(/** @type {string[]} */ (definedPreferredTypes))
|
|
198
247
|
.concat(
|
|
@@ -245,7 +294,7 @@ export default iterateJsdoc(({
|
|
|
245
294
|
const typeTags = utils.filterTags(({
|
|
246
295
|
tag,
|
|
247
296
|
}) => {
|
|
248
|
-
return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
|
|
297
|
+
return tag !== 'import' && utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
|
|
249
298
|
}).map(tagToParsedType('type'));
|
|
250
299
|
|
|
251
300
|
const namepathReferencingTags = utils.filterTags(({
|
package/src/tagNames.js
CHANGED
|
@@ -137,6 +137,7 @@ const typeScriptTags = {
|
|
|
137
137
|
...jsdocTags,
|
|
138
138
|
|
|
139
139
|
// https://github.com/microsoft/TypeScript/issues/22160
|
|
140
|
+
// https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#the-jsdoc-import-tag
|
|
140
141
|
import: [],
|
|
141
142
|
|
|
142
143
|
// https://www.typescriptlang.org/tsconfig/#stripInternal
|