eslint-plugin-jsdoc 46.4.3 → 46.4.5
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/dist/exportParser.js +3 -3
- package/dist/exportParser.js.map +1 -1
- package/dist/generateRule.js +3 -3
- package/dist/generateRule.js.map +1 -1
- package/dist/index.js +56 -54
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +3 -6
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js +6 -6
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkAccess.js +1 -1
- package/dist/rules/checkAccess.js.map +1 -1
- package/dist/rules/checkAlignment.js +1 -1
- package/dist/rules/checkAlignment.js.map +1 -1
- package/dist/rules/checkExamples.js +1 -1
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkIndentation.js +1 -1
- package/dist/rules/checkIndentation.js.map +1 -1
- package/dist/rules/checkLineAlignment.js +2 -2
- package/dist/rules/checkLineAlignment.js.map +1 -1
- package/dist/rules/checkParamNames.js +1 -1
- package/dist/rules/checkParamNames.js.map +1 -1
- package/dist/rules/checkPropertyNames.js +1 -1
- package/dist/rules/checkPropertyNames.js.map +1 -1
- package/dist/rules/checkSyntax.js +1 -1
- package/dist/rules/checkSyntax.js.map +1 -1
- package/dist/rules/checkTagNames.js +2 -2
- package/dist/rules/checkTagNames.js.map +1 -1
- package/dist/rules/checkTypes.js +5 -5
- package/dist/rules/checkTypes.js.map +1 -1
- package/dist/rules/checkValues.js +1 -1
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/emptyTags.js +1 -1
- package/dist/rules/emptyTags.js.map +1 -1
- package/dist/rules/implementsOnClasses.js +1 -1
- package/dist/rules/implementsOnClasses.js.map +1 -1
- package/dist/rules/importsAsDependencies.js +1 -1
- package/dist/rules/importsAsDependencies.js.map +1 -1
- package/dist/rules/informativeDocs.js +1 -1
- package/dist/rules/informativeDocs.js.map +1 -1
- package/dist/rules/matchDescription.js +1 -1
- package/dist/rules/matchDescription.js.map +1 -1
- package/dist/rules/matchName.js +1 -1
- package/dist/rules/matchName.js.map +1 -1
- package/dist/rules/multilineBlocks.js +1 -1
- package/dist/rules/multilineBlocks.js.map +1 -1
- package/dist/rules/noBadBlocks.js +1 -1
- package/dist/rules/noBadBlocks.js.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.js +1 -1
- package/dist/rules/noBlankBlockDescriptions.js.map +1 -1
- package/dist/rules/noBlankBlocks.js +1 -1
- package/dist/rules/noBlankBlocks.js.map +1 -1
- package/dist/rules/noDefaults.js +1 -1
- package/dist/rules/noDefaults.js.map +1 -1
- package/dist/rules/noMissingSyntax.js +1 -1
- package/dist/rules/noMissingSyntax.js.map +1 -1
- package/dist/rules/noMultiAsterisks.js +1 -1
- package/dist/rules/noMultiAsterisks.js.map +1 -1
- package/dist/rules/noRestrictedSyntax.js +1 -1
- package/dist/rules/noRestrictedSyntax.js.map +1 -1
- package/dist/rules/noTypes.js +1 -1
- package/dist/rules/noTypes.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js +4 -4
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/requireAsteriskPrefix.js +1 -1
- package/dist/rules/requireAsteriskPrefix.js.map +1 -1
- package/dist/rules/requireDescription.js +1 -1
- package/dist/rules/requireDescription.js.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
- package/dist/rules/requireExample.js +1 -1
- package/dist/rules/requireExample.js.map +1 -1
- package/dist/rules/requireFileOverview.js +1 -1
- package/dist/rules/requireFileOverview.js.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
- package/dist/rules/requireJsdoc.js +3 -3
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/dist/rules/requireParam.js +1 -1
- package/dist/rules/requireParam.js.map +1 -1
- package/dist/rules/requireParamDescription.js +1 -1
- package/dist/rules/requireParamDescription.js.map +1 -1
- package/dist/rules/requireParamName.js +1 -1
- package/dist/rules/requireParamName.js.map +1 -1
- package/dist/rules/requireParamType.js +1 -1
- package/dist/rules/requireParamType.js.map +1 -1
- package/dist/rules/requireProperty.js +1 -1
- package/dist/rules/requireProperty.js.map +1 -1
- package/dist/rules/requirePropertyDescription.js +1 -1
- package/dist/rules/requirePropertyDescription.js.map +1 -1
- package/dist/rules/requirePropertyName.js +1 -1
- package/dist/rules/requirePropertyName.js.map +1 -1
- package/dist/rules/requirePropertyType.js +1 -1
- package/dist/rules/requirePropertyType.js.map +1 -1
- package/dist/rules/requireReturns.js +1 -1
- package/dist/rules/requireReturns.js.map +1 -1
- package/dist/rules/requireReturnsCheck.js +1 -1
- package/dist/rules/requireReturnsCheck.js.map +1 -1
- package/dist/rules/requireReturnsDescription.js +1 -1
- package/dist/rules/requireReturnsDescription.js.map +1 -1
- package/dist/rules/requireReturnsType.js +1 -1
- package/dist/rules/requireReturnsType.js.map +1 -1
- package/dist/rules/requireThrows.js +1 -1
- package/dist/rules/requireThrows.js.map +1 -1
- package/dist/rules/requireYields.js +1 -1
- package/dist/rules/requireYields.js.map +1 -1
- package/dist/rules/requireYieldsCheck.js +1 -1
- package/dist/rules/requireYieldsCheck.js.map +1 -1
- package/dist/rules/sortTags.js +2 -2
- package/dist/rules/sortTags.js.map +1 -1
- package/dist/rules/tagLines.js +3 -3
- package/dist/rules/tagLines.js.map +1 -1
- package/dist/rules/textEscaping.js +1 -1
- package/dist/rules/textEscaping.js.map +1 -1
- package/dist/rules/validTypes.js +3 -3
- package/dist/rules/validTypes.js.map +1 -1
- package/dist/utils/hasReturnValue.js +6 -6
- package/dist/utils/hasReturnValue.js.map +1 -1
- package/docs/rules/require-param.md +2 -2
- package/package.json +23 -23
package/dist/exportParser.js
CHANGED
|
@@ -622,8 +622,8 @@ const findExportedNode = function (block, node, cache) {
|
|
|
622
622
|
* @returns {boolean}
|
|
623
623
|
*/
|
|
624
624
|
const isNodeExported = function (node, globals, opt) {
|
|
625
|
-
var _globals$props$module
|
|
626
|
-
const moduleExports = (_globals$props$module = globals.props.module) === null || _globals$props$module === void 0
|
|
625
|
+
var _globals$props$module;
|
|
626
|
+
const moduleExports = (_globals$props$module = globals.props.module) === null || _globals$props$module === void 0 || (_globals$props$module = _globals$props$module.props) === null || _globals$props$module === void 0 ? void 0 : _globals$props$module.exports;
|
|
627
627
|
if (opt.initModuleExports && moduleExports && findNode(node, moduleExports)) {
|
|
628
628
|
return true;
|
|
629
629
|
}
|
|
@@ -695,7 +695,7 @@ const accessibilityNodes = new Set(['PropertyDefinition', 'MethodDefinition']);
|
|
|
695
695
|
* @returns {boolean}
|
|
696
696
|
*/
|
|
697
697
|
const hasAccessibility = node => {
|
|
698
|
-
return accessibilityNodes.has(node.type) && 'accessibility' in node && node.accessibility !== 'public';
|
|
698
|
+
return accessibilityNodes.has(node.type) && 'accessibility' in node && node.accessibility !== 'public' && node.accessibility !== undefined;
|
|
699
699
|
};
|
|
700
700
|
|
|
701
701
|
/**
|
package/dist/exportParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportParser.js","names":["_jsdoccomment","require","_debug","_interopRequireDefault","obj","__esModule","default","debug","debugModule","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","object","propertySymbol","property","computed","propertyValue","body","val","prototype","left","right","method","key","parent","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","nde","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","Boolean","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","idx","ignorableIfDeep","has","canBeExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","pval","isNodeExported","_globals$props$module","_globals$props$module2","moduleExports","module","exports","initModuleExports","esm","parseRecursive","globalVars","parse","ast","accessibilityNodes","hasAccessibility","accessibility","isUncommentedExport","sourceCode","settings","exportNode","findJSDocComment","parseResult","_default"],"sources":["../src/exportParser.js"],"sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\n/**\n * @typedef {{\n * value: string\n * }} ValueObject\n */\n\n/**\n * @typedef {{\n * type?: string,\n * value?: ValueObject|import('eslint').Rule.Node,\n * props: {\n * [key: string]: CreatedNode|null,\n * },\n * special?: true,\n * globalVars?: CreatedNode,\n * exported?: boolean,\n * ANONYMOUS_DEFAULT?: import('eslint').Rule.Node\n * }} CreatedNode\n */\n\n/**\n * @returns {CreatedNode}\n */\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\n/**\n * @param {CreatedNode|null} symbol\n * @returns {string|null}\n */\nconst getSymbolValue = function (symbol) {\n /* istanbul ignore if */\n if (!symbol) {\n return null;\n }\n\n /* istanbul ignore else */\n if (symbol.type === 'literal') {\n return /** @type {ValueObject} */ (symbol.value).value;\n }\n\n /* istanbul ignore next */\n return null;\n};\n\n/**\n *\n * @param {import('estree').Identifier} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} opts\n * @returns {CreatedNode|null}\n */\nconst getIdentifier = function (node, globals, scope, opts) {\n if (opts.simpleIdentifier) {\n // Type is Identier for noncomputed properties\n const identifierLiteral = createNode();\n identifierLiteral.type = 'literal';\n identifierLiteral.value = {\n value: node.name,\n };\n\n return identifierLiteral;\n }\n\n /* istanbul ignore next */\n const block = scope || globals;\n\n // As scopes are not currently supported, they are not traversed upwards recursively\n if (block.props[node.name]) {\n return block.props[node.name];\n }\n\n // Seems this will only be entered once scopes added and entered\n /* istanbul ignore next */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\n/**\n * @callback CreateSymbol\n * @param {import('eslint').Rule.Node|null} node\n * @param {CreatedNode} globals\n * @param {import('eslint').Rule.Node|null} value\n * @param {CreatedNode} [scope]\n * @param {boolean|SymbolOptions} [isGlobal]\n * @returns {CreatedNode|null}\n */\n\n/** @type {CreateSymbol} */\nlet createSymbol; // eslint-disable-line prefer-const\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * @typedef {{\n * simpleIdentifier?: boolean\n * }} SymbolOptions\n */\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} [opt]\n * @returns {CreatedNode|null}\n */\nconst getSymbol = function (node, globals, scope, opt) {\n /* eslint-enable complexity -- Temporary */\n const opts = opt || {};\n /* istanbul ignore next */\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.object),\n globals,\n scope,\n opts,\n );\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.property),\n globals,\n scope,\n {\n simpleIdentifier: !node.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* istanbul ignore else */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n /* istanbul ignore next */\n debug(`MemberExpression: Missing property ${\n /** @type {import('estree').PrivateIdentifier} */ (node.property).name\n }`);\n\n /* istanbul ignore next */\n return null;\n }\n\n case 'ClassExpression': {\n return getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.body),\n globals,\n scope,\n opts,\n );\n }\n\n // @ts-expect-error TS OK\n case 'TSTypeAliasDeclaration':\n // @ts-expect-error TS OK\n // Fallthrough\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n case 'ClassDeclaration':\n case 'FunctionExpression': case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n const val = createNode();\n val.props.prototype = createNode();\n val.props.prototype.type = 'object';\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'AssignmentExpression': {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n scope,\n opts,\n );\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n val.props[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ] = createNode();\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].type = 'object';\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].value = /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').MethodDefinition} */ (method).value\n );\n }\n\n val.type = 'object';\n val.value = node.parent;\n\n return val;\n }\n\n case 'ObjectExpression': {\n const val = createNode();\n val.type = 'object';\n for (const prop of node.properties) {\n if ([\n // @typescript-eslint/parser, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').Property} */\n (prop).value\n ),\n globals,\n scope,\n opts,\n );\n /* istanbul ignore if */\n if (propVal) {\n val.props[\n /** @type {import('estree').PrivateIdentifier} */\n (\n /** @type {import('estree').Property} */ (prop).key\n ).name\n ] = propVal;\n }\n }\n\n return val;\n }\n\n case 'Literal': {\n const val = createNode();\n val.type = 'literal';\n val.value = node;\n\n return val;\n }\n }\n\n /* istanbul ignore next */\n return null;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {string} name\n * @param {CreatedNode|null} value\n * @param {CreatedNode} globals\n * @param {boolean|SymbolOptions|undefined} isGlobal\n * @returns {void}\n */\nconst createBlockSymbol = function (block, name, value, globals, isGlobal) {\n block.props[name] = value;\n if (isGlobal && globals.props.window && globals.props.window.special) {\n globals.props.window.props[name] = value;\n }\n};\n\ncreateSymbol = function (node, globals, value, scope, isGlobal) {\n const block = scope || globals;\n /* istanbul ignore if */\n if (!node) {\n return null;\n }\n\n let symbol;\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'FunctionDeclaration':\n /* istanbul ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* istanbul ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n const nde = /** @type {import('estree').ClassDeclaration} */ (node);\n /* istanbul ignore else */\n if (nde.id && nde.id.type === 'Identifier') {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.id),\n globals,\n node,\n globals,\n );\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'Identifier': {\n const nde = /** @type {import('estree').Identifier} */ (node);\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* istanbul ignore else */\n if (valueSymbol) {\n createBlockSymbol(block, nde.name, valueSymbol, globals, isGlobal);\n\n return block.props[nde.name];\n }\n\n /* istanbul ignore next */\n debug('Identifier: Missing value symbol for %s', nde.name);\n } else {\n createBlockSymbol(block, nde.name, createNode(), globals, isGlobal);\n\n return block.props[nde.name];\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'MemberExpression': {\n const nde = /** @type {import('estree').MemberExpression} */ (node);\n symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.object), globals, block,\n );\n\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.property),\n globals,\n block,\n {\n simpleIdentifier: !nde.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (value), globals, block,\n ), globals, isGlobal);\n return symbol.props[propertyValue];\n }\n\n debug(\n 'MemberExpression: Missing symbol: %s',\n /** @type {import('estree').Identifier} */ (\n nde.property\n ).name,\n );\n break;\n }\n }\n\n return null;\n};\n\n/**\n * Creates variables from variable definitions\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {void}\n */\nconst initVariables = function (node, globals, opts) {\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n null,\n globals,\n );\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[\n /** @type {import('estree').Identifier} */\n (declaration.id).name\n ] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n );\n }\n\n break;\n }\n }\n};\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * Populates variable maps using AST\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {true} [isExport]\n * @returns {boolean}\n */\nconst mapVariables = function (node, globals, opt, isExport) {\n /* eslint-enable complexity -- Temporary */\n /* istanbul ignore next */\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Program': {\n if (opts.ancestorsOnly) {\n return false;\n }\n\n for (const childNode of node.body) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = Boolean(opts.initWindow && node.kind === 'var' && globals.props.window);\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (declaration.init),\n globals,\n isGlobal,\n );\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'FunctionDeclaration': {\n /* istanbul ignore if */\n if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.id),\n globals,\n node,\n globals,\n true,\n );\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n if (symbol) {\n symbol.exported = true;\n } else {\n // if (!node.id) {\n globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ (\n node.declaration\n );\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n true,\n );\n } else {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n /* istanbul ignore if */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (specifier),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.local),\n globals,\n globals,\n );\n /* istanbul ignore if */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(\n /** @type {import('eslint').Rule.Node|null} */ (node.id),\n globals,\n /** @type {import('eslint').Rule.Node} */ (node.body),\n globals,\n );\n break;\n }\n\n default: {\n /* istanbul ignore next */\n return false;\n }\n }\n\n return true;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode|ValueObject|string|undefined|\n * import('eslint').Rule.Node} block\n * @param {(CreatedNode|ValueObject|string|\n * import('eslint').Rule.Node)[]} [cache]\n * @returns {boolean}\n */\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n typeof block === 'object' &&\n 'type' in block &&\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n if (typeof block !== 'object') {\n return false;\n }\n\n const props = ('props' in block && block.props) || ('body' in block && block.body);\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* istanbul ignore if */\n if (propval.some((val) => {\n return findNode(node, val, blockCache);\n })) {\n return true;\n }\n } else if (findNode(node, propval, blockCache)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst exportTypes = new Set([\n 'ExportNamedDeclaration', 'ExportDefaultDeclaration',\n]);\nconst ignorableNestedTypes = new Set([\n 'FunctionDeclaration', 'ArrowFunctionExpression', 'FunctionExpression',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {import('eslint').Rule.Node|false}\n */\nconst getExportAncestor = function (nde) {\n let node = nde;\n let idx = 0;\n const ignorableIfDeep = ignorableNestedTypes.has(nde?.type);\n while (node) {\n // Ignore functions nested more deeply than say `export default function () {}`\n if (idx >= 2 && ignorableIfDeep) {\n break;\n }\n\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n node = node.parent;\n idx++;\n }\n\n return false;\n};\n\nconst canBeExportedByAncestorType = new Set([\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'ClassProperty',\n 'PropertyDefinition',\n 'Method',\n]);\n\nconst canExportChildrenType = new Set([\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'TSTypeLiteral',\n 'TSTypeAliasDeclaration',\n 'ClassDeclaration',\n 'ClassBody',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {false|import('eslint').Rule.Node}\n */\nconst isExportByAncestor = function (nde) {\n if (!canBeExportedByAncestorType.has(nde.type)) {\n return false;\n }\n\n let node = nde.parent;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n if (!canExportChildrenType.has(node.type)) {\n return false;\n }\n\n node = node.parent;\n }\n\n return false;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode[]} [cache] Currently unused\n * @returns {boolean}\n */\nconst findExportedNode = function (block, node, cache) {\n /* istanbul ignore if */\n if (block === null) {\n return false;\n }\n\n const blockCache = cache || [];\n const {\n props,\n } = block;\n for (const propval of Object.values(props)) {\n const pval = /** @type {CreatedNode} */ (propval);\n blockCache.push(pval);\n if (pval.exported && (node === pval.value || findNode(node, pval.value))) {\n return true;\n }\n\n // No need to check `propval` for exported nodes as ESM\n // exports are only global\n }\n\n return false;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {boolean}\n */\nconst isNodeExported = function (node, globals, opt) {\n const moduleExports = globals.props.module?.props?.exports;\n if (\n opt.initModuleExports && moduleExports && findNode(node, moduleExports)\n ) {\n return true;\n }\n\n if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) {\n return true;\n }\n\n if (opt.esm && findExportedNode(globals, node)) {\n return true;\n }\n\n return false;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globalVars\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {boolean}\n */\nconst parseRecursive = function (node, globalVars, opts) {\n // Iterate from top using recursion - stop at first processed node from top\n if (node.parent && parseRecursive(node.parent, globalVars, opts)) {\n return true;\n }\n\n return mapVariables(node, globalVars, opts);\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} ast\n * @param {import('eslint').Rule.Node} node\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {CreatedNode}\n */\nconst parse = function (ast, node, opt) {\n /* istanbul ignore next */\n const opts = opt || {\n ancestorsOnly: false,\n esm: true,\n initModuleExports: true,\n initWindow: true,\n };\n\n const globalVars = createNode();\n if (opts.initModuleExports) {\n globalVars.props.module = createNode();\n globalVars.props.module.props.exports = createNode();\n globalVars.props.exports = globalVars.props.module.props.exports;\n }\n\n if (opts.initWindow) {\n globalVars.props.window = createNode();\n globalVars.props.window.special = true;\n }\n\n if (opts.ancestorsOnly) {\n parseRecursive(node, globalVars, opts);\n } else {\n initVariables(ast, globalVars, opts);\n mapVariables(ast, globalVars, opts);\n }\n\n return {\n globalVars,\n props: {},\n };\n};\n\nconst accessibilityNodes = new Set([\n 'PropertyDefinition',\n 'MethodDefinition',\n]);\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @returns {boolean}\n */\nconst hasAccessibility = (node) => {\n return accessibilityNodes.has(node.type) && 'accessibility' in node &&\n node.accessibility !== 'public';\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {import('./iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n if (hasAccessibility(node) ||\n node.parent && hasAccessibility(node.parent)) {\n return false;\n }\n\n const exportNode = getExportAncestor(node);\n\n // Is export node comment\n if (exportNode && !findJSDocComment(exportNode, sourceCode, settings)) {\n return true;\n }\n\n /**\n * Some typescript types are not in variable map, but inherit exported (interface property and method)\n */\n if (\n isExportByAncestor(node) &&\n !findJSDocComment(node, sourceCode, settings)\n ) {\n return true;\n }\n }\n\n const ast = /** @type {unknown} */ (sourceCode.ast);\n\n const parseResult = parse(\n /** @type {import('eslint').Rule.Node} */\n (ast),\n node,\n opt,\n );\n\n return isNodeExported(\n node, /** @type {CreatedNode} */ (parseResult.globalVars), opt,\n );\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAW,EAAC,oBAAoB,CAAC;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAA,EAAY;EAC7B,OAAO;IACLC,KAAK,EAAE,CAAC;EACV,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,SAAAA,CAAUC,MAAM,EAAE;EACvC;EACA,IAAI,CAACA,MAAM,EAAE;IACX,OAA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ACCC,GAAG,EACJtF,IAAI,EACJU,GACF,CAAC;EAED,OAAOiE,cAAc,CACnB3E,IAAI,EAAE,0BAA4B+F,WAAW,CAACX,UAAU,EAAG1E,GAC7D,CAAC;AACH,CAAC;AAAC,IAAAsF,QAAA,GAEa;EACbN,mBAAmB;EACnBL;AACF,CAAC;AAAAL,OAAA,CAAA1F,OAAA,GAAA0G,QAAA;AAAAjB,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAA1F,OAAA"}
|
|
1
|
+
{"version":3,"file":"exportParser.js","names":["_jsdoccomment","require","_debug","_interopRequireDefault","obj","__esModule","default","debug","debugModule","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","object","propertySymbol","property","computed","propertyValue","body","val","prototype","left","right","method","key","parent","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","nde","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","Boolean","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","idx","ignorableIfDeep","has","canBeExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","pval","isNodeExported","_globals$props$module","moduleExports","module","exports","initModuleExports","esm","parseRecursive","globalVars","parse","ast","accessibilityNodes","hasAccessibility","accessibility","undefined","isUncommentedExport","sourceCode","settings","exportNode","findJSDocComment","parseResult","_default"],"sources":["../src/exportParser.js"],"sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\n/**\n * @typedef {{\n * value: string\n * }} ValueObject\n */\n\n/**\n * @typedef {{\n * type?: string,\n * value?: ValueObject|import('eslint').Rule.Node,\n * props: {\n * [key: string]: CreatedNode|null,\n * },\n * special?: true,\n * globalVars?: CreatedNode,\n * exported?: boolean,\n * ANONYMOUS_DEFAULT?: import('eslint').Rule.Node\n * }} CreatedNode\n */\n\n/**\n * @returns {CreatedNode}\n */\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\n/**\n * @param {CreatedNode|null} symbol\n * @returns {string|null}\n */\nconst getSymbolValue = function (symbol) {\n /* istanbul ignore if */\n if (!symbol) {\n return null;\n }\n\n /* istanbul ignore else */\n if (symbol.type === 'literal') {\n return /** @type {ValueObject} */ (symbol.value).value;\n }\n\n /* istanbul ignore next */\n return null;\n};\n\n/**\n *\n * @param {import('estree').Identifier} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} opts\n * @returns {CreatedNode|null}\n */\nconst getIdentifier = function (node, globals, scope, opts) {\n if (opts.simpleIdentifier) {\n // Type is Identier for noncomputed properties\n const identifierLiteral = createNode();\n identifierLiteral.type = 'literal';\n identifierLiteral.value = {\n value: node.name,\n };\n\n return identifierLiteral;\n }\n\n /* istanbul ignore next */\n const block = scope || globals;\n\n // As scopes are not currently supported, they are not traversed upwards recursively\n if (block.props[node.name]) {\n return block.props[node.name];\n }\n\n // Seems this will only be entered once scopes added and entered\n /* istanbul ignore next */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\n/**\n * @callback CreateSymbol\n * @param {import('eslint').Rule.Node|null} node\n * @param {CreatedNode} globals\n * @param {import('eslint').Rule.Node|null} value\n * @param {CreatedNode} [scope]\n * @param {boolean|SymbolOptions} [isGlobal]\n * @returns {CreatedNode|null}\n */\n\n/** @type {CreateSymbol} */\nlet createSymbol; // eslint-disable-line prefer-const\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * @typedef {{\n * simpleIdentifier?: boolean\n * }} SymbolOptions\n */\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} [opt]\n * @returns {CreatedNode|null}\n */\nconst getSymbol = function (node, globals, scope, opt) {\n /* eslint-enable complexity -- Temporary */\n const opts = opt || {};\n /* istanbul ignore next */\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.object),\n globals,\n scope,\n opts,\n );\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.property),\n globals,\n scope,\n {\n simpleIdentifier: !node.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* istanbul ignore else */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n /* istanbul ignore next */\n debug(`MemberExpression: Missing property ${\n /** @type {import('estree').PrivateIdentifier} */ (node.property).name\n }`);\n\n /* istanbul ignore next */\n return null;\n }\n\n case 'ClassExpression': {\n return getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.body),\n globals,\n scope,\n opts,\n );\n }\n\n // @ts-expect-error TS OK\n case 'TSTypeAliasDeclaration':\n // @ts-expect-error TS OK\n // Fallthrough\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n case 'ClassDeclaration':\n case 'FunctionExpression': case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n const val = createNode();\n val.props.prototype = createNode();\n val.props.prototype.type = 'object';\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'AssignmentExpression': {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n scope,\n opts,\n );\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n val.props[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ] = createNode();\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].type = 'object';\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].value = /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').MethodDefinition} */ (method).value\n );\n }\n\n val.type = 'object';\n val.value = node.parent;\n\n return val;\n }\n\n case 'ObjectExpression': {\n const val = createNode();\n val.type = 'object';\n for (const prop of node.properties) {\n if ([\n // @typescript-eslint/parser, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').Property} */\n (prop).value\n ),\n globals,\n scope,\n opts,\n );\n /* istanbul ignore if */\n if (propVal) {\n val.props[\n /** @type {import('estree').PrivateIdentifier} */\n (\n /** @type {import('estree').Property} */ (prop).key\n ).name\n ] = propVal;\n }\n }\n\n return val;\n }\n\n case 'Literal': {\n const val = createNode();\n val.type = 'literal';\n val.value = node;\n\n return val;\n }\n }\n\n /* istanbul ignore next */\n return null;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {string} name\n * @param {CreatedNode|null} value\n * @param {CreatedNode} globals\n * @param {boolean|SymbolOptions|undefined} isGlobal\n * @returns {void}\n */\nconst createBlockSymbol = function (block, name, value, globals, isGlobal) {\n block.props[name] = value;\n if (isGlobal && globals.props.window && globals.props.window.special) {\n globals.props.window.props[name] = value;\n }\n};\n\ncreateSymbol = function (node, globals, value, scope, isGlobal) {\n const block = scope || globals;\n /* istanbul ignore if */\n if (!node) {\n return null;\n }\n\n let symbol;\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'FunctionDeclaration':\n /* istanbul ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* istanbul ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n const nde = /** @type {import('estree').ClassDeclaration} */ (node);\n /* istanbul ignore else */\n if (nde.id && nde.id.type === 'Identifier') {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.id),\n globals,\n node,\n globals,\n );\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'Identifier': {\n const nde = /** @type {import('estree').Identifier} */ (node);\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* istanbul ignore else */\n if (valueSymbol) {\n createBlockSymbol(block, nde.name, valueSymbol, globals, isGlobal);\n\n return block.props[nde.name];\n }\n\n /* istanbul ignore next */\n debug('Identifier: Missing value symbol for %s', nde.name);\n } else {\n createBlockSymbol(block, nde.name, createNode(), globals, isGlobal);\n\n return block.props[nde.name];\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'MemberExpression': {\n const nde = /** @type {import('estree').MemberExpression} */ (node);\n symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.object), globals, block,\n );\n\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.property),\n globals,\n block,\n {\n simpleIdentifier: !nde.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (value), globals, block,\n ), globals, isGlobal);\n return symbol.props[propertyValue];\n }\n\n debug(\n 'MemberExpression: Missing symbol: %s',\n /** @type {import('estree').Identifier} */ (\n nde.property\n ).name,\n );\n break;\n }\n }\n\n return null;\n};\n\n/**\n * Creates variables from variable definitions\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {void}\n */\nconst initVariables = function (node, globals, opts) {\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n null,\n globals,\n );\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[\n /** @type {import('estree').Identifier} */\n (declaration.id).name\n ] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n );\n }\n\n break;\n }\n }\n};\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * Populates variable maps using AST\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {true} [isExport]\n * @returns {boolean}\n */\nconst mapVariables = function (node, globals, opt, isExport) {\n /* eslint-enable complexity -- Temporary */\n /* istanbul ignore next */\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Program': {\n if (opts.ancestorsOnly) {\n return false;\n }\n\n for (const childNode of node.body) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = Boolean(opts.initWindow && node.kind === 'var' && globals.props.window);\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (declaration.init),\n globals,\n isGlobal,\n );\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'FunctionDeclaration': {\n /* istanbul ignore if */\n if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.id),\n globals,\n node,\n globals,\n true,\n );\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n if (symbol) {\n symbol.exported = true;\n } else {\n // if (!node.id) {\n globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ (\n node.declaration\n );\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n true,\n );\n } else {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n /* istanbul ignore if */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (specifier),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.local),\n globals,\n globals,\n );\n /* istanbul ignore if */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(\n /** @type {import('eslint').Rule.Node|null} */ (node.id),\n globals,\n /** @type {import('eslint').Rule.Node} */ (node.body),\n globals,\n );\n break;\n }\n\n default: {\n /* istanbul ignore next */\n return false;\n }\n }\n\n return true;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode|ValueObject|string|undefined|\n * import('eslint').Rule.Node} block\n * @param {(CreatedNode|ValueObject|string|\n * import('eslint').Rule.Node)[]} [cache]\n * @returns {boolean}\n */\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n typeof block === 'object' &&\n 'type' in block &&\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n if (typeof block !== 'object') {\n return false;\n }\n\n const props = ('props' in block && block.props) || ('body' in block && block.body);\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* istanbul ignore if */\n if (propval.some((val) => {\n return findNode(node, val, blockCache);\n })) {\n return true;\n }\n } else if (findNode(node, propval, blockCache)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst exportTypes = new Set([\n 'ExportNamedDeclaration', 'ExportDefaultDeclaration',\n]);\nconst ignorableNestedTypes = new Set([\n 'FunctionDeclaration', 'ArrowFunctionExpression', 'FunctionExpression',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {import('eslint').Rule.Node|false}\n */\nconst getExportAncestor = function (nde) {\n let node = nde;\n let idx = 0;\n const ignorableIfDeep = ignorableNestedTypes.has(nde?.type);\n while (node) {\n // Ignore functions nested more deeply than say `export default function () {}`\n if (idx >= 2 && ignorableIfDeep) {\n break;\n }\n\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n node = node.parent;\n idx++;\n }\n\n return false;\n};\n\nconst canBeExportedByAncestorType = new Set([\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'ClassProperty',\n 'PropertyDefinition',\n 'Method',\n]);\n\nconst canExportChildrenType = new Set([\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'TSTypeLiteral',\n 'TSTypeAliasDeclaration',\n 'ClassDeclaration',\n 'ClassBody',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {false|import('eslint').Rule.Node}\n */\nconst isExportByAncestor = function (nde) {\n if (!canBeExportedByAncestorType.has(nde.type)) {\n return false;\n }\n\n let node = nde.parent;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n if (!canExportChildrenType.has(node.type)) {\n return false;\n }\n\n node = node.parent;\n }\n\n return false;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode[]} [cache] Currently unused\n * @returns {boolean}\n */\nconst findExportedNode = function (block, node, cache) {\n /* istanbul ignore if */\n if (block === null) {\n return false;\n }\n\n const blockCache = cache || [];\n const {\n props,\n } = block;\n for (const propval of Object.values(props)) {\n const pval = /** @type {CreatedNode} */ (propval);\n blockCache.push(pval);\n if (pval.exported && (node === pval.value || findNode(node, pval.value))) {\n return true;\n }\n\n // No need to check `propval` for exported nodes as ESM\n // exports are only global\n }\n\n return false;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {boolean}\n */\nconst isNodeExported = function (node, globals, opt) {\n const moduleExports = globals.props.module?.props?.exports;\n if (\n opt.initModuleExports && moduleExports && findNode(node, moduleExports)\n ) {\n return true;\n }\n\n if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) {\n return true;\n }\n\n if (opt.esm && findExportedNode(globals, node)) {\n return true;\n }\n\n return false;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globalVars\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {boolean}\n */\nconst parseRecursive = function (node, globalVars, opts) {\n // Iterate from top using recursion - stop at first processed node from top\n if (node.parent && parseRecursive(node.parent, globalVars, opts)) {\n return true;\n }\n\n return mapVariables(node, globalVars, opts);\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} ast\n * @param {import('eslint').Rule.Node} node\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {CreatedNode}\n */\nconst parse = function (ast, node, opt) {\n /* istanbul ignore next */\n const opts = opt || {\n ancestorsOnly: false,\n esm: true,\n initModuleExports: true,\n initWindow: true,\n };\n\n const globalVars = createNode();\n if (opts.initModuleExports) {\n globalVars.props.module = createNode();\n globalVars.props.module.props.exports = createNode();\n globalVars.props.exports = globalVars.props.module.props.exports;\n }\n\n if (opts.initWindow) {\n globalVars.props.window = createNode();\n globalVars.props.window.special = true;\n }\n\n if (opts.ancestorsOnly) {\n parseRecursive(node, globalVars, opts);\n } else {\n initVariables(ast, globalVars, opts);\n mapVariables(ast, globalVars, opts);\n }\n\n return {\n globalVars,\n props: {},\n };\n};\n\nconst accessibilityNodes = new Set([\n 'PropertyDefinition',\n 'MethodDefinition',\n]);\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @returns {boolean}\n */\nconst hasAccessibility = (node) => {\n return accessibilityNodes.has(node.type) && 'accessibility' in node &&\n node.accessibility !== 'public' && node.accessibility !== undefined;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {import('./iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n if (hasAccessibility(node) ||\n node.parent && hasAccessibility(node.parent)) {\n return false;\n }\n\n const exportNode = getExportAncestor(node);\n\n // Is export node comment\n if (exportNode && !findJSDocComment(exportNode, sourceCode, settings)) {\n return true;\n }\n\n /**\n * Some typescript types are not in variable map, but inherit exported (interface property and method)\n */\n if (\n isExportByAncestor(node) &&\n !findJSDocComment(node, sourceCode, settings)\n ) {\n return true;\n }\n }\n\n const ast = /** @type {unknown} */ (sourceCode.ast);\n\n const parseResult = parse(\n /** @type {import('eslint').Rule.Node} */\n (ast),\n node,\n opt,\n );\n\n return isNodeExported(\n node, /** @type {CreatedNode} */ (parseResult.globalVars), opt,\n );\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAW,EAAC,oBAAoB,CAAC;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAA,EAAY;EAC7B,OAAO;IACLC,KAAK,EAAE,CAAC;EACV,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,SAAAA,CAAUC,MAAM,EAAE;EACvC;EACA,IAAI,CAACA,MAAM,EAAE;IACX,OAAO,IAAI;EACb;;EAEA;EACA,IAAIA,MAAM,CAACC,IAAI,KAAK,SAAS,EAAE;IAC7B,OAAO,2BAA4BD,MAAM,CAACE,KAAK,CAAEA;IAAK;EACxD;;EAEA;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,SAAAA,CAAUC,IAAI,EAAEC,OAAO,EAAEC,KAAK,EAAEC,IAAI,EAAE;EAC1D,IAAIA,IAAI,CAACC,gBAAgB,EAAE;IACzB;IACA,MAAMC,iBAAiB,GAAGZ,UAAU,CAAC,CAAC;IACtCY,iBAAiB,CAACR,IAAI,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xF,IAAI,CAACwF,aAAa,KAAKC,SAAS;AACvE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,SAAAA,CAAU1F,IAAI,EAAE2F,UAAU,EAAEjF,GAAG,EAAEkF,QAAQ,EAAE;EACrE;EACA;EACA,IAAIlF,GAAG,CAACuE,GAAG,EAAE;IACX,IAAIM,gBAAgB,CAACvF,IAAI,CAAC,IACxBA,IAAI,CAACuB,MAAM,IAAIgE,gBAAgB,CAACvF,IAAI,CAACuB,MAAM,CAAC,EAAE;MAC9C,OAAO,KAAK;IACd;IAEA,MAAMsE,UAAU,GAAG3B,iBAAiB,CAAClE,IAAI,CAAC;;IAE1C;IACA,IAAI6F,UAAU,IAAI,CAAC,IAAAC,8BAAgB,EAACD,UAAU,EAAEF,UAAU,EAAEC,QAAQ,CAAC,EAAE;MACrE,OAAO,IAAI;IACb;;IAEA;AACJ;AACA;IACI,IACEpB,kBAAkB,CAACxE,IAAI,CAAC,IACxB,CAAC,IAAA8F,8BAAgB,EAAC9F,IAAI,EAAE2F,UAAU,EAAEC,QAAQ,CAAC,EAC7C;MACA,OAAO,IAAI;IACb;EACF;EAEA,MAAMP,GAAG,GAAG,sBAAwBM,UAAU,CAACN,GAAI;EAEnD,MAAMU,WAAW,GAAGX,KAAK,EACvB;EACCC,GAAG,EACJrF,IAAI,EACJU,GACF,CAAC;EAED,OAAOiE,cAAc,CACnB3E,IAAI,EAAE,0BAA4B+F,WAAW,CAACZ,UAAU,EAAGzE,GAC7D,CAAC;AACH,CAAC;AAAC,IAAAsF,QAAA,GAEa;EACbN,mBAAmB;EACnBN;AACF,CAAC;AAAAL,OAAA,CAAAzF,OAAA,GAAA0G,QAAA;AAAAlB,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAAzF,OAAA"}
|
package/dist/generateRule.js
CHANGED
|
@@ -36,7 +36,7 @@ const recommended = options.includes('--recommended');
|
|
|
36
36
|
}
|
|
37
37
|
await _promises.default.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n');
|
|
38
38
|
console.log('ruleNames', ruleNames);
|
|
39
|
-
const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc';
|
|
39
|
+
const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc.js';
|
|
40
40
|
|
|
41
41
|
export default iterateJsdoc(({
|
|
42
42
|
context,
|
|
@@ -208,9 +208,9 @@ export default iterateJsdoc(({
|
|
|
208
208
|
|
|
209
209
|
await replaceInOrder({
|
|
210
210
|
checkName: 'index import',
|
|
211
|
-
newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`,
|
|
211
|
+
newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}.js';`,
|
|
212
212
|
oldIsCamel: true,
|
|
213
|
-
oldRegex: /\nimport (?<oldRule>[^ ]*) from '.\/rules\/\1';/gu,
|
|
213
|
+
oldRegex: /\nimport (?<oldRule>[^ ]*) from '.\/rules\/\1\.js';/gu,
|
|
214
214
|
path: './src/index.js'
|
|
215
215
|
});
|
|
216
216
|
await replaceInOrder({
|
package/dist/generateRule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRule.js","names":["_camelcase","_interopRequireDefault","require","_fs","_promises","_openEditor","_path","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ruleName","options","process","argv","recommended","includes","console","error","test","ruleNamesPath","ruleNames","JSON","parse","fs","readFile","push","sort","writeFile","stringify","log","ruleTemplate","camelCasedRuleName","camelCase","rulePath","existsSync","ruleTestTemplate","ruleTestPath","ruleReadmeTemplate","ruleReadmePath","replaceInOrder","path","oldRegex","checkName","newLine","oldIsCamel","offsets","readme","replace","matchedLine","n1","offset","str","oldRule","oldRuleB","alreadyIncluded","itemIndex","findIndex","item","undefined","pop","length","slice","repeat","Promise","resolve","then","chdir","__dirname","open"],"sources":["../src/bin/generateRule.js"],"sourcesContent":["/* eslint-disable no-console -- CLI */\n\n/**\n * @example\n *\n * ```shell\n * npm run create-rule my-new-rule -- --recommended\n * ```\n */\n\nimport camelCase from 'camelcase';\nimport {\n existsSync,\n} from 'fs';\nimport fs from 'fs/promises';\nimport open from 'open-editor';\nimport {\n resolve,\n} from 'path';\n\n// Todo: Would ideally have prompts, e.g., to ask for whether\n// type was problem/layout, etc.\n\nconst [\n , , ruleName,\n ...options\n] = process.argv;\n\nconst recommended = options.includes('--recommended');\n\n(async () => {\n if (!ruleName) {\n console.error('Please supply a rule name');\n\n return;\n }\n\n if ((/[A-Z]/u).test(ruleName)) {\n console.error('Please ensure the rule has no capital letters');\n\n return;\n }\n\n const ruleNamesPath = './test/rules/ruleNames.json';\n // @ts-expect-error Older types?\n const ruleNames = JSON.parse(await fs.readFile(\n ruleNamesPath,\n ));\n if (!ruleNames.includes(ruleName)) {\n ruleNames.push(ruleName);\n ruleNames.sort();\n }\n\n await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\\n');\n console.log('ruleNames', ruleNames);\n\n const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n // Rule here\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n // Option properties here (or remove the object)\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n`;\n\n const camelCasedRuleName = camelCase(ruleName);\n\n const rulePath = `./src/rules/${camelCasedRuleName}.js`;\n\n if (!existsSync(rulePath)) {\n await fs.writeFile(rulePath, ruleTemplate);\n }\n\n const ruleTestTemplate = `export default {\n invalid: [\n {\n code: \\`\n \\`,\n errors: [\n {\n line: 2,\n message: '',\n },\n ],\n },\n ],\n valid: [\n {\n code: \\`\n \\`,\n },\n ],\n};\n`;\n\n const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;\n if (!existsSync(ruleTestPath)) {\n await fs.writeFile(ruleTestPath, ruleTestTemplate);\n }\n\n const ruleReadmeTemplate = `### \\`${ruleName}\\`\n\n|||\n|---|---|\n|Context|everywhere|\n|Tags|\\`\\`|\n|Recommended|${recommended ? 'true' : 'false'}|\n|Settings||\n|Options||\n\n## Failing examples\n\n<!-- assertions-failing ${camelCasedRuleName} -->\n\n## Passing examples\n\n<!-- assertions-passing ${camelCasedRuleName} -->\n`;\n\n const ruleReadmePath = `./.README/rules/${ruleName}.md`;\n if (!existsSync(ruleReadmePath)) {\n await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);\n }\n\n /**\n * @param {object} cfg\n * @param {string} cfg.path\n * @param {RegExp} cfg.oldRegex\n * @param {string} cfg.checkName\n * @param {string} cfg.newLine\n * @param {boolean} [cfg.oldIsCamel]\n * @returns {Promise<void>}\n */\n const replaceInOrder = async ({\n path,\n oldRegex,\n checkName,\n newLine,\n oldIsCamel,\n }) => {\n /**\n * @typedef {number} Integer\n */\n /**\n * @typedef {{\n * matchedLine: string,\n * offset: Integer,\n * oldRule: string,\n * }} OffsetInfo\n */\n /**\n * @type {OffsetInfo[]}\n */\n const offsets = [];\n\n let readme = await fs.readFile(path, 'utf8');\n readme.replace(\n oldRegex,\n /**\n * @param {string} matchedLine\n * @param {string} n1\n * @param {Integer} offset\n * @param {string} str\n * @param {object} groups\n * @param {string} groups.oldRule\n * @returns {string}\n */\n (matchedLine, n1, offset, str, {\n oldRule,\n }) => {\n offsets.push({\n matchedLine,\n offset,\n oldRule,\n });\n\n return matchedLine;\n },\n );\n\n offsets.sort(({\n oldRule,\n }, {\n oldRule: oldRuleB,\n }) => {\n return oldRule < oldRuleB ? -1 : (oldRule > oldRuleB ? 1 : 0);\n });\n\n let alreadyIncluded = false;\n const itemIndex = offsets.findIndex(({\n oldRule,\n }) => {\n alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;\n\n return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;\n });\n let item = itemIndex !== undefined && offsets[itemIndex];\n if (item && itemIndex === 0 &&\n\n // This property would not always be sufficient but in this case it is.\n oldIsCamel\n ) {\n item.offset = 0;\n }\n\n if (!item) {\n item = /** @type {OffsetInfo} */ (offsets.pop());\n item.offset += item.matchedLine.length;\n }\n\n if (alreadyIncluded) {\n console.log(`Rule name is already present in ${checkName}.`);\n } else {\n readme = readme.slice(0, item.offset) +\n (item.offset ? '\\n' : '') +\n newLine +\n (item.offset ? '' : '\\n') +\n readme.slice(item.offset);\n\n await fs.writeFile(path, readme);\n }\n };\n\n // await replaceInOrder({\n // checkName: 'README',\n // newLine: `{\"gitdown\": \"include\", \"file\": \"./rules/${ruleName}.md\"}`,\n // oldRegex: /\\n\\{\"gitdown\": \"include\", \"file\": \".\\/rules\\/(?<oldRule>[^.]*).md\"\\}/gu,\n // path: './.README/README.md',\n // });\n\n await replaceInOrder({\n checkName: 'index import',\n newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`,\n oldIsCamel: true,\n oldRegex: /\\nimport (?<oldRule>[^ ]*) from '.\\/rules\\/\\1';/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index recommended',\n newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\\'off\\''},`,\n oldRegex: /\\n\\s{6}'jsdoc\\/(?<oldRule>[^']*)': .*?,/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index rules',\n newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`,\n oldRegex: /\\n\\s{4}'(?<oldRule>[^']*)': [^,]*,/gu,\n path: './src/index.js',\n });\n\n await import('./generateDocs.js');\n\n /*\n console.log('Paths to open for further editing\\n');\n console.log(`open ${ruleReadmePath}`);\n console.log(`open ${rulePath}`);\n console.log(`open ${ruleTestPath}\\n`);\n */\n\n // Set chdir as somehow still in operation from other test\n process.chdir(resolve(__dirname, '../../'));\n await open([\n // Could even add editor line column numbers like `${rulePath}:1:1`\n ruleReadmePath,\n ruleTestPath,\n rulePath,\n ]);\n})();\n"],"mappings":";;AAUA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEc,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAR,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAS,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAV,GAAA,YAAAS,KAAA,CAAAE,GAAA,CAAAX,GAAA,SAAAY,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAjB,GAAA,QAAAiB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAApB,GAAA,EAAAiB,G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C,CAAC,CAAE,IAAGpD,QAAS,MAAKqB,kBAAmB,GAAE;IAChEU,QAAQ,EAAE,sCAAsC;IAChDD,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAAuB,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAtE,uBAAA,CAAAb,OAAA,CAAa,mBAAmB,GAAC;;EAEjC;AACF;AACA;AACA;AACA;AACA;;EAEE;EACA8B,OAAO,CAACsD,KAAK,CAAC,IAAAF,aAAO,EAACG,SAAS,EAAE,QAAQ,CAAC,CAAC;EAC3C,MAAM,IAAAC,mBAAI,EAAC;EACT;EACA9B,cAAc,EACdF,YAAY,EACZH,QAAQ,CACT,CAAC;AACJ,CAAC,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"generateRule.js","names":["_camelcase","_interopRequireDefault","require","_fs","_promises","_openEditor","_path","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ruleName","options","process","argv","recommended","includes","console","error","test","ruleNamesPath","ruleNames","JSON","parse","fs","readFile","push","sort","writeFile","stringify","log","ruleTemplate","camelCasedRuleName","camelCase","rulePath","existsSync","ruleTestTemplate","ruleTestPath","ruleReadmeTemplate","ruleReadmePath","replaceInOrder","path","oldRegex","checkName","newLine","oldIsCamel","offsets","readme","replace","matchedLine","n1","offset","str","oldRule","oldRuleB","alreadyIncluded","itemIndex","findIndex","item","undefined","pop","length","slice","repeat","Promise","resolve","then","chdir","__dirname","open"],"sources":["../src/bin/generateRule.js"],"sourcesContent":["/* eslint-disable no-console -- CLI */\n\n/**\n * @example\n *\n * ```shell\n * npm run create-rule my-new-rule -- --recommended\n * ```\n */\n\nimport camelCase from 'camelcase';\nimport {\n existsSync,\n} from 'fs';\nimport fs from 'fs/promises';\nimport open from 'open-editor';\nimport {\n resolve,\n} from 'path';\n\n// Todo: Would ideally have prompts, e.g., to ask for whether\n// type was problem/layout, etc.\n\nconst [\n , , ruleName,\n ...options\n] = process.argv;\n\nconst recommended = options.includes('--recommended');\n\n(async () => {\n if (!ruleName) {\n console.error('Please supply a rule name');\n\n return;\n }\n\n if ((/[A-Z]/u).test(ruleName)) {\n console.error('Please ensure the rule has no capital letters');\n\n return;\n }\n\n const ruleNamesPath = './test/rules/ruleNames.json';\n // @ts-expect-error Older types?\n const ruleNames = JSON.parse(await fs.readFile(\n ruleNamesPath,\n ));\n if (!ruleNames.includes(ruleName)) {\n ruleNames.push(ruleName);\n ruleNames.sort();\n }\n\n await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\\n');\n console.log('ruleNames', ruleNames);\n\n const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n // Rule here\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n // Option properties here (or remove the object)\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n`;\n\n const camelCasedRuleName = camelCase(ruleName);\n\n const rulePath = `./src/rules/${camelCasedRuleName}.js`;\n\n if (!existsSync(rulePath)) {\n await fs.writeFile(rulePath, ruleTemplate);\n }\n\n const ruleTestTemplate = `export default {\n invalid: [\n {\n code: \\`\n \\`,\n errors: [\n {\n line: 2,\n message: '',\n },\n ],\n },\n ],\n valid: [\n {\n code: \\`\n \\`,\n },\n ],\n};\n`;\n\n const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;\n if (!existsSync(ruleTestPath)) {\n await fs.writeFile(ruleTestPath, ruleTestTemplate);\n }\n\n const ruleReadmeTemplate = `### \\`${ruleName}\\`\n\n|||\n|---|---|\n|Context|everywhere|\n|Tags|\\`\\`|\n|Recommended|${recommended ? 'true' : 'false'}|\n|Settings||\n|Options||\n\n## Failing examples\n\n<!-- assertions-failing ${camelCasedRuleName} -->\n\n## Passing examples\n\n<!-- assertions-passing ${camelCasedRuleName} -->\n`;\n\n const ruleReadmePath = `./.README/rules/${ruleName}.md`;\n if (!existsSync(ruleReadmePath)) {\n await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);\n }\n\n /**\n * @param {object} cfg\n * @param {string} cfg.path\n * @param {RegExp} cfg.oldRegex\n * @param {string} cfg.checkName\n * @param {string} cfg.newLine\n * @param {boolean} [cfg.oldIsCamel]\n * @returns {Promise<void>}\n */\n const replaceInOrder = async ({\n path,\n oldRegex,\n checkName,\n newLine,\n oldIsCamel,\n }) => {\n /**\n * @typedef {number} Integer\n */\n /**\n * @typedef {{\n * matchedLine: string,\n * offset: Integer,\n * oldRule: string,\n * }} OffsetInfo\n */\n /**\n * @type {OffsetInfo[]}\n */\n const offsets = [];\n\n let readme = await fs.readFile(path, 'utf8');\n readme.replace(\n oldRegex,\n /**\n * @param {string} matchedLine\n * @param {string} n1\n * @param {Integer} offset\n * @param {string} str\n * @param {object} groups\n * @param {string} groups.oldRule\n * @returns {string}\n */\n (matchedLine, n1, offset, str, {\n oldRule,\n }) => {\n offsets.push({\n matchedLine,\n offset,\n oldRule,\n });\n\n return matchedLine;\n },\n );\n\n offsets.sort(({\n oldRule,\n }, {\n oldRule: oldRuleB,\n }) => {\n return oldRule < oldRuleB ? -1 : (oldRule > oldRuleB ? 1 : 0);\n });\n\n let alreadyIncluded = false;\n const itemIndex = offsets.findIndex(({\n oldRule,\n }) => {\n alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;\n\n return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;\n });\n let item = itemIndex !== undefined && offsets[itemIndex];\n if (item && itemIndex === 0 &&\n\n // This property would not always be sufficient but in this case it is.\n oldIsCamel\n ) {\n item.offset = 0;\n }\n\n if (!item) {\n item = /** @type {OffsetInfo} */ (offsets.pop());\n item.offset += item.matchedLine.length;\n }\n\n if (alreadyIncluded) {\n console.log(`Rule name is already present in ${checkName}.`);\n } else {\n readme = readme.slice(0, item.offset) +\n (item.offset ? '\\n' : '') +\n newLine +\n (item.offset ? '' : '\\n') +\n readme.slice(item.offset);\n\n await fs.writeFile(path, readme);\n }\n };\n\n // await replaceInOrder({\n // checkName: 'README',\n // newLine: `{\"gitdown\": \"include\", \"file\": \"./rules/${ruleName}.md\"}`,\n // oldRegex: /\\n\\{\"gitdown\": \"include\", \"file\": \".\\/rules\\/(?<oldRule>[^.]*).md\"\\}/gu,\n // path: './.README/README.md',\n // });\n\n await replaceInOrder({\n checkName: 'index import',\n newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}.js';`,\n oldIsCamel: true,\n oldRegex: /\\nimport (?<oldRule>[^ ]*) from '.\\/rules\\/\\1\\.js';/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index recommended',\n newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\\'off\\''},`,\n oldRegex: /\\n\\s{6}'jsdoc\\/(?<oldRule>[^']*)': .*?,/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index rules',\n newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`,\n oldRegex: /\\n\\s{4}'(?<oldRule>[^']*)': [^,]*,/gu,\n path: './src/index.js',\n });\n\n await import('./generateDocs.js');\n\n /*\n console.log('Paths to open for further editing\\n');\n console.log(`open ${ruleReadmePath}`);\n console.log(`open ${rulePath}`);\n console.log(`open ${ruleTestPath}\\n`);\n */\n\n // Set chdir as somehow still in operation from other test\n process.chdir(resolve(__dirname, '../../'));\n await open([\n // Could even add editor line column numbers like `${rulePath}:1:1`\n ruleReadmePath,\n ruleTestPath,\n rulePath,\n ]);\n})();\n"],"mappings":";;AAUA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;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,KAAK,CAAC,IAAAF,aAAO,EAACG,SAAS,EAAE,QAAQ,CAAC,CAAC;EAC3C,MAAM,IAAAC,mBAAI,EAAC;EACT;EACA9B,cAAc,EACdF,YAAY,EACZH,QAAQ,CACT,CAAC;AACJ,CAAC,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,62 +4,64 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _checkAccess = _interopRequireDefault(require("./rules/checkAccess"));
|
|
8
|
-
var _checkAlignment = _interopRequireDefault(require("./rules/checkAlignment"));
|
|
9
|
-
var _checkExamples = _interopRequireDefault(require("./rules/checkExamples"));
|
|
10
|
-
var _checkIndentation = _interopRequireDefault(require("./rules/checkIndentation"));
|
|
11
|
-
var _checkLineAlignment = _interopRequireDefault(require("./rules/checkLineAlignment"));
|
|
12
|
-
var _checkParamNames = _interopRequireDefault(require("./rules/checkParamNames"));
|
|
13
|
-
var _checkPropertyNames = _interopRequireDefault(require("./rules/checkPropertyNames"));
|
|
14
|
-
var _checkSyntax = _interopRequireDefault(require("./rules/checkSyntax"));
|
|
15
|
-
var _checkTagNames = _interopRequireDefault(require("./rules/checkTagNames"));
|
|
16
|
-
var _checkTypes = _interopRequireDefault(require("./rules/checkTypes"));
|
|
17
|
-
var _checkValues = _interopRequireDefault(require("./rules/checkValues"));
|
|
18
|
-
var _emptyTags = _interopRequireDefault(require("./rules/emptyTags"));
|
|
19
|
-
var _implementsOnClasses = _interopRequireDefault(require("./rules/implementsOnClasses"));
|
|
20
|
-
var _importsAsDependencies = _interopRequireDefault(require("./rules/importsAsDependencies"));
|
|
21
|
-
var _informativeDocs = _interopRequireDefault(require("./rules/informativeDocs"));
|
|
22
|
-
var _matchDescription = _interopRequireDefault(require("./rules/matchDescription"));
|
|
23
|
-
var _matchName = _interopRequireDefault(require("./rules/matchName"));
|
|
24
|
-
var _multilineBlocks = _interopRequireDefault(require("./rules/multilineBlocks"));
|
|
25
|
-
var _noBadBlocks = _interopRequireDefault(require("./rules/noBadBlocks"));
|
|
26
|
-
var _noBlankBlockDescriptions = _interopRequireDefault(require("./rules/noBlankBlockDescriptions"));
|
|
27
|
-
var _noBlankBlocks = _interopRequireDefault(require("./rules/noBlankBlocks"));
|
|
28
|
-
var _noDefaults = _interopRequireDefault(require("./rules/noDefaults"));
|
|
29
|
-
var _noMissingSyntax = _interopRequireDefault(require("./rules/noMissingSyntax"));
|
|
30
|
-
var _noMultiAsterisks = _interopRequireDefault(require("./rules/noMultiAsterisks"));
|
|
31
|
-
var _noRestrictedSyntax = _interopRequireDefault(require("./rules/noRestrictedSyntax"));
|
|
32
|
-
var _noTypes = _interopRequireDefault(require("./rules/noTypes"));
|
|
33
|
-
var _noUndefinedTypes = _interopRequireDefault(require("./rules/noUndefinedTypes"));
|
|
34
|
-
var _requireAsteriskPrefix = _interopRequireDefault(require("./rules/requireAsteriskPrefix"));
|
|
35
|
-
var _requireDescription = _interopRequireDefault(require("./rules/requireDescription"));
|
|
36
|
-
var _requireDescriptionCompleteSentence = _interopRequireDefault(require("./rules/requireDescriptionCompleteSentence"));
|
|
37
|
-
var _requireExample = _interopRequireDefault(require("./rules/requireExample"));
|
|
38
|
-
var _requireFileOverview = _interopRequireDefault(require("./rules/requireFileOverview"));
|
|
39
|
-
var _requireHyphenBeforeParamDescription = _interopRequireDefault(require("./rules/requireHyphenBeforeParamDescription"));
|
|
40
|
-
var _requireJsdoc = _interopRequireDefault(require("./rules/requireJsdoc"));
|
|
41
|
-
var _requireParam = _interopRequireDefault(require("./rules/requireParam"));
|
|
42
|
-
var _requireParamDescription = _interopRequireDefault(require("./rules/requireParamDescription"));
|
|
43
|
-
var _requireParamName = _interopRequireDefault(require("./rules/requireParamName"));
|
|
44
|
-
var _requireParamType = _interopRequireDefault(require("./rules/requireParamType"));
|
|
45
|
-
var _requireProperty = _interopRequireDefault(require("./rules/requireProperty"));
|
|
46
|
-
var _requirePropertyDescription = _interopRequireDefault(require("./rules/requirePropertyDescription"));
|
|
47
|
-
var _requirePropertyName = _interopRequireDefault(require("./rules/requirePropertyName"));
|
|
48
|
-
var _requirePropertyType = _interopRequireDefault(require("./rules/requirePropertyType"));
|
|
49
|
-
var _requireReturns = _interopRequireDefault(require("./rules/requireReturns"));
|
|
50
|
-
var _requireReturnsCheck = _interopRequireDefault(require("./rules/requireReturnsCheck"));
|
|
51
|
-
var _requireReturnsDescription = _interopRequireDefault(require("./rules/requireReturnsDescription"));
|
|
52
|
-
var _requireReturnsType = _interopRequireDefault(require("./rules/requireReturnsType"));
|
|
53
|
-
var _requireThrows = _interopRequireDefault(require("./rules/requireThrows"));
|
|
54
|
-
var _requireYields = _interopRequireDefault(require("./rules/requireYields"));
|
|
55
|
-
var _requireYieldsCheck = _interopRequireDefault(require("./rules/requireYieldsCheck"));
|
|
56
|
-
var _sortTags = _interopRequireDefault(require("./rules/sortTags"));
|
|
57
|
-
var _tagLines = _interopRequireDefault(require("./rules/tagLines"));
|
|
58
|
-
var _textEscaping = _interopRequireDefault(require("./rules/textEscaping"));
|
|
59
|
-
var _validTypes = _interopRequireDefault(require("./rules/validTypes"));
|
|
7
|
+
var _checkAccess = _interopRequireDefault(require("./rules/checkAccess.js"));
|
|
8
|
+
var _checkAlignment = _interopRequireDefault(require("./rules/checkAlignment.js"));
|
|
9
|
+
var _checkExamples = _interopRequireDefault(require("./rules/checkExamples.js"));
|
|
10
|
+
var _checkIndentation = _interopRequireDefault(require("./rules/checkIndentation.js"));
|
|
11
|
+
var _checkLineAlignment = _interopRequireDefault(require("./rules/checkLineAlignment.js"));
|
|
12
|
+
var _checkParamNames = _interopRequireDefault(require("./rules/checkParamNames.js"));
|
|
13
|
+
var _checkPropertyNames = _interopRequireDefault(require("./rules/checkPropertyNames.js"));
|
|
14
|
+
var _checkSyntax = _interopRequireDefault(require("./rules/checkSyntax.js"));
|
|
15
|
+
var _checkTagNames = _interopRequireDefault(require("./rules/checkTagNames.js"));
|
|
16
|
+
var _checkTypes = _interopRequireDefault(require("./rules/checkTypes.js"));
|
|
17
|
+
var _checkValues = _interopRequireDefault(require("./rules/checkValues.js"));
|
|
18
|
+
var _emptyTags = _interopRequireDefault(require("./rules/emptyTags.js"));
|
|
19
|
+
var _implementsOnClasses = _interopRequireDefault(require("./rules/implementsOnClasses.js"));
|
|
20
|
+
var _importsAsDependencies = _interopRequireDefault(require("./rules/importsAsDependencies.js"));
|
|
21
|
+
var _informativeDocs = _interopRequireDefault(require("./rules/informativeDocs.js"));
|
|
22
|
+
var _matchDescription = _interopRequireDefault(require("./rules/matchDescription.js"));
|
|
23
|
+
var _matchName = _interopRequireDefault(require("./rules/matchName.js"));
|
|
24
|
+
var _multilineBlocks = _interopRequireDefault(require("./rules/multilineBlocks.js"));
|
|
25
|
+
var _noBadBlocks = _interopRequireDefault(require("./rules/noBadBlocks.js"));
|
|
26
|
+
var _noBlankBlockDescriptions = _interopRequireDefault(require("./rules/noBlankBlockDescriptions.js"));
|
|
27
|
+
var _noBlankBlocks = _interopRequireDefault(require("./rules/noBlankBlocks.js"));
|
|
28
|
+
var _noDefaults = _interopRequireDefault(require("./rules/noDefaults.js"));
|
|
29
|
+
var _noMissingSyntax = _interopRequireDefault(require("./rules/noMissingSyntax.js"));
|
|
30
|
+
var _noMultiAsterisks = _interopRequireDefault(require("./rules/noMultiAsterisks.js"));
|
|
31
|
+
var _noRestrictedSyntax = _interopRequireDefault(require("./rules/noRestrictedSyntax.js"));
|
|
32
|
+
var _noTypes = _interopRequireDefault(require("./rules/noTypes.js"));
|
|
33
|
+
var _noUndefinedTypes = _interopRequireDefault(require("./rules/noUndefinedTypes.js"));
|
|
34
|
+
var _requireAsteriskPrefix = _interopRequireDefault(require("./rules/requireAsteriskPrefix.js"));
|
|
35
|
+
var _requireDescription = _interopRequireDefault(require("./rules/requireDescription.js"));
|
|
36
|
+
var _requireDescriptionCompleteSentence = _interopRequireDefault(require("./rules/requireDescriptionCompleteSentence.js"));
|
|
37
|
+
var _requireExample = _interopRequireDefault(require("./rules/requireExample.js"));
|
|
38
|
+
var _requireFileOverview = _interopRequireDefault(require("./rules/requireFileOverview.js"));
|
|
39
|
+
var _requireHyphenBeforeParamDescription = _interopRequireDefault(require("./rules/requireHyphenBeforeParamDescription.js"));
|
|
40
|
+
var _requireJsdoc = _interopRequireDefault(require("./rules/requireJsdoc.js"));
|
|
41
|
+
var _requireParam = _interopRequireDefault(require("./rules/requireParam.js"));
|
|
42
|
+
var _requireParamDescription = _interopRequireDefault(require("./rules/requireParamDescription.js"));
|
|
43
|
+
var _requireParamName = _interopRequireDefault(require("./rules/requireParamName.js"));
|
|
44
|
+
var _requireParamType = _interopRequireDefault(require("./rules/requireParamType.js"));
|
|
45
|
+
var _requireProperty = _interopRequireDefault(require("./rules/requireProperty.js"));
|
|
46
|
+
var _requirePropertyDescription = _interopRequireDefault(require("./rules/requirePropertyDescription.js"));
|
|
47
|
+
var _requirePropertyName = _interopRequireDefault(require("./rules/requirePropertyName.js"));
|
|
48
|
+
var _requirePropertyType = _interopRequireDefault(require("./rules/requirePropertyType.js"));
|
|
49
|
+
var _requireReturns = _interopRequireDefault(require("./rules/requireReturns.js"));
|
|
50
|
+
var _requireReturnsCheck = _interopRequireDefault(require("./rules/requireReturnsCheck.js"));
|
|
51
|
+
var _requireReturnsDescription = _interopRequireDefault(require("./rules/requireReturnsDescription.js"));
|
|
52
|
+
var _requireReturnsType = _interopRequireDefault(require("./rules/requireReturnsType.js"));
|
|
53
|
+
var _requireThrows = _interopRequireDefault(require("./rules/requireThrows.js"));
|
|
54
|
+
var _requireYields = _interopRequireDefault(require("./rules/requireYields.js"));
|
|
55
|
+
var _requireYieldsCheck = _interopRequireDefault(require("./rules/requireYieldsCheck.js"));
|
|
56
|
+
var _sortTags = _interopRequireDefault(require("./rules/sortTags.js"));
|
|
57
|
+
var _tagLines = _interopRequireDefault(require("./rules/tagLines.js"));
|
|
58
|
+
var _textEscaping = _interopRequireDefault(require("./rules/textEscaping.js"));
|
|
59
|
+
var _validTypes = _interopRequireDefault(require("./rules/validTypes.js"));
|
|
60
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
61
|
/**
|
|
62
|
-
* @type {import('eslint').ESLint.Plugin
|
|
62
|
+
* @type {import('eslint').ESLint.Plugin & {
|
|
63
|
+
* configs: Record<string, import('eslint').ESLint.ConfigData>
|
|
64
|
+
* }}
|
|
63
65
|
*/
|
|
64
66
|
const index = {
|
|
65
67
|
configs: {},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTypes","_checkValues","_emptyTags","_implementsOnClasses","_importsAsDependencies","_informativeDocs","_matchDescription","_matchName","_multilineBlocks","_noBadBlocks","_noBlankBlockDescriptions","_noBlankBlocks","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","importsAsDependencies","informativeDocs","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","createRecommendedTypeScriptFlavorRuleset","Error","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess';\nimport checkAlignment from './rules/checkAlignment';\nimport checkExamples from './rules/checkExamples';\nimport checkIndentation from './rules/checkIndentation';\nimport checkLineAlignment from './rules/checkLineAlignment';\nimport checkParamNames from './rules/checkParamNames';\nimport checkPropertyNames from './rules/checkPropertyNames';\nimport checkSyntax from './rules/checkSyntax';\nimport checkTagNames from './rules/checkTagNames';\nimport checkTypes from './rules/checkTypes';\nimport checkValues from './rules/checkValues';\nimport emptyTags from './rules/emptyTags';\nimport implementsOnClasses from './rules/implementsOnClasses';\nimport importsAsDependencies from './rules/importsAsDependencies';\nimport informativeDocs from './rules/informativeDocs';\nimport matchDescription from './rules/matchDescription';\nimport matchName from './rules/matchName';\nimport multilineBlocks from './rules/multilineBlocks';\nimport noBadBlocks from './rules/noBadBlocks';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions';\nimport noBlankBlocks from './rules/noBlankBlocks';\nimport noDefaults from './rules/noDefaults';\nimport noMissingSyntax from './rules/noMissingSyntax';\nimport noMultiAsterisks from './rules/noMultiAsterisks';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax';\nimport noTypes from './rules/noTypes';\nimport noUndefinedTypes from './rules/noUndefinedTypes';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix';\nimport requireDescription from './rules/requireDescription';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence';\nimport requireExample from './rules/requireExample';\nimport requireFileOverview from './rules/requireFileOverview';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription';\nimport requireJsdoc from './rules/requireJsdoc';\nimport requireParam from './rules/requireParam';\nimport requireParamDescription from './rules/requireParamDescription';\nimport requireParamName from './rules/requireParamName';\nimport requireParamType from './rules/requireParamType';\nimport requireProperty from './rules/requireProperty';\nimport requirePropertyDescription from './rules/requirePropertyDescription';\nimport requirePropertyName from './rules/requirePropertyName';\nimport requirePropertyType from './rules/requirePropertyType';\nimport requireReturns from './rules/requireReturns';\nimport requireReturnsCheck from './rules/requireReturnsCheck';\nimport requireReturnsDescription from './rules/requireReturnsDescription';\nimport requireReturnsType from './rules/requireReturnsType';\nimport requireThrows from './rules/requireThrows';\nimport requireYields from './rules/requireYields';\nimport requireYieldsCheck from './rules/requireYieldsCheck';\nimport sortTags from './rules/sortTags';\nimport tagLines from './rules/tagLines';\nimport textEscaping from './rules/textEscaping';\nimport validTypes from './rules/validTypes';\n\n/**\n * @type {import('eslint').ESLint.Plugin}\n */\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-throws': requireThrows,\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'valid-types': validTypes,\n },\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-blank-blocks': 'off',\n 'jsdoc/no-defaults': warnOrError,\n 'jsdoc/no-missing-syntax': 'off',\n 'jsdoc/no-multi-asterisks': warnOrError,\n 'jsdoc/no-restricted-syntax': 'off',\n 'jsdoc/no-types': 'off',\n 'jsdoc/no-undefined-types': warnOrError,\n 'jsdoc/require-asterisk-prefix': 'off',\n 'jsdoc/require-description': 'off',\n 'jsdoc/require-description-complete-sentence': 'off',\n 'jsdoc/require-example': 'off',\n 'jsdoc/require-file-overview': 'off',\n 'jsdoc/require-hyphen-before-param-description': 'off',\n 'jsdoc/require-jsdoc': warnOrError,\n 'jsdoc/require-param': warnOrError,\n 'jsdoc/require-param-description': warnOrError,\n 'jsdoc/require-param-name': warnOrError,\n 'jsdoc/require-param-type': warnOrError,\n 'jsdoc/require-property': warnOrError,\n 'jsdoc/require-property-description': warnOrError,\n 'jsdoc/require-property-name': warnOrError,\n 'jsdoc/require-property-type': warnOrError,\n 'jsdoc/require-returns': warnOrError,\n 'jsdoc/require-returns-check': warnOrError,\n 'jsdoc/require-returns-description': warnOrError,\n 'jsdoc/require-returns-type': warnOrError,\n 'jsdoc/require-throws': 'off',\n 'jsdoc/require-yields': warnOrError,\n 'jsdoc/require-yields-check': warnOrError,\n 'jsdoc/sort-tags': 'off',\n 'jsdoc/tag-lines': warnOrError,\n 'jsdoc/text-escaping': 'off',\n 'jsdoc/valid-types': warnOrError,\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/no-undefined-types': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/* istanbul ignore if -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\nindex.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');\nindex.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error');\n\nexport default index;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAV,sBAAA,CAAAC,OAA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,CAACF,KAAK,CAACC,OAAO,EAAE;EAClB,MAAM,IAAI8D,KAAK,CAAC,kBAAkB,CAAC;AACrC;AAEA/D,KAAK,CAACC,OAAO,CAAC+D,WAAW,GAAGR,wBAAwB,CAAC,MAAM,CAAC;AAC5DxD,KAAK,CAACC,OAAO,CAAC,mBAAmB,CAAC,GAAGuD,wBAAwB,CAAC,OAAO,CAAC;AACtExD,KAAK,CAACC,OAAO,CAAC,wBAAwB,CAAC,GAAG0D,kCAAkC,CAAC,MAAM,CAAC;AACpF3D,KAAK,CAACC,OAAO,CAAC,8BAA8B,CAAC,GAAG0D,kCAAkC,CAAC,OAAO,CAAC;AAC3F3D,KAAK,CAACC,OAAO,CAAC,+BAA+B,CAAC,GAAG6D,wCAAwC,CAAC,MAAM,CAAC;AACjG9D,KAAK,CAACC,OAAO,CAAC,qCAAqC,CAAC,GAAG6D,wCAAwC,CAAC,OAAO,CAAC;AAAC,IAAAG,QAAA,GAE1FjE,KAAK;AAAAkE,OAAA,CAAAnE,OAAA,GAAAkE,QAAA;AAAAE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAnE,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTypes","_checkValues","_emptyTags","_implementsOnClasses","_importsAsDependencies","_informativeDocs","_matchDescription","_matchName","_multilineBlocks","_noBadBlocks","_noBlankBlockDescriptions","_noBlankBlocks","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","importsAsDependencies","informativeDocs","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","createRecommendedTypeScriptFlavorRuleset","Error","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess.js';\nimport checkAlignment from './rules/checkAlignment.js';\nimport checkExamples from './rules/checkExamples.js';\nimport checkIndentation from './rules/checkIndentation.js';\nimport checkLineAlignment from './rules/checkLineAlignment.js';\nimport checkParamNames from './rules/checkParamNames.js';\nimport checkPropertyNames from './rules/checkPropertyNames.js';\nimport checkSyntax from './rules/checkSyntax.js';\nimport checkTagNames from './rules/checkTagNames.js';\nimport checkTypes from './rules/checkTypes.js';\nimport checkValues from './rules/checkValues.js';\nimport emptyTags from './rules/emptyTags.js';\nimport implementsOnClasses from './rules/implementsOnClasses.js';\nimport importsAsDependencies from './rules/importsAsDependencies.js';\nimport informativeDocs from './rules/informativeDocs.js';\nimport matchDescription from './rules/matchDescription.js';\nimport matchName from './rules/matchName.js';\nimport multilineBlocks from './rules/multilineBlocks.js';\nimport noBadBlocks from './rules/noBadBlocks.js';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions.js';\nimport noBlankBlocks from './rules/noBlankBlocks.js';\nimport noDefaults from './rules/noDefaults.js';\nimport noMissingSyntax from './rules/noMissingSyntax.js';\nimport noMultiAsterisks from './rules/noMultiAsterisks.js';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax.js';\nimport noTypes from './rules/noTypes.js';\nimport noUndefinedTypes from './rules/noUndefinedTypes.js';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix.js';\nimport requireDescription from './rules/requireDescription.js';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence.js';\nimport requireExample from './rules/requireExample.js';\nimport requireFileOverview from './rules/requireFileOverview.js';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription.js';\nimport requireJsdoc from './rules/requireJsdoc.js';\nimport requireParam from './rules/requireParam.js';\nimport requireParamDescription from './rules/requireParamDescription.js';\nimport requireParamName from './rules/requireParamName.js';\nimport requireParamType from './rules/requireParamType.js';\nimport requireProperty from './rules/requireProperty.js';\nimport requirePropertyDescription from './rules/requirePropertyDescription.js';\nimport requirePropertyName from './rules/requirePropertyName.js';\nimport requirePropertyType from './rules/requirePropertyType.js';\nimport requireReturns from './rules/requireReturns.js';\nimport requireReturnsCheck from './rules/requireReturnsCheck.js';\nimport requireReturnsDescription from './rules/requireReturnsDescription.js';\nimport requireReturnsType from './rules/requireReturnsType.js';\nimport requireThrows from './rules/requireThrows.js';\nimport requireYields from './rules/requireYields.js';\nimport requireYieldsCheck from './rules/requireYieldsCheck.js';\nimport sortTags from './rules/sortTags.js';\nimport tagLines from './rules/tagLines.js';\nimport textEscaping from './rules/textEscaping.js';\nimport validTypes from './rules/validTypes.js';\n\n/**\n * @type {import('eslint').ESLint.Plugin & {\n * configs: Record<string, import('eslint').ESLint.ConfigData>\n * }}\n */\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-throws': requireThrows,\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'valid-types': validTypes,\n },\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-blank-blocks': 'off',\n 'jsdoc/no-defaults': warnOrError,\n 'jsdoc/no-missing-syntax': 'off',\n 'jsdoc/no-multi-asterisks': warnOrError,\n 'jsdoc/no-restricted-syntax': 'off',\n 'jsdoc/no-types': 'off',\n 'jsdoc/no-undefined-types': warnOrError,\n 'jsdoc/require-asterisk-prefix': 'off',\n 'jsdoc/require-description': 'off',\n 'jsdoc/require-description-complete-sentence': 'off',\n 'jsdoc/require-example': 'off',\n 'jsdoc/require-file-overview': 'off',\n 'jsdoc/require-hyphen-before-param-description': 'off',\n 'jsdoc/require-jsdoc': warnOrError,\n 'jsdoc/require-param': warnOrError,\n 'jsdoc/require-param-description': warnOrError,\n 'jsdoc/require-param-name': warnOrError,\n 'jsdoc/require-param-type': warnOrError,\n 'jsdoc/require-property': warnOrError,\n 'jsdoc/require-property-description': warnOrError,\n 'jsdoc/require-property-name': warnOrError,\n 'jsdoc/require-property-type': warnOrError,\n 'jsdoc/require-returns': warnOrError,\n 'jsdoc/require-returns-check': warnOrError,\n 'jsdoc/require-returns-description': warnOrError,\n 'jsdoc/require-returns-type': warnOrError,\n 'jsdoc/require-throws': 'off',\n 'jsdoc/require-yields': warnOrError,\n 'jsdoc/require-yields-check': warnOrError,\n 'jsdoc/sort-tags': 'off',\n 'jsdoc/tag-lines': warnOrError,\n 'jsdoc/text-escaping': 'off',\n 'jsdoc/valid-types': warnOrError,\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/no-undefined-types': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/* istanbul ignore if -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\nindex.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');\nindex.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlav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c.js
CHANGED
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "parseComment", {
|
|
|
11
11
|
return _jsdoccomment.parseComment;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
var _jsdocUtils = _interopRequireDefault(require("./jsdocUtils"));
|
|
14
|
+
var _jsdocUtils = _interopRequireDefault(require("./jsdocUtils.js"));
|
|
15
15
|
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
16
16
|
var _commentParser = require("comment-parser");
|
|
17
17
|
var _esquery = _interopRequireDefault(require("esquery"));
|
|
@@ -1011,10 +1011,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1011
1011
|
};
|
|
1012
1012
|
|
|
1013
1013
|
/** @type {AddTag} */
|
|
1014
|
-
utils.addTag = (targetTagName, number = ((()
|
|
1015
|
-
var _jsdoc$tags, _jsdoc$tags$source$;
|
|
1016
|
-
return (_jsdoc$tags = jsdoc.tags[jsdoc.tags.length - 1]) === null || _jsdoc$tags === void 0 ? void 0 : (_jsdoc$tags$source$ = _jsdoc$tags.source[0]) === null || _jsdoc$tags$source$ === void 0 ? void 0 : _jsdoc$tags$source$.number;
|
|
1017
|
-
})() ?? jsdoc.source.findIndex(({
|
|
1014
|
+
utils.addTag = (targetTagName, number = ((_jsdoc$tags => (_jsdoc$tags = jsdoc.tags[jsdoc.tags.length - 1]) === null || _jsdoc$tags === void 0 || (_jsdoc$tags = _jsdoc$tags.source[0]) === null || _jsdoc$tags === void 0 ? void 0 : _jsdoc$tags.number)() ?? jsdoc.source.findIndex(({
|
|
1018
1015
|
tokens: {
|
|
1019
1016
|
tag
|
|
1020
1017
|
}
|
|
@@ -2000,7 +1997,7 @@ const checkFile = (iterator, ruleConfig) => {
|
|
|
2000
1997
|
*/
|
|
2001
1998
|
function iterateJsdoc(iterator, ruleConfig) {
|
|
2002
1999
|
var _ruleConfig$meta;
|
|
2003
|
-
const metaType = ruleConfig === null || ruleConfig === void 0
|
|
2000
|
+
const metaType = ruleConfig === null || ruleConfig === void 0 || (_ruleConfig$meta = ruleConfig.meta) === null || _ruleConfig$meta === void 0 ? void 0 : _ruleConfig$meta.type;
|
|
2004
2001
|
if (!metaType || !['problem', 'suggestion', 'layout'].includes(metaType)) {
|
|
2005
2002
|
throw new TypeError('Rule must include `meta.type` option (with value "problem", "suggestion", or "layout")');
|
|
2006
2003
|
}
|