eslint-plugin-jsdoc 59.0.1 → 59.1.0
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/README.md +1 -0
- package/dist/buildForbidRuleDefinition.cjs +34 -13
- package/dist/buildForbidRuleDefinition.cjs.map +1 -1
- package/dist/buildForbidRuleDefinition.d.ts +10 -6
- package/dist/cjs/buildForbidRuleDefinition.d.ts +10 -6
- package/dist/cjs/rules/noRestrictedSyntax.d.ts +1 -1
- package/dist/cjs/rules/requiredTags.d.ts +2 -0
- package/dist/generateDocs.cjs +1 -1
- package/dist/generateDocs.cjs.map +1 -1
- package/dist/generateRule.cjs +5 -0
- package/dist/generateRule.cjs.map +1 -1
- package/dist/index-cjs.cjs +3 -0
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.cjs +41 -72
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.d.ts +1 -1
- package/dist/rules/noUndefinedTypes.cjs +1 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requiredTags.cjs +74 -0
- package/dist/rules/requiredTags.cjs.map +1 -0
- package/dist/rules/requiredTags.d.ts +3 -0
- package/dist/rules.d.ts +20 -0
- package/package.json +1 -1
- package/src/buildForbidRuleDefinition.js +36 -13
- package/src/index-cjs.js +3 -0
- package/src/index.js +3 -0
- package/src/rules/noRestrictedSyntax.js +47 -82
- package/src/rules/noUndefinedTypes.js +1 -1
- package/src/rules/requiredTags.js +85 -0
- package/src/rules.d.ts +20 -0
|
@@ -4,52 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
var _buildForbidRuleDefinition = require("../buildForbidRuleDefinition.cjs");
|
|
8
|
+
var _default = exports.default = (0, _buildForbidRuleDefinition.buildForbidRuleDefinition)({
|
|
9
|
+
getContexts(context, report) {
|
|
10
|
+
if (!context.options.length) {
|
|
11
|
+
report('Rule `no-restricted-syntax` is missing a `contexts` option.');
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const {
|
|
15
|
+
contexts
|
|
16
|
+
} = context.options[0];
|
|
17
|
+
return contexts;
|
|
13
18
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const {
|
|
22
|
-
contexts
|
|
23
|
-
} = context.options[0];
|
|
24
|
-
const {
|
|
25
|
-
contextStr,
|
|
26
|
-
foundContext
|
|
27
|
-
} = utils.findContext(contexts, comment);
|
|
28
|
-
|
|
29
|
-
// We are not on the *particular* matching context/comment, so don't assume
|
|
30
|
-
// we need reporting
|
|
31
|
-
if (!foundContext) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const message = /** @type {import('../iterateJsdoc.js').ContextObject} */foundContext?.message ?? 'Syntax is restricted: {{context}}' + (comment ? ' with {{comment}}' : '');
|
|
35
|
-
report(message, null, null, comment ? {
|
|
36
|
-
comment,
|
|
37
|
-
context: contextStr
|
|
38
|
-
} : {
|
|
39
|
-
context: contextStr
|
|
40
|
-
});
|
|
41
|
-
}, {
|
|
42
|
-
contextSelected: true,
|
|
43
|
-
meta: {
|
|
44
|
-
docs: {
|
|
45
|
-
description: 'Reports when certain comment structures are present.',
|
|
46
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-restricted-syntax.md#repos-sticky-header'
|
|
47
|
-
},
|
|
48
|
-
schema: [{
|
|
49
|
-
additionalProperties: false,
|
|
50
|
-
properties: {
|
|
51
|
-
contexts: {
|
|
52
|
-
description: `Set this to an array of strings representing the AST context (or an object with
|
|
19
|
+
schema: [{
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
properties: {
|
|
22
|
+
contexts: {
|
|
23
|
+
description: `Set this to an array of strings representing the AST context (or an object with
|
|
53
24
|
\`context\` and \`comment\` properties) where you wish the rule to be applied.
|
|
54
25
|
|
|
55
26
|
\`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
|
|
@@ -66,34 +37,32 @@ aliases \`@func\` or \`@method\`) (including those associated with an \`@interfa
|
|
|
66
37
|
|
|
67
38
|
See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
68
39
|
section of our Advanced docs for more on the expected format.`,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
context: {
|
|
79
|
-
type: 'string'
|
|
80
|
-
},
|
|
81
|
-
message: {
|
|
82
|
-
type: 'string'
|
|
83
|
-
}
|
|
40
|
+
items: {
|
|
41
|
+
anyOf: [{
|
|
42
|
+
type: 'string'
|
|
43
|
+
}, {
|
|
44
|
+
additionalProperties: false,
|
|
45
|
+
properties: {
|
|
46
|
+
comment: {
|
|
47
|
+
type: 'string'
|
|
84
48
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
49
|
+
context: {
|
|
50
|
+
type: 'string'
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
type: 'string'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
type: 'object'
|
|
57
|
+
}]
|
|
58
|
+
},
|
|
59
|
+
type: 'array'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
required: ['contexts'],
|
|
63
|
+
type: 'object'
|
|
64
|
+
}],
|
|
65
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-restricted-syntax.md#repos-sticky-header'
|
|
97
66
|
});
|
|
98
67
|
module.exports = exports.default;
|
|
99
68
|
//# sourceMappingURL=noRestrictedSyntax.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noRestrictedSyntax.cjs","names":["
|
|
1
|
+
{"version":3,"file":"noRestrictedSyntax.cjs","names":["_buildForbidRuleDefinition","require","_default","exports","default","buildForbidRuleDefinition","getContexts","context","report","options","length","contexts","schema","additionalProperties","properties","description","items","anyOf","type","comment","message","required","url","module"],"sources":["../../src/rules/noRestrictedSyntax.js"],"sourcesContent":["import {\n buildForbidRuleDefinition,\n} from '../buildForbidRuleDefinition.js';\n\nexport default buildForbidRuleDefinition({\n getContexts (context, report) {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `contexts` option.');\n return false;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n return contexts;\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\n\\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nUse the \\`message\\` property to indicate the specific error to be shown when an\nerror is reported for that context being found. Defaults to\n\\`\"Syntax is restricted: {{context}}\"\\`, or with a comment, to\n\\`\"Syntax is restricted: {{context}} with {{comment}}\"\\`.\n\nSet to \\`\"any\"\\` if you want the rule to apply to any JSDoc block throughout\nyour files (as is necessary for finding function blocks not attached to a\nfunction declaration or expression, i.e., \\`@callback\\` or \\`@function\\` (or its\naliases \\`@func\\` or \\`@method\\`) (including those associated with an \\`@interface\\`).\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n required: [\n 'contexts',\n ],\n type: 'object',\n },\n ],\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-restricted-syntax.md#repos-sticky-header',\n});\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AAEyC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE1B,IAAAC,oDAAyB,EAAC;EACvCC,WAAWA,CAAEC,OAAO,EAAEC,MAAM,EAAE;IAC5B,IAAI,CAACD,OAAO,CAACE,OAAO,CAACC,MAAM,EAAE;MAC3BF,MAAM,CAAC,6DAA6D,CAAC;MACrE,OAAO,KAAK;IACd;IAEA,MAAM;MACJG;IACF,CAAC,GAAGJ,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC;IAEtB,OAAOE,QAAQ;EACjB,CAAC;EACDC,MAAM,EAAE,CACN;IACEC,oBAAoB,EAAE,KAAK;IAC3BC,UAAU,EAAE;MACVH,QAAQ,EAAE;QACRI,WAAW,EAAE;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;QACpDC,KAAK,EAAE;UACLC,KAAK,EAAE,CACL;YACEC,IAAI,EAAE;UACR,CAAC,EACD;YACEL,oBAAoB,EAAE,KAAK;YAC3BC,UAAU,EAAE;cACVK,OAAO,EAAE;gBACPD,IAAI,EAAE;cACR,CAAC;cACDX,OAAO,EAAE;gBACPW,IAAI,EAAE;cACR,CAAC;cACDE,OAAO,EAAE;gBACPF,IAAI,EAAE;cACR;YACF,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;QAEL,CAAC;QACDA,IAAI,EAAE;MACR;IACF,CAAC;IACDG,QAAQ,EAAE,CACR,UAAU,CACX;IACDH,IAAI,EAAE;EACR,CAAC,CACF;EACDI,GAAG,EAAE;AACP,CAAC,CAAC;AAAAC,MAAA,CAAApB,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -73,7 +73,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
73
73
|
}
|
|
74
74
|
const allComments = sourceCode.getAllComments();
|
|
75
75
|
const comments = allComments.filter(comment => {
|
|
76
|
-
return
|
|
76
|
+
return /^\*(?!\*)/v.test(comment.value);
|
|
77
77
|
}).map(commentNode => {
|
|
78
78
|
return (0, _iterateJsdoc.parseComment)(commentNode, '');
|
|
79
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndefinedTypes.cjs","names":["_iterateJsdoc","_interopRequireWildcard","require","_jsdoccomment","_parseImportsExports","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","mode","preferredTypes","structuredTags","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","allComments","getAllComments","comments","comment","test","value","commentNode","parseComment","globals","flatMap","trim","split","concat","languageOptions","typedefDeclarations","doc","tags","tag","isNamepathDefiningTag","name","importTags","description","type","typePart","imprt","importsExports","parseImportsExports","types","namedImports","push","names","namespaceImports","namespace","ancestorNodes","currentNode","parent","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","getValidRuntimeIdentifiers","scope","result","Set","scp","variables","add","upper","imports","allDefinedTypes","identifiers","globalItem","body","item","property","key","init","callee","id","methodOrProp","getScope","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","parentNode","_parent","val","currNode","includes","right","structuredTypes","Array","isArray","markVariableAsUsed","iterateAllJsdocs","meta","docs","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';\nimport {\n parseImportsExports,\n} from 'parse-imports-exports';\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', 'Intl',\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(/(?:\\.|<>|\\.<>|\\[\\])$/v, '');\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 mode,\n preferredTypes,\n structuredTags,\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 allComments = sourceCode.getAllComments();\n const comments = allComments\n .filter((comment) => {\n return (/^\\*\\s/v).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n });\n\n const globals = allComments\n .filter((comment) => {\n return (/^\\s*globals/v).test(comment.value);\n }).flatMap((commentNode) => {\n return commentNode.value.replace(/^\\s*globals/v, '').trim().split(/,\\s*/v);\n }).concat(Object.keys(context.languageOptions.globals ?? []));\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 const importTags = settings.mode === 'typescript' ? /** @type {string[]} */ (comments.flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return tag === 'import';\n });\n }).flatMap((tag) => {\n const {\n description,\n name,\n type,\n } = tag;\n const typePart = type ? `{${type}} ` : '';\n const imprt = 'import ' + (description ?\n `${typePart}${name} ${description}` :\n `${typePart}${name}`);\n\n const importsExports = parseImportsExports(imprt.trim());\n\n const types = [];\n const namedImports = Object.values(importsExports.namedImports || {})[0]?.[0];\n if (namedImports) {\n if (namedImports.default) {\n types.push(namedImports.default);\n }\n\n if (namedImports.names) {\n types.push(...Object.keys(namedImports.names));\n }\n }\n\n const namespaceImports = Object.values(importsExports.namespaceImports || {})[0]?.[0];\n if (namespaceImports) {\n if (namespaceImports.namespace) {\n types.push(namespaceImports.namespace);\n }\n\n if (namespaceImports.default) {\n types.push(namespaceImports.default);\n }\n }\n\n return types;\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 /**\n * @param {import(\"eslint\").Scope.Scope | null} scope\n * @returns {Set<string>}\n */\n const getValidRuntimeIdentifiers = (scope) => {\n const result = new Set();\n\n let scp = scope;\n while (scp) {\n for (const {\n name,\n } of scp.variables) {\n result.add(name);\n }\n\n scp = scp.upper;\n }\n\n return result;\n };\n\n /**\n * We treat imports differently as we can't introspect their children.\n * @type {string[]}\n */\n const imports = [];\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 }).flatMap(({\n identifiers,\n name,\n }) => {\n const globalItem = /** @type {import('estree').Identifier & {parent: import('@typescript-eslint/types').TSESTree.Node}} */ (\n identifiers?.[0]\n )?.parent;\n switch (globalItem?.type) {\n case 'ClassDeclaration':\n return [\n name,\n ...globalItem.body.body.map((item) => {\n const property = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.PropertyDefinition} */ (\n item)?.key)?.name;\n /* c8 ignore next 3 -- Guard */\n if (!property) {\n return '';\n }\n\n return `${name}.${property}`;\n }).filter(Boolean),\n ];\n case 'ImportDefaultSpecifier':\n case 'ImportNamespaceSpecifier':\n case 'ImportSpecifier':\n imports.push(name);\n break;\n case 'TSInterfaceDeclaration':\n return [\n name,\n ...globalItem.body.body.map((item) => {\n const property = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.TSPropertySignature} */ (\n item)?.key)?.name;\n /* c8 ignore next 3 -- Guard */\n if (!property) {\n return '';\n }\n\n return `${name}.${property}`;\n }).filter(Boolean),\n ];\n case 'VariableDeclarator':\n if (/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.CallExpression} */ (\n globalItem?.init\n )?.callee)?.name === 'require'\n ) {\n imports.push(/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n globalItem.id\n ).name);\n break;\n }\n\n return [];\n }\n\n return [\n name,\n ];\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 // Other methods are not in scope, but we need them, and we grab them here\n if (node?.type === 'MethodDefinition') {\n return /** @type {import('estree').ClassBody} */ (node.parent).body.flatMap((methodOrProp) => {\n if (methodOrProp.type === 'MethodDefinition') {\n // eslint-disable-next-line unicorn/no-lonely-if -- Pattern\n if (methodOrProp.key.type === 'Identifier') {\n return [\n methodOrProp.key.name,\n `${/** @type {import('estree').ClassDeclaration} */ (\n node.parent?.parent\n )?.id?.name}.${methodOrProp.key.name}`,\n ];\n }\n }\n\n if (methodOrProp.type === 'PropertyDefinition') {\n // eslint-disable-next-line unicorn/no-lonely-if -- Pattern\n if (methodOrProp.key.type === 'Identifier') {\n return [\n methodOrProp.key.name,\n `${/** @type {import('estree').ClassDeclaration} */ (\n node.parent?.parent\n )?.id?.name}.${methodOrProp.key.name}`,\n ];\n }\n }\n /* c8 ignore next 2 -- Not yet built */\n\n return '';\n }).filter(Boolean);\n }\n\n return [];\n })())\n .concat(...getValidRuntimeIdentifiers(node && (\n (sourceCode.getScope &&\n /* c8 ignore next 3 */\n sourceCode.getScope(node)) ||\n // @ts-expect-error ESLint 8\n context.getScope()\n )))\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 parsedType,\n tag,\n } of tagsWithTypes) {\n traverse(parsedType, (nde, parentNode) => {\n /**\n * @type {import('jsdoc-type-pratt-parser').NameResult & {\n * _parent?: import('jsdoc-type-pratt-parser').NonRootResult\n * }}\n */\n // eslint-disable-next-line canonical/id-match -- Avoid clashes\n (nde)._parent = parentNode;\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n let val = value;\n\n /** @type {import('jsdoc-type-pratt-parser').NonRootResult|undefined} */\n let currNode = nde;\n do {\n currNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').NameResult & {\n * _parent?: import('jsdoc-type-pratt-parser').NonRootResult\n * }}\n */ (currNode)._parent;\n if (\n // Avoid appending for imports and globals since we don't want to\n // check their properties which may or may not exist\n !imports.includes(val) && !globals.includes(val) &&\n !importTags.includes(val) &&\n !extraTypes.includes(val) &&\n !typedefDeclarations.includes(val) &&\n currNode && 'right' in currNode &&\n currNode.right?.type === 'JsdocTypeProperty') {\n val = val + '.' + currNode.right.value;\n }\n } while (currNode?.type === 'JsdocTypeNamePath');\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(val) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(val))\n ) {\n if (!disableReporting) {\n report(`The type '${val}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(val)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(val);\n /* c8 ignore next 4 */\n } else {\n // @ts-expect-error ESLint 8\n context.markVariableAsUsed(val);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Besides some expected built-in types, prohibits any types not specified as globals or within `@typedef`.',\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 description: `This array can be populated to indicate other types which\nare automatically considered as defined (in addition to globals, etc.).\nDefaults to an empty array.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n description: `Whether to disable reporting of errors. Defaults to\n\\`false\\`. This may be set to \\`true\\` in order to take advantage of only\nmarking defined variables as used.`,\n type: 'boolean',\n },\n markVariablesAsUsed: {\n description: `Whether to mark variables as used for the purposes\nof the \\`no-unused-vars\\` rule when they are not found to be undefined.\nDefaults to \\`true\\`. May be set to \\`false\\` to enforce a practice of not\nimporting types unless used in code.`,\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;AAMA,IAAAE,oBAAA,GAAAF,OAAA;AAE+B,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,G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Ae,CAACF,QAAQ,CAACF,GAAG,CAAC,CAAC,EACnE;UACA,IAAI,CAACxG,gBAAgB,EAAE;YACrBP,MAAM,CAAC,aAAa+G,GAAG,iBAAiB,EAAE,IAAI,EAAEtE,GAAG,CAAC;UACtD;QACF,CAAC,MAAM,IAAIjC,mBAAmB,IAAI,CAAClB,UAAU,CAAC2H,QAAQ,CAACF,GAAG,CAAC,EAAE;UAC3D,IAAI7G,UAAU,CAACoH,kBAAkB,EAAE;YACjCpH,UAAU,CAACoH,kBAAkB,CAACP,GAAG,CAAC;YACpC;UACA,CAAC,MAAM;YACL;YACAjH,OAAO,CAACwH,kBAAkB,CAACP,GAAG,CAAC;UACjC;QACF;MACF;IACF,CAAC,CAAC;EACJ;AACF,CAAC,EAAE;EACDQ,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJ5E,WAAW,EAAE,0GAA0G;MACvH6E,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVvH,YAAY,EAAE;UACZuC,WAAW,EAAE;AACzB;AACA,4BAA4B;UAChBiF,KAAK,EAAE;YACLhF,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDvC,gBAAgB,EAAE;UAChBsC,WAAW,EAAE;AACzB;AACA,mCAAmC;UACvBC,IAAI,EAAE;QACR,CAAC;QACDtC,mBAAmB,EAAE;UACnBqC,WAAW,EAAE;AACzB;AACA;AACA,qCAAqC;UACzBC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAiF,MAAA,CAAAnI,OAAA,GAAAA,OAAA,CAAAf,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"noUndefinedTypes.cjs","names":["_iterateJsdoc","_interopRequireWildcard","require","_jsdoccomment","_parseImportsExports","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","mode","preferredTypes","structuredTags","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","allComments","getAllComments","comments","comment","test","value","commentNode","parseComment","globals","flatMap","trim","split","concat","languageOptions","typedefDeclarations","doc","tags","tag","isNamepathDefiningTag","name","importTags","description","type","typePart","imprt","importsExports","parseImportsExports","types","namedImports","push","names","namespaceImports","namespace","ancestorNodes","currentNode","parent","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","getValidRuntimeIdentifiers","scope","result","Set","scp","variables","add","upper","imports","allDefinedTypes","identifiers","globalItem","body","item","property","key","init","callee","id","methodOrProp","getScope","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","parentNode","_parent","val","currNode","includes","right","structuredTypes","Array","isArray","markVariableAsUsed","iterateAllJsdocs","meta","docs","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';\nimport {\n parseImportsExports,\n} from 'parse-imports-exports';\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', 'Intl',\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(/(?:\\.|<>|\\.<>|\\[\\])$/v, '');\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 mode,\n preferredTypes,\n structuredTags,\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 allComments = sourceCode.getAllComments();\n const comments = allComments\n .filter((comment) => {\n return (/^\\*(?!\\*)/v).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n });\n\n const globals = allComments\n .filter((comment) => {\n return (/^\\s*globals/v).test(comment.value);\n }).flatMap((commentNode) => {\n return commentNode.value.replace(/^\\s*globals/v, '').trim().split(/,\\s*/v);\n }).concat(Object.keys(context.languageOptions.globals ?? []));\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 const importTags = settings.mode === 'typescript' ? /** @type {string[]} */ (comments.flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return tag === 'import';\n });\n }).flatMap((tag) => {\n const {\n description,\n name,\n type,\n } = tag;\n const typePart = type ? `{${type}} ` : '';\n const imprt = 'import ' + (description ?\n `${typePart}${name} ${description}` :\n `${typePart}${name}`);\n\n const importsExports = parseImportsExports(imprt.trim());\n\n const types = [];\n const namedImports = Object.values(importsExports.namedImports || {})[0]?.[0];\n if (namedImports) {\n if (namedImports.default) {\n types.push(namedImports.default);\n }\n\n if (namedImports.names) {\n types.push(...Object.keys(namedImports.names));\n }\n }\n\n const namespaceImports = Object.values(importsExports.namespaceImports || {})[0]?.[0];\n if (namespaceImports) {\n if (namespaceImports.namespace) {\n types.push(namespaceImports.namespace);\n }\n\n if (namespaceImports.default) {\n types.push(namespaceImports.default);\n }\n }\n\n return types;\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 /**\n * @param {import(\"eslint\").Scope.Scope | null} scope\n * @returns {Set<string>}\n */\n const getValidRuntimeIdentifiers = (scope) => {\n const result = new Set();\n\n let scp = scope;\n while (scp) {\n for (const {\n name,\n } of scp.variables) {\n result.add(name);\n }\n\n scp = scp.upper;\n }\n\n return result;\n };\n\n /**\n * We treat imports differently as we can't introspect their children.\n * @type {string[]}\n */\n const imports = [];\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 }).flatMap(({\n identifiers,\n name,\n }) => {\n const globalItem = /** @type {import('estree').Identifier & {parent: import('@typescript-eslint/types').TSESTree.Node}} */ (\n identifiers?.[0]\n )?.parent;\n switch (globalItem?.type) {\n case 'ClassDeclaration':\n return [\n name,\n ...globalItem.body.body.map((item) => {\n const property = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.PropertyDefinition} */ (\n item)?.key)?.name;\n /* c8 ignore next 3 -- Guard */\n if (!property) {\n return '';\n }\n\n return `${name}.${property}`;\n }).filter(Boolean),\n ];\n case 'ImportDefaultSpecifier':\n case 'ImportNamespaceSpecifier':\n case 'ImportSpecifier':\n imports.push(name);\n break;\n case 'TSInterfaceDeclaration':\n return [\n name,\n ...globalItem.body.body.map((item) => {\n const property = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.TSPropertySignature} */ (\n item)?.key)?.name;\n /* c8 ignore next 3 -- Guard */\n if (!property) {\n return '';\n }\n\n return `${name}.${property}`;\n }).filter(Boolean),\n ];\n case 'VariableDeclarator':\n if (/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n /** @type {import('@typescript-eslint/types').TSESTree.CallExpression} */ (\n globalItem?.init\n )?.callee)?.name === 'require'\n ) {\n imports.push(/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n globalItem.id\n ).name);\n break;\n }\n\n return [];\n }\n\n return [\n name,\n ];\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 // Other methods are not in scope, but we need them, and we grab them here\n if (node?.type === 'MethodDefinition') {\n return /** @type {import('estree').ClassBody} */ (node.parent).body.flatMap((methodOrProp) => {\n if (methodOrProp.type === 'MethodDefinition') {\n // eslint-disable-next-line unicorn/no-lonely-if -- Pattern\n if (methodOrProp.key.type === 'Identifier') {\n return [\n methodOrProp.key.name,\n `${/** @type {import('estree').ClassDeclaration} */ (\n node.parent?.parent\n )?.id?.name}.${methodOrProp.key.name}`,\n ];\n }\n }\n\n if (methodOrProp.type === 'PropertyDefinition') {\n // eslint-disable-next-line unicorn/no-lonely-if -- Pattern\n if (methodOrProp.key.type === 'Identifier') {\n return [\n methodOrProp.key.name,\n `${/** @type {import('estree').ClassDeclaration} */ (\n node.parent?.parent\n )?.id?.name}.${methodOrProp.key.name}`,\n ];\n }\n }\n /* c8 ignore next 2 -- Not yet built */\n\n return '';\n }).filter(Boolean);\n }\n\n return [];\n })())\n .concat(...getValidRuntimeIdentifiers(node && (\n (sourceCode.getScope &&\n /* c8 ignore next 3 */\n sourceCode.getScope(node)) ||\n // @ts-expect-error ESLint 8\n context.getScope()\n )))\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 parsedType,\n tag,\n } of tagsWithTypes) {\n traverse(parsedType, (nde, parentNode) => {\n /**\n * @type {import('jsdoc-type-pratt-parser').NameResult & {\n * _parent?: import('jsdoc-type-pratt-parser').NonRootResult\n * }}\n */\n // eslint-disable-next-line canonical/id-match -- Avoid clashes\n (nde)._parent = parentNode;\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n let val = value;\n\n /** @type {import('jsdoc-type-pratt-parser').NonRootResult|undefined} */\n let currNode = nde;\n do {\n currNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').NameResult & {\n * _parent?: import('jsdoc-type-pratt-parser').NonRootResult\n * }}\n */ (currNode)._parent;\n if (\n // Avoid appending for imports and globals since we don't want to\n // check their properties which may or may not exist\n !imports.includes(val) && !globals.includes(val) &&\n !importTags.includes(val) &&\n !extraTypes.includes(val) &&\n !typedefDeclarations.includes(val) &&\n currNode && 'right' in currNode &&\n currNode.right?.type === 'JsdocTypeProperty') {\n val = val + '.' + currNode.right.value;\n }\n } while (currNode?.type === 'JsdocTypeNamePath');\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(val) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(val))\n ) {\n if (!disableReporting) {\n report(`The type '${val}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(val)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(val);\n /* c8 ignore next 4 */\n } else {\n // @ts-expect-error ESLint 8\n context.markVariableAsUsed(val);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Besides some expected built-in types, prohibits any types not specified as globals or within `@typedef`.',\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 description: `This array can be populated to indicate other types which\nare automatically considered as defined (in addition to globals, etc.).\nDefaults to an empty array.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n description: `Whether to disable reporting of errors. Defaults to\n\\`false\\`. This may be set to \\`true\\` in order to take advantage of only\nmarking defined variables as used.`,\n type: 'boolean',\n },\n markVariablesAsUsed: {\n description: `Whether to mark variables as used for the purposes\nof the \\`no-unused-vars\\` rule when they are not found to be undefined.\nDefaults to \\`true\\`. May be set to \\`false\\` to enforce a practice of not\nimporting types unless used in code.`,\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;AAMA,IAAAE,oBAAA,GAAAF,OAAA;AAE+B,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,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G,CAAC;UACjC;QACF;MACF;IACF,CAAC,CAAC;EACJ;AACF,CAAC,EAAE;EACDQ,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJ5E,WAAW,EAAE,0GAA0G;MACvH6E,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVvH,YAAY,EAAE;UACZuC,WAAW,EAAE;AACzB;AACA,4BAA4B;UAChBiF,KAAK,EAAE;YACLhF,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDvC,gBAAgB,EAAE;UAChBsC,WAAW,EAAE;AACzB;AACA,mCAAmC;UACvBC,IAAI,EAAE;QACR,CAAC;QACDtC,mBAAmB,EAAE;UACnBqC,WAAW,EAAE;AACzB;AACA;AACA,qCAAqC;UACzBC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAiF,MAAA,CAAAnI,OAAA,GAAAA,OAAA,CAAAf,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _buildForbidRuleDefinition = require("../buildForbidRuleDefinition.cjs");
|
|
8
|
+
var _default = exports.default = (0, _buildForbidRuleDefinition.buildForbidRuleDefinition)({
|
|
9
|
+
description: 'Requires tags be present, optionally for specific contexts',
|
|
10
|
+
getContexts(context, report) {
|
|
11
|
+
// Transformed options to this option in `modifyContext`:
|
|
12
|
+
if (!context.options[0].contexts) {
|
|
13
|
+
report('Rule `required-tags` is missing a `tags` option.');
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const {
|
|
17
|
+
contexts
|
|
18
|
+
} = context.options[0];
|
|
19
|
+
return contexts;
|
|
20
|
+
},
|
|
21
|
+
modifyContext(context) {
|
|
22
|
+
const tags = /** @type {(string|{tag: string, context: string})[]} */
|
|
23
|
+
context.options?.[0]?.tags;
|
|
24
|
+
const cntxts = tags?.map(tag => {
|
|
25
|
+
const tagName = typeof tag === 'string' ? tag : tag.tag;
|
|
26
|
+
return {
|
|
27
|
+
comment: `JsdocBlock:not(*:has(JsdocTag[tag=${tagName}]))`,
|
|
28
|
+
context: typeof tag === 'string' ? 'any' : tag.context,
|
|
29
|
+
message: `Missing required tag "${tagName}"`
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Reproduce context object with our own `contexts`
|
|
34
|
+
const propertyDescriptors = Object.getOwnPropertyDescriptors(context);
|
|
35
|
+
return Object.create(Object.getPrototypeOf(context), {
|
|
36
|
+
...propertyDescriptors,
|
|
37
|
+
options: {
|
|
38
|
+
...propertyDescriptors.options,
|
|
39
|
+
value: [{
|
|
40
|
+
contexts: cntxts
|
|
41
|
+
}]
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
schema: [{
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
properties: {
|
|
48
|
+
tags: {
|
|
49
|
+
description: `May be an array of either strings or objects with
|
|
50
|
+
a string \`tag\` property and \`context\` string property.`,
|
|
51
|
+
items: {
|
|
52
|
+
anyOf: [{
|
|
53
|
+
type: 'string'
|
|
54
|
+
}, {
|
|
55
|
+
properties: {
|
|
56
|
+
context: {
|
|
57
|
+
type: 'string'
|
|
58
|
+
},
|
|
59
|
+
tag: {
|
|
60
|
+
type: 'string'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
type: 'object'
|
|
64
|
+
}]
|
|
65
|
+
},
|
|
66
|
+
type: 'array'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
type: 'object'
|
|
70
|
+
}],
|
|
71
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/required-tags.md#repos-sticky-header'
|
|
72
|
+
});
|
|
73
|
+
module.exports = exports.default;
|
|
74
|
+
//# sourceMappingURL=requiredTags.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requiredTags.cjs","names":["_buildForbidRuleDefinition","require","_default","exports","default","buildForbidRuleDefinition","description","getContexts","context","report","options","contexts","modifyContext","tags","cntxts","map","tag","tagName","comment","message","propertyDescriptors","Object","getOwnPropertyDescriptors","create","getPrototypeOf","value","schema","additionalProperties","properties","items","anyOf","type","url","module"],"sources":["../../src/rules/requiredTags.js"],"sourcesContent":["import {\n buildForbidRuleDefinition,\n} from '../buildForbidRuleDefinition.js';\n\nexport default buildForbidRuleDefinition({\n description: 'Requires tags be present, optionally for specific contexts',\n getContexts (context, report) {\n // Transformed options to this option in `modifyContext`:\n if (!context.options[0].contexts) {\n report('Rule `required-tags` is missing a `tags` option.');\n return false;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n return contexts;\n },\n modifyContext (context) {\n const tags = /** @type {(string|{tag: string, context: string})[]} */ (\n context.options?.[0]?.tags\n );\n\n const cntxts = tags?.map((tag) => {\n const tagName = typeof tag === 'string' ? tag : tag.tag;\n return {\n comment: `JsdocBlock:not(*:has(JsdocTag[tag=${\n tagName\n }]))`,\n context: typeof tag === 'string' ? 'any' : tag.context,\n message: `Missing required tag \"${tagName}\"`,\n };\n });\n\n // Reproduce context object with our own `contexts`\n const propertyDescriptors = Object.getOwnPropertyDescriptors(context);\n return Object.create(\n Object.getPrototypeOf(context),\n {\n ...propertyDescriptors,\n options: {\n ...propertyDescriptors.options,\n value: [\n {\n contexts: cntxts,\n },\n ],\n },\n },\n );\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n tags: {\n description: `May be an array of either strings or objects with\na string \\`tag\\` property and \\`context\\` string property.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n properties: {\n context: {\n type: 'string',\n },\n tag: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/required-tags.md#repos-sticky-header',\n});\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AAEyC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE1B,IAAAC,oDAAyB,EAAC;EACvCC,WAAW,EAAE,4DAA4D;EACzEC,WAAWA,CAAEC,OAAO,EAAEC,MAAM,EAAE;IAC5B;IACA,IAAI,CAACD,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,QAAQ,EAAE;MAChCF,MAAM,CAAC,kDAAkD,CAAC;MAC1D,OAAO,KAAK;IACd;IAEA,MAAM;MACJE;IACF,CAAC,GAAGH,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC;IAEtB,OAAOC,QAAQ;EACjB,CAAC;EACDC,aAAaA,CAAEJ,OAAO,EAAE;IACtB,MAAMK,IAAI,GAAG;IACXL,OAAO,CAACE,OAAO,GAAG,CAAC,CAAC,EAAEG,IACvB;IAED,MAAMC,MAAM,GAAGD,IAAI,EAAEE,GAAG,CAAEC,GAAG,IAAK;MAChC,MAAMC,OAAO,GAAG,OAAOD,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAGA,GAAG,CAACA,GAAG;MACvD,OAAO;QACLE,OAAO,EAAE,qCACPD,OAAO,KACJ;QACLT,OAAO,EAAE,OAAOQ,GAAG,KAAK,QAAQ,GAAG,KAAK,GAAGA,GAAG,CAACR,OAAO;QACtDW,OAAO,EAAE,yBAAyBF,OAAO;MAC3C,CAAC;IACH,CAAC,CAAC;;IAEF;IACA,MAAMG,mBAAmB,GAAGC,MAAM,CAACC,yBAAyB,CAACd,OAAO,CAAC;IACrE,OAAOa,MAAM,CAACE,MAAM,CAClBF,MAAM,CAACG,cAAc,CAAChB,OAAO,CAAC,EAC9B;MACE,GAAGY,mBAAmB;MACtBV,OAAO,EAAE;QACP,GAAGU,mBAAmB,CAACV,OAAO;QAC9Be,KAAK,EAAE,CACL;UACEd,QAAQ,EAAEG;QACZ,CAAC;MAEL;IACF,CACF,CAAC;EACH,CAAC;EACDY,MAAM,EAAE,CACN;IACEC,oBAAoB,EAAE,KAAK;IAC3BC,UAAU,EAAE;MACVf,IAAI,EAAE;QACJP,WAAW,EAAE;AACvB,2DAA2D;QACjDuB,KAAK,EAAE;UACLC,KAAK,EAAE,CACL;YACEC,IAAI,EAAE;UACR,CAAC,EACD;YACEH,UAAU,EAAE;cACVpB,OAAO,EAAE;gBACPuB,IAAI,EAAE;cACR,CAAC;cACDf,GAAG,EAAE;gBACHe,IAAI,EAAE;cACR;YACF,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;QAEL,CAAC;QACDA,IAAI,EAAE;MACR;IACF,CAAC;IACDA,IAAI,EAAE;EACR,CAAC,CACF;EACDC,GAAG,EAAE;AACP,CAAC,CAAC;AAAAC,MAAA,CAAA9B,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
package/dist/rules.d.ts
CHANGED
|
@@ -2580,6 +2580,26 @@ export interface Rules {
|
|
|
2580
2580
|
/** Requires a type for `@yields` tags */
|
|
2581
2581
|
"jsdoc/require-yields-type": [];
|
|
2582
2582
|
|
|
2583
|
+
/** Requires tags be present, optionally for specific contexts */
|
|
2584
|
+
"jsdoc/required-tags":
|
|
2585
|
+
| []
|
|
2586
|
+
| [
|
|
2587
|
+
{
|
|
2588
|
+
/**
|
|
2589
|
+
* May be an array of either strings or objects with
|
|
2590
|
+
* a string `tag` property and `context` string property.
|
|
2591
|
+
*/
|
|
2592
|
+
tags?: (
|
|
2593
|
+
| string
|
|
2594
|
+
| {
|
|
2595
|
+
context?: string;
|
|
2596
|
+
tag?: string;
|
|
2597
|
+
[k: string]: unknown;
|
|
2598
|
+
}
|
|
2599
|
+
)[];
|
|
2600
|
+
}
|
|
2601
|
+
];
|
|
2602
|
+
|
|
2583
2603
|
/** Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups. */
|
|
2584
2604
|
"jsdoc/sort-tags":
|
|
2585
2605
|
| []
|
package/package.json
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import iterateJsdoc from './iterateJsdoc.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {(string|{
|
|
5
|
+
* comment: string,
|
|
6
|
+
* context: string,
|
|
7
|
+
* message?: string
|
|
8
|
+
* })[]} Contexts
|
|
9
|
+
*/
|
|
10
|
+
|
|
3
11
|
/**
|
|
4
12
|
* @param {{
|
|
5
|
-
* contexts
|
|
6
|
-
* comment: string,
|
|
7
|
-
* context: string,
|
|
8
|
-
* message: string
|
|
9
|
-
* })[],
|
|
13
|
+
* contexts?: Contexts,
|
|
10
14
|
* description?: string,
|
|
11
|
-
*
|
|
15
|
+
* getContexts?: (
|
|
16
|
+
* ctxt: import('eslint').Rule.RuleContext,
|
|
17
|
+
* report: import('./iterateJsdoc.js').Report
|
|
18
|
+
* ) => Contexts|false,
|
|
19
|
+
* contextName?: string,
|
|
20
|
+
* modifyContext?: (context: import('eslint').Rule.RuleContext) => import('eslint').Rule.RuleContext,
|
|
21
|
+
* schema?: import('eslint').Rule.RuleMetaData['schema']
|
|
12
22
|
* url?: string,
|
|
13
23
|
* }} cfg
|
|
14
24
|
* @returns {import('@eslint/core').RuleDefinition<
|
|
@@ -17,22 +27,35 @@ import iterateJsdoc from './iterateJsdoc.js';
|
|
|
17
27
|
*/
|
|
18
28
|
export const buildForbidRuleDefinition = ({
|
|
19
29
|
contextName,
|
|
20
|
-
contexts,
|
|
30
|
+
contexts: cntxts,
|
|
21
31
|
description,
|
|
32
|
+
getContexts,
|
|
33
|
+
modifyContext,
|
|
34
|
+
schema,
|
|
22
35
|
url,
|
|
23
36
|
}) => {
|
|
24
37
|
return iterateJsdoc(({
|
|
25
|
-
|
|
38
|
+
context,
|
|
26
39
|
info: {
|
|
27
40
|
comment,
|
|
28
41
|
},
|
|
29
42
|
report,
|
|
30
43
|
utils,
|
|
31
44
|
}) => {
|
|
45
|
+
/** @type {Contexts|boolean|undefined} */
|
|
46
|
+
let contexts = cntxts;
|
|
47
|
+
|
|
48
|
+
if (getContexts) {
|
|
49
|
+
contexts = getContexts(context, report);
|
|
50
|
+
if (!contexts) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
const {
|
|
33
56
|
contextStr,
|
|
34
57
|
foundContext,
|
|
35
|
-
} = utils.findContext(contexts, comment);
|
|
58
|
+
} = utils.findContext(/** @type {Contexts} */ (contexts), comment);
|
|
36
59
|
|
|
37
60
|
// We are not on the *particular* matching context/comment, so don't assume
|
|
38
61
|
// we need reporting
|
|
@@ -59,10 +82,10 @@ export const buildForbidRuleDefinition = ({
|
|
|
59
82
|
description: description ?? contextName ?? 'Reports when certain comment structures are present.',
|
|
60
83
|
url: url ?? 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/advanced.md#user-content-advanced-creating-your-own-rules',
|
|
61
84
|
},
|
|
62
|
-
schema: [],
|
|
85
|
+
schema: schema ?? [],
|
|
63
86
|
type: 'suggestion',
|
|
64
87
|
},
|
|
65
|
-
modifyContext: (context) => {
|
|
88
|
+
modifyContext: modifyContext ?? (getContexts ? undefined : (context) => {
|
|
66
89
|
// Reproduce context object with our own `contexts`
|
|
67
90
|
const propertyDescriptors = Object.getOwnPropertyDescriptors(context);
|
|
68
91
|
return Object.create(
|
|
@@ -73,13 +96,13 @@ export const buildForbidRuleDefinition = ({
|
|
|
73
96
|
...propertyDescriptors.options,
|
|
74
97
|
value: [
|
|
75
98
|
{
|
|
76
|
-
contexts,
|
|
99
|
+
contexts: cntxts,
|
|
77
100
|
},
|
|
78
101
|
],
|
|
79
102
|
},
|
|
80
103
|
},
|
|
81
104
|
);
|
|
82
|
-
},
|
|
105
|
+
}),
|
|
83
106
|
nonGlobalSettings: true,
|
|
84
107
|
});
|
|
85
108
|
};
|
package/src/index-cjs.js
CHANGED
|
@@ -40,6 +40,7 @@ import noUndefinedTypes from './rules/noUndefinedTypes.js';
|
|
|
40
40
|
import requireAsteriskPrefix from './rules/requireAsteriskPrefix.js';
|
|
41
41
|
import requireDescription from './rules/requireDescription.js';
|
|
42
42
|
import requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence.js';
|
|
43
|
+
import requiredTags from './rules/requiredTags.js';
|
|
43
44
|
import requireExample from './rules/requireExample.js';
|
|
44
45
|
import requireFileOverview from './rules/requireFileOverview.js';
|
|
45
46
|
import requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription.js';
|
|
@@ -226,6 +227,7 @@ index.rules = {
|
|
|
226
227
|
description: 'Requires a type for `@yields` tags',
|
|
227
228
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-type.md#repos-sticky-header',
|
|
228
229
|
}),
|
|
230
|
+
'required-tags': requiredTags,
|
|
229
231
|
'sort-tags': sortTags,
|
|
230
232
|
'tag-lines': tagLines,
|
|
231
233
|
'text-escaping': textEscaping,
|
|
@@ -312,6 +314,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
312
314
|
'jsdoc/require-yields-check': warnOrError,
|
|
313
315
|
'jsdoc/require-yields-description': 'off',
|
|
314
316
|
'jsdoc/require-yields-type': warnOrError,
|
|
317
|
+
'jsdoc/required-tags': 'off',
|
|
315
318
|
'jsdoc/sort-tags': 'off',
|
|
316
319
|
'jsdoc/tag-lines': warnOrError,
|
|
317
320
|
'jsdoc/text-escaping': 'off',
|
package/src/index.js
CHANGED
|
@@ -46,6 +46,7 @@ import noUndefinedTypes from './rules/noUndefinedTypes.js';
|
|
|
46
46
|
import requireAsteriskPrefix from './rules/requireAsteriskPrefix.js';
|
|
47
47
|
import requireDescription from './rules/requireDescription.js';
|
|
48
48
|
import requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence.js';
|
|
49
|
+
import requiredTags from './rules/requiredTags.js';
|
|
49
50
|
import requireExample from './rules/requireExample.js';
|
|
50
51
|
import requireFileOverview from './rules/requireFileOverview.js';
|
|
51
52
|
import requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription.js';
|
|
@@ -232,6 +233,7 @@ index.rules = {
|
|
|
232
233
|
description: 'Requires a type for `@yields` tags',
|
|
233
234
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-type.md#repos-sticky-header',
|
|
234
235
|
}),
|
|
236
|
+
'required-tags': requiredTags,
|
|
235
237
|
'sort-tags': sortTags,
|
|
236
238
|
'tag-lines': tagLines,
|
|
237
239
|
'text-escaping': textEscaping,
|
|
@@ -318,6 +320,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
318
320
|
'jsdoc/require-yields-check': warnOrError,
|
|
319
321
|
'jsdoc/require-yields-description': 'off',
|
|
320
322
|
'jsdoc/require-yields-type': warnOrError,
|
|
323
|
+
'jsdoc/required-tags': 'off',
|
|
321
324
|
'jsdoc/sort-tags': 'off',
|
|
322
325
|
'jsdoc/tag-lines': warnOrError,
|
|
323
326
|
'jsdoc/text-escaping': 'off',
|