eslint-plugin-jsdoc 50.6.6 → 50.6.8
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +18 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/rules/noUndefinedTypes.js +16 -0
package/dist/index.cjs
CHANGED
|
@@ -64,7 +64,7 @@ var _validTypes = _interopRequireDefault(require("./rules/validTypes.cjs"));
|
|
|
64
64
|
var _getJsdocProcessorPlugin = require("./getJsdocProcessorPlugin.cjs");
|
|
65
65
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
66
66
|
/**
|
|
67
|
-
* @typedef {"recommended" | "stylistic" | "contents" | "logical"} ConfigGroups
|
|
67
|
+
* @typedef {"recommended" | "stylistic" | "contents" | "logical" | "requirements"} ConfigGroups
|
|
68
68
|
* @typedef {"" | "-typescript" | "-typescript-flavor"} ConfigVariants
|
|
69
69
|
* @typedef {"" | "-error"} ErrorLevelVariants
|
|
70
70
|
* @type {import('eslint').ESLint.Plugin & {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTemplateNames","_checkTypes","_checkValues","_convertToJsdocComments","_emptyTags","_implementsOnClasses","_importsAsDependencies","_informativeDocs","_linesBeforeBlock","_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","_requireTemplate","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","_getJsdocProcessorPlugin","e","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTemplateNames","checkTypes","checkValues","convertToJsdocComments","emptyTags","implementsOnClasses","importsAsDependencies","informativeDocs","linesBeforeBlock","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","requireTemplate","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","flatName","name","plugins","jsdoc","createRecommendedTypeScriptRuleset","ruleset","typed","createRecommendedTypeScriptFlavorRuleset","createStandaloneRulesetFactory","ruleNames","Object","fromEntries","map","ruleName","slice","contentsRules","escapeHTML","createContentsTypescriptRuleset","createContentsTypescriptFlavorRuleset","logicalRules","createLogicalTypescriptRuleset","createLogicalTypescriptFlavorRuleset","requirementsRules","createRequirementsTypeScriptRuleset","createRequirementsTypeScriptFlavorRuleset","stylisticRules","createStylisticTypeScriptRuleset","createStylisticTypeScriptFlavorRuleset","Error","recommended","examples","files","getJsdocProcessorPlugin","processor","checkDefaults","checkParams","checkProperties","quotes","semi","strict","config","_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 checkTemplateNames from './rules/checkTemplateNames.js';\nimport checkTypes from './rules/checkTypes.js';\nimport checkValues from './rules/checkValues.js';\nimport convertToJsdocComments from './rules/convertToJsdocComments.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 linesBeforeBlock from './rules/linesBeforeBlock.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 requireTemplate from './rules/requireTemplate.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\nimport { getJsdocProcessorPlugin } from './getJsdocProcessorPlugin.js';\n\n/**\n * @typedef {\"recommended\" | \"stylistic\" | \"contents\" | \"logical\"} ConfigGroups\n * @typedef {\"\" | \"-typescript\" | \"-typescript-flavor\"} ConfigVariants\n * @typedef {\"\" | \"-error\"} ErrorLevelVariants\n * @type {import('eslint').ESLint.Plugin & {\n* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`, import('eslint').Linter.Config>\n* }}\n*/\nconst index = {\n // @ts-expect-error Ok\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-template-names': checkTemplateNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'convert-to-jsdoc-comments': convertToJsdocComments,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'lines-before-block': linesBeforeBlock,\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-template': requireTemplate,\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedRuleset = (warnOrError, flatName) => {\n return {\n ...(flatName ? {name: 'jsdoc/' + flatName} : {}),\n // @ts-expect-error Ok\n plugins:\n flatName ? {\n jsdoc: index,\n } : [\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-template-names': 'off',\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/convert-to-jsdoc-comments': 'off',\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/lines-before-block': '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-template': 'off',\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\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/**\n * @param {(string | unknown[])[]} ruleNames\n */\nconst createStandaloneRulesetFactory = (ruleNames) => {\n /**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\n return (warnOrError, flatName) => {\n return {\n name: 'jsdoc/' + flatName,\n plugins: { jsdoc: index },\n rules: Object.fromEntries(\n ruleNames.map(\n ruleName =>\n typeof ruleName === \"string\"\n ? [ruleName, warnOrError]\n : [ruleName[0], [warnOrError, ...ruleName.slice(1)]]\n )\n ),\n };\n };\n}\n\nconst contentsRules = [\n 'jsdoc/informative-docs',\n 'jsdoc/match-description',\n 'jsdoc/no-blank-block-descriptions',\n 'jsdoc/no-blank-blocks',\n ['jsdoc/text-escaping', { escapeHTML: true }]\n]\n\nconst createContentsTypescriptRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst createContentsTypescriptFlavorRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst logicalRules = [\n 'jsdoc/check-access',\n 'jsdoc/check-param-names',\n 'jsdoc/check-property-names',\n 'jsdoc/check-syntax',\n 'jsdoc/check-tag-names',\n 'jsdoc/check-template-names',\n 'jsdoc/check-types',\n 'jsdoc/check-values',\n 'jsdoc/empty-tags',\n 'jsdoc/implements-on-classes',\n 'jsdoc/require-returns-check',\n 'jsdoc/require-yields-check',\n 'jsdoc/no-bad-blocks',\n 'jsdoc/no-defaults',\n 'jsdoc/no-types',\n 'jsdoc/no-undefined-types',\n 'jsdoc/valid-types',\n];\n\nconst createLogicalTypescriptRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst createLogicalTypescriptFlavorRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst requirementsRules = [\n 'jsdoc/require-example',\n 'jsdoc/require-jsdoc',\n 'jsdoc/require-param',\n 'jsdoc/require-param-description',\n 'jsdoc/require-param-name',\n 'jsdoc/require-property',\n 'jsdoc/require-property-description',\n 'jsdoc/require-property-name',\n 'jsdoc/require-returns',\n 'jsdoc/require-returns-description',\n 'jsdoc/require-yields',\n];\n\nconst createRequirementsTypeScriptRuleset = createStandaloneRulesetFactory(requirementsRules);\n\nconst createRequirementsTypeScriptFlavorRuleset = createStandaloneRulesetFactory([\n ...requirementsRules,\n 'jsdoc/require-param-type',\n 'jsdoc/require-property-type',\n 'jsdoc/require-returns-type',\n 'jsdoc/require-template',\n]);\n\nconst stylisticRules = [\n 'jsdoc/check-alignment',\n 'jsdoc/check-line-alignment',\n 'jsdoc/lines-before-block',\n 'jsdoc/multiline-blocks',\n 'jsdoc/no-multi-asterisks',\n 'jsdoc/require-asterisk-prefix',\n ['jsdoc/require-hyphen-before-param-description', 'never'],\n 'jsdoc/tag-lines',\n];\n\nconst createStylisticTypeScriptRuleset = createStandaloneRulesetFactory(stylisticRules);\n\nconst createStylisticTypeScriptFlavorRuleset = createStandaloneRulesetFactory(stylisticRules);\n\n/* c8 ignore next 3 -- 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\nindex.configs['flat/recommended'] = createRecommendedRuleset('warn', 'flat/recommended');\nindex.configs['flat/recommended-error'] = createRecommendedRuleset('error', 'flat/recommended-error');\nindex.configs['flat/recommended-typescript'] = createRecommendedTypeScriptRuleset('warn', 'flat/recommended-typescript');\nindex.configs['flat/recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error', 'flat/recommended-typescript-error');\nindex.configs['flat/recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn', 'flat/recommended-typescript-flavor');\nindex.configs['flat/recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error', 'flat/recommended-typescript-flavor-error');\n\nindex.configs['flat/contents-typescript'] = createContentsTypescriptRuleset('warn', 'flat/contents-typescript');\nindex.configs['flat/contents-typescript-error'] = createContentsTypescriptRuleset('error', 'flat/contents-typescript-error');\nindex.configs['flat/contents-typescript-flavor'] = createContentsTypescriptFlavorRuleset('warn', 'flat/contents-typescript-flavor');\nindex.configs['flat/contents-typescript-flavor-error'] = createContentsTypescriptFlavorRuleset('error', 'flat/contents-typescript-error-flavor');\nindex.configs['flat/logical-typescript'] = createLogicalTypescriptRuleset('warn', 'flat/logical-typescript');\nindex.configs['flat/logical-typescript-error'] = createLogicalTypescriptRuleset('error', 'flat/logical-typescript-error');\nindex.configs['flat/logical-typescript-flavor'] = createLogicalTypescriptFlavorRuleset('warn', 'flat/logical-typescript-flavor');\nindex.configs['flat/logical-typescript-flavor-error'] = createLogicalTypescriptFlavorRuleset('error', 'flat/logical-typescript-error-flavor');\nindex.configs['flat/requirements-typescript'] = createRequirementsTypeScriptRuleset('warn', 'flat/requirements-typescript');\nindex.configs['flat/requirements-typescript-error'] = createRequirementsTypeScriptRuleset('error', 'flat/requirements-typescript-error');\nindex.configs['flat/requirements-typescript-flavor'] = createRequirementsTypeScriptFlavorRuleset('warn', 'flat/requirements-typescript-flavor');\nindex.configs['flat/requirements-typescript-flavor-error'] = createRequirementsTypeScriptFlavorRuleset('error', 'flat/requirements-typescript-error-flavor');\nindex.configs['flat/stylistic-typescript'] = createStylisticTypeScriptRuleset('warn', 'flat/stylistic-typescript');\nindex.configs['flat/stylistic-typescript-error'] = createStylisticTypeScriptRuleset('error', 'flat/stylistic-typescript-error');\nindex.configs['flat/stylistic-typescript-flavor'] = createStylisticTypeScriptFlavorRuleset('warn', 'flat/stylistic-typescript-flavor');\nindex.configs['flat/stylistic-typescript-flavor-error'] = createStylisticTypeScriptFlavorRuleset('error', 'flat/stylistic-typescript-error-flavor');\n\nindex.configs.examples = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n name: 'jsdoc/examples/processor',\n files: ['**/*.js'],\n plugins: {\n examples: getJsdocProcessorPlugin()\n },\n processor: 'examples/examples',\n },\n {\n name: 'jsdoc/examples/rules',\n files: ['**/*.md/*.js'],\n rules: {\n // \"always\" newline rule at end unlikely in sample code\n 'eol-last': 0,\n\n // Wouldn't generally expect example paths to resolve relative to JS file\n 'import/no-unresolved': 0,\n\n // Snippets likely too short to always include import/export info\n 'import/unambiguous': 0,\n\n 'jsdoc/require-file-overview': 0,\n\n // The end of a multiline comment would end the comment the example is in.\n 'jsdoc/require-jsdoc': 0,\n\n // Unlikely to have inadvertent debugging within examples\n 'no-console': 0,\n\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n 'no-multiple-empty-lines': 0,\n\n // Many variables in examples will be `undefined`\n 'no-undef': 0,\n\n // Common to define variables for clarity without always using them\n 'no-unused-vars': 0,\n\n // See import/no-unresolved\n 'node/no-missing-import': 0,\n 'node/no-missing-require': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n 'padded-blocks': 0,\n }\n }\n]);\n\nindex.configs['default-expressions'] = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n files: ['**/*.js'],\n name: 'jsdoc/default-expressions/processor',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true\n })\n },\n processor: 'examples/examples'\n },\n {\n name: 'jsdoc/default-expressions/rules',\n files: ['**/*.jsdoc-defaults', '**/*.jsdoc-params', '**/*.jsdoc-properties'],\n rules: {\n ...index.configs.examples[1].rules,\n 'chai-friendly/no-unused-expressions': 0,\n 'no-empty-function': 0,\n 'no-new': 0,\n 'no-unused-expressions': 0,\n quotes: [\n 'error', 'double',\n ],\n semi: [\n 'error', 'never',\n ],\n strict: 0\n },\n }\n]);\n\nindex.configs['examples-and-default-expressions'] = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n name: 'jsdoc/examples-and-default-expressions',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true\n })\n },\n },\n ...index.configs.examples.map((config) => {\n return {\n ...config,\n plugins: {}\n };\n }),\n ...index.configs['default-expressions'].map((config) => {\n return {\n ...config,\n plugins: {}\n };\n })\n]);\n\nexport default index;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,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MAChCE,aAAa,EAAE,IAAI;MACnBC,WAAW,EAAE,IAAI;MACjBC,eAAe,EAAE;IACnB,CAAC;EACH;AACF,CAAC,EACD,GAAGlG,KAAK,CAACC,OAAO,CAAC2F,QAAQ,CAAClB,GAAG,CAAE4B,MAAM,IAAK;EACxC,OAAO;IACL,GAAGA,MAAM;IACTtC,OAAO,EAAE,CAAC;EACZ,CAAC;AACH,CAAC,CAAC,EACF,GAAGhE,KAAK,CAACC,OAAO,CAAC,qBAAqB,CAAC,CAACyE,GAAG,CAAE4B,MAAM,IAAK;EACtD,OAAO;IACL,GAAGA,MAAM;IACTtC,OAAO,EAAE,CAAC;EACZ,CAAC;AACH,CAAC,CAAC,CACF;AAAC,IAAAuC,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAEYC,KAAK;AAAAyG,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAzG,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTemplateNames","_checkTypes","_checkValues","_convertToJsdocComments","_emptyTags","_implementsOnClasses","_importsAsDependencies","_informativeDocs","_linesBeforeBlock","_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","_requireTemplate","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","_getJsdocProcessorPlugin","e","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTemplateNames","checkTypes","checkValues","convertToJsdocComments","emptyTags","implementsOnClasses","importsAsDependencies","informativeDocs","linesBeforeBlock","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","requireTemplate","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","flatName","name","plugins","jsdoc","createRecommendedTypeScriptRuleset","ruleset","typed","createRecommendedTypeScriptFlavorRuleset","createStandaloneRulesetFactory","ruleNames","Object","fromEntries","map","ruleName","slice","contentsRules","escapeHTML","createContentsTypescriptRuleset","createContentsTypescriptFlavorRuleset","logicalRules","createLogicalTypescriptRuleset","createLogicalTypescriptFlavorRuleset","requirementsRules","createRequirementsTypeScriptRuleset","createRequirementsTypeScriptFlavorRuleset","stylisticRules","createStylisticTypeScriptRuleset","createStylisticTypeScriptFlavorRuleset","Error","recommended","examples","files","getJsdocProcessorPlugin","processor","checkDefaults","checkParams","checkProperties","quotes","semi","strict","config","_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 checkTemplateNames from './rules/checkTemplateNames.js';\nimport checkTypes from './rules/checkTypes.js';\nimport checkValues from './rules/checkValues.js';\nimport convertToJsdocComments from './rules/convertToJsdocComments.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 linesBeforeBlock from './rules/linesBeforeBlock.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 requireTemplate from './rules/requireTemplate.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\nimport { getJsdocProcessorPlugin } from './getJsdocProcessorPlugin.js';\n\n/**\n * @typedef {\"recommended\" | \"stylistic\" | \"contents\" | \"logical\" | \"requirements\"} ConfigGroups\n * @typedef {\"\" | \"-typescript\" | \"-typescript-flavor\"} ConfigVariants\n * @typedef {\"\" | \"-error\"} ErrorLevelVariants\n * @type {import('eslint').ESLint.Plugin & {\n* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`, import('eslint').Linter.Config>\n* }}\n*/\nconst index = {\n // @ts-expect-error Ok\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-template-names': checkTemplateNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'convert-to-jsdoc-comments': convertToJsdocComments,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'lines-before-block': linesBeforeBlock,\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-template': requireTemplate,\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedRuleset = (warnOrError, flatName) => {\n return {\n ...(flatName ? {name: 'jsdoc/' + flatName} : {}),\n // @ts-expect-error Ok\n plugins:\n flatName ? {\n jsdoc: index,\n } : [\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-template-names': 'off',\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/convert-to-jsdoc-comments': 'off',\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/lines-before-block': '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-template': 'off',\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\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 * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\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/**\n * @param {(string | unknown[])[]} ruleNames\n */\nconst createStandaloneRulesetFactory = (ruleNames) => {\n /**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.FlatConfig}\n */\n return (warnOrError, flatName) => {\n return {\n name: 'jsdoc/' + flatName,\n plugins: { jsdoc: index },\n rules: Object.fromEntries(\n ruleNames.map(\n ruleName =>\n typeof ruleName === \"string\"\n ? [ruleName, warnOrError]\n : [ruleName[0], [warnOrError, ...ruleName.slice(1)]]\n )\n ),\n };\n };\n}\n\nconst contentsRules = [\n 'jsdoc/informative-docs',\n 'jsdoc/match-description',\n 'jsdoc/no-blank-block-descriptions',\n 'jsdoc/no-blank-blocks',\n ['jsdoc/text-escaping', { escapeHTML: true }]\n]\n\nconst createContentsTypescriptRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst createContentsTypescriptFlavorRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst logicalRules = [\n 'jsdoc/check-access',\n 'jsdoc/check-param-names',\n 'jsdoc/check-property-names',\n 'jsdoc/check-syntax',\n 'jsdoc/check-tag-names',\n 'jsdoc/check-template-names',\n 'jsdoc/check-types',\n 'jsdoc/check-values',\n 'jsdoc/empty-tags',\n 'jsdoc/implements-on-classes',\n 'jsdoc/require-returns-check',\n 'jsdoc/require-yields-check',\n 'jsdoc/no-bad-blocks',\n 'jsdoc/no-defaults',\n 'jsdoc/no-types',\n 'jsdoc/no-undefined-types',\n 'jsdoc/valid-types',\n];\n\nconst createLogicalTypescriptRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst createLogicalTypescriptFlavorRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst requirementsRules = [\n 'jsdoc/require-example',\n 'jsdoc/require-jsdoc',\n 'jsdoc/require-param',\n 'jsdoc/require-param-description',\n 'jsdoc/require-param-name',\n 'jsdoc/require-property',\n 'jsdoc/require-property-description',\n 'jsdoc/require-property-name',\n 'jsdoc/require-returns',\n 'jsdoc/require-returns-description',\n 'jsdoc/require-yields',\n];\n\nconst createRequirementsTypeScriptRuleset = createStandaloneRulesetFactory(requirementsRules);\n\nconst createRequirementsTypeScriptFlavorRuleset = createStandaloneRulesetFactory([\n ...requirementsRules,\n 'jsdoc/require-param-type',\n 'jsdoc/require-property-type',\n 'jsdoc/require-returns-type',\n 'jsdoc/require-template',\n]);\n\nconst stylisticRules = [\n 'jsdoc/check-alignment',\n 'jsdoc/check-line-alignment',\n 'jsdoc/lines-before-block',\n 'jsdoc/multiline-blocks',\n 'jsdoc/no-multi-asterisks',\n 'jsdoc/require-asterisk-prefix',\n ['jsdoc/require-hyphen-before-param-description', 'never'],\n 'jsdoc/tag-lines',\n];\n\nconst createStylisticTypeScriptRuleset = createStandaloneRulesetFactory(stylisticRules);\n\nconst createStylisticTypeScriptFlavorRuleset = createStandaloneRulesetFactory(stylisticRules);\n\n/* c8 ignore next 3 -- 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\nindex.configs['flat/recommended'] = createRecommendedRuleset('warn', 'flat/recommended');\nindex.configs['flat/recommended-error'] = createRecommendedRuleset('error', 'flat/recommended-error');\nindex.configs['flat/recommended-typescript'] = createRecommendedTypeScriptRuleset('warn', 'flat/recommended-typescript');\nindex.configs['flat/recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error', 'flat/recommended-typescript-error');\nindex.configs['flat/recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn', 'flat/recommended-typescript-flavor');\nindex.configs['flat/recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error', 'flat/recommended-typescript-flavor-error');\n\nindex.configs['flat/contents-typescript'] = createContentsTypescriptRuleset('warn', 'flat/contents-typescript');\nindex.configs['flat/contents-typescript-error'] = createContentsTypescriptRuleset('error', 'flat/contents-typescript-error');\nindex.configs['flat/contents-typescript-flavor'] = createContentsTypescriptFlavorRuleset('warn', 'flat/contents-typescript-flavor');\nindex.configs['flat/contents-typescript-flavor-error'] = createContentsTypescriptFlavorRuleset('error', 'flat/contents-typescript-error-flavor');\nindex.configs['flat/logical-typescript'] = createLogicalTypescriptRuleset('warn', 'flat/logical-typescript');\nindex.configs['flat/logical-typescript-error'] = createLogicalTypescriptRuleset('error', 'flat/logical-typescript-error');\nindex.configs['flat/logical-typescript-flavor'] = createLogicalTypescriptFlavorRuleset('warn', 'flat/logical-typescript-flavor');\nindex.configs['flat/logical-typescript-flavor-error'] = createLogicalTypescriptFlavorRuleset('error', 'flat/logical-typescript-error-flavor');\nindex.configs['flat/requirements-typescript'] = createRequirementsTypeScriptRuleset('warn', 'flat/requirements-typescript');\nindex.configs['flat/requirements-typescript-error'] = createRequirementsTypeScriptRuleset('error', 'flat/requirements-typescript-error');\nindex.configs['flat/requirements-typescript-flavor'] = createRequirementsTypeScriptFlavorRuleset('warn', 'flat/requirements-typescript-flavor');\nindex.configs['flat/requirements-typescript-flavor-error'] = createRequirementsTypeScriptFlavorRuleset('error', 'flat/requirements-typescript-error-flavor');\nindex.configs['flat/stylistic-typescript'] = createStylisticTypeScriptRuleset('warn', 'flat/stylistic-typescript');\nindex.configs['flat/stylistic-typescript-error'] = createStylisticTypeScriptRuleset('error', 'flat/stylistic-typescript-error');\nindex.configs['flat/stylistic-typescript-flavor'] = createStylisticTypeScriptFlavorRuleset('warn', 'flat/stylistic-typescript-flavor');\nindex.configs['flat/stylistic-typescript-flavor-error'] = createStylisticTypeScriptFlavorRuleset('error', 'flat/stylistic-typescript-error-flavor');\n\nindex.configs.examples = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n name: 'jsdoc/examples/processor',\n files: ['**/*.js'],\n plugins: {\n examples: getJsdocProcessorPlugin()\n },\n processor: 'examples/examples',\n },\n {\n name: 'jsdoc/examples/rules',\n files: ['**/*.md/*.js'],\n rules: {\n // \"always\" newline rule at end unlikely in sample code\n 'eol-last': 0,\n\n // Wouldn't generally expect example paths to resolve relative to JS file\n 'import/no-unresolved': 0,\n\n // Snippets likely too short to always include import/export info\n 'import/unambiguous': 0,\n\n 'jsdoc/require-file-overview': 0,\n\n // The end of a multiline comment would end the comment the example is in.\n 'jsdoc/require-jsdoc': 0,\n\n // Unlikely to have inadvertent debugging within examples\n 'no-console': 0,\n\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n 'no-multiple-empty-lines': 0,\n\n // Many variables in examples will be `undefined`\n 'no-undef': 0,\n\n // Common to define variables for clarity without always using them\n 'no-unused-vars': 0,\n\n // See import/no-unresolved\n 'node/no-missing-import': 0,\n 'node/no-missing-require': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n 'padded-blocks': 0,\n }\n }\n]);\n\nindex.configs['default-expressions'] = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n files: ['**/*.js'],\n name: 'jsdoc/default-expressions/processor',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true\n })\n },\n processor: 'examples/examples'\n },\n {\n name: 'jsdoc/default-expressions/rules',\n files: ['**/*.jsdoc-defaults', '**/*.jsdoc-params', '**/*.jsdoc-properties'],\n rules: {\n ...index.configs.examples[1].rules,\n 'chai-friendly/no-unused-expressions': 0,\n 'no-empty-function': 0,\n 'no-new': 0,\n 'no-unused-expressions': 0,\n quotes: [\n 'error', 'double',\n ],\n semi: [\n 'error', 'never',\n ],\n strict: 0\n },\n }\n]);\n\nindex.configs['examples-and-default-expressions'] = /** @type {import('eslint').Linter.FlatConfig[]} */ ([\n {\n name: 'jsdoc/examples-and-default-expressions',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true\n })\n },\n },\n ...index.configs.examples.map((config) => {\n return {\n ...config,\n plugins: {}\n };\n }),\n ...index.configs['default-expressions'].map((config) => {\n return {\n ...config,\n plugins: {}\n };\n })\n]);\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,G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,KAAK,CAACC,OAAO,CAAC,qBAAqB,CAAC,CAACyE,GAAG,CAAE4B,MAAM,IAAK;EACtD,OAAO;IACL,GAAGA,MAAM;IACTtC,OAAO,EAAE,CAAC;EACZ,CAAC;AACH,CAAC,CAAC,CACF;AAAC,IAAAuC,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAEYC,KAAK;AAAAyG,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAzG,OAAA","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default index;
|
|
2
|
-
export type ConfigGroups = "recommended" | "stylistic" | "contents" | "logical";
|
|
2
|
+
export type ConfigGroups = "recommended" | "stylistic" | "contents" | "logical" | "requirements";
|
|
3
3
|
export type ConfigVariants = "" | "-typescript" | "-typescript-flavor";
|
|
4
4
|
export type ErrorLevelVariants = "" | "-error";
|
|
5
5
|
/**
|
|
6
|
-
* @typedef {"recommended" | "stylistic" | "contents" | "logical"} ConfigGroups
|
|
6
|
+
* @typedef {"recommended" | "stylistic" | "contents" | "logical" | "requirements"} ConfigGroups
|
|
7
7
|
* @typedef {"" | "-typescript" | "-typescript-flavor"} ConfigVariants
|
|
8
8
|
* @typedef {"" | "-error"} ErrorLevelVariants
|
|
9
9
|
* @type {import('eslint').ESLint.Plugin & {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";2BA6Da,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";2BA6Da,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc;6BACrE,EAAE,GAAG,aAAa,GAAG,oBAAoB;iCACzC,EAAE,GAAG,QAAQ;AAH1B;;;;;;;EAOE;AACF,qBAJU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG;IAC3C,OAAW,EAAE,MAAM,CAAC,QAAQ,YAAY,GAAG,cAAc,GAAG,kBAAkB,EAAE,EAAE,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;CAC9G,CAgED"}
|
|
@@ -172,6 +172,23 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
172
172
|
// In modules, including Node, there is a global scope at top with the
|
|
173
173
|
// Program scope inside
|
|
174
174
|
const cjsOrESMScope = ((_globalScope$childSco = globalScope.childScopes[0]) === null || _globalScope$childSco === void 0 || (_globalScope$childSco = _globalScope$childSco.block) === null || _globalScope$childSco === void 0 ? void 0 : _globalScope$childSco.type) === 'Program';
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @param {import("eslint").Scope.Scope | null} scope
|
|
178
|
+
* @returns {Set<string>}
|
|
179
|
+
*/
|
|
180
|
+
const getValidRuntimeIdentifiers = scope => {
|
|
181
|
+
const result = new Set();
|
|
182
|
+
while (scope) {
|
|
183
|
+
for (const {
|
|
184
|
+
name
|
|
185
|
+
} of scope.variables) {
|
|
186
|
+
result.add(name);
|
|
187
|
+
}
|
|
188
|
+
scope = scope.upper;
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
};
|
|
175
192
|
const allDefinedTypes = new Set(globalScope.variables.map(({
|
|
176
193
|
name
|
|
177
194
|
}) => {
|
|
@@ -188,7 +205,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
188
205
|
}) => {
|
|
189
206
|
return name;
|
|
190
207
|
/* c8 ignore next */
|
|
191
|
-
}) : []).concat(extraTypes).concat(typedefDeclarations).concat(importTags).concat(definedTypes).concat( /** @type {string[]} */definedPreferredTypes).concat(settings.mode === 'jsdoc' ? [] : [...(settings.mode === 'typescript' ? typescriptGlobals : []), ...closureGenericTypes]));
|
|
208
|
+
}) : []).concat(extraTypes).concat(typedefDeclarations).concat(importTags).concat(definedTypes).concat( /** @type {string[]} */definedPreferredTypes).concat(...getValidRuntimeIdentifiers(node && sourceCode.getScope(node))).concat(settings.mode === 'jsdoc' ? [] : [...(settings.mode === 'typescript' ? typescriptGlobals : []), ...closureGenericTypes]));
|
|
192
209
|
|
|
193
210
|
/**
|
|
194
211
|
* @typedef {{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndefinedTypes.cjs","names":["_path","require","_url","_synckit","_jsdoccomment","_iterateJsdoc","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","__dirname","dirname","fileURLToPath","pathToFileURL","__filename","toString","pathName","join","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","comments","getAllComments","comment","test","value","commentNode","parseComment","typedefDeclarations","flatMap","doc","tags","tag","isNamepathDefiningTag","name","importTags","type","description","typePart","imprt","getImports","createSyncFn","imports","importClause","dflt","named","namespace","types","push","binding","ancestorNodes","currentNode","_currentNode","parent","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","allDefinedTypes","Set","variables","concat","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","url","schema","additionalProperties","properties","items","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { createSyncFn } from 'synckit';\nimport {\n getJSDocComment,\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pathName = join(__dirname, '../import-worker.mjs');\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Awaited',\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\n/**\n * @param {string|false|undefined} [str]\n * @returns {undefined|string|false}\n */\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n\n // When is this ever `null`?\n const globalScope = /** @type {import('eslint').Scope.Scope} */ (\n scopeManager.globalScope\n );\n\n const\n /**\n * @type {{\n * definedTypes: string[],\n * disableReporting: boolean,\n * markVariablesAsUsed: boolean\n * }}\n */ {\n definedTypes = [],\n disableReporting = false,\n markVariablesAsUsed = true,\n } = context.options[0] || {};\n\n /** @type {(string|undefined)[]} */\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = /** @type {string[]} */ (Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter(Boolean));\n }\n\n const comments = sourceCode.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n });\n\n const typedefDeclarations = comments\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n\n const importTags = settings.mode === 'typescript' ? /** @type {string[]} */ (comments.flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return tag === 'import';\n });\n }).flatMap((tag) => {\n const {\n type, name, description\n } = tag;\n const typePart = type ? `{${type}} `: '';\n const imprt = 'import ' + (description\n ? `${typePart}${name} ${description}`\n : `${typePart}${name}`);\n\n const getImports = createSyncFn(pathName);\n const imports = /** @type {import('parse-imports').Import[]} */ (getImports(imprt));\n if (!imports) {\n return null;\n }\n\n return imports.flatMap(({importClause}) => {\n /* c8 ignore next */\n const {default: dflt, named, namespace} = importClause || {};\n const types = [];\n if (dflt) {\n types.push(dflt);\n }\n if (namespace) {\n types.push(namespace);\n }\n if (named) {\n for (const {binding} of named) {\n types.push(binding);\n }\n }\n\n return types;\n });\n }).filter(Boolean)) : [];\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n /**\n * @param {import('eslint').Rule.Node} ancestorNode\n * @returns {import('comment-parser').Spec[]}\n */\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdoc.tags.filter((tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags([\n 'template',\n ]);\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n /* c8 ignore next */\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(importTags)\n .concat(definedTypes)\n .concat(/** @type {string[]} */ (definedPreferredTypes))\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n /**\n * @typedef {{\n * parsedType: import('jsdoc-type-pratt-parser').RootResult;\n * tag: import('comment-parser').Spec|import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * line?: import('../iterateJsdoc.js').Integer\n * }\n * }} TypeAndTagInfo\n */\n\n /**\n * @param {string} propertyName\n * @returns {(tag: (import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * name?: string,\n * type?: string,\n * line?: import('../iterateJsdoc.js').Integer\n * })|import('comment-parser').Spec & {\n * namepathOrURL?: string\n * }\n * ) => undefined|TypeAndTagInfo}\n */\n const tagToParsedType = (propertyName) => {\n return (tag) => {\n try {\n const potentialType = tag[\n /** @type {\"type\"|\"name\"|\"namepathOrURL\"} */ (propertyName)\n ];\n return {\n parsedType: mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode),\n tag,\n };\n } catch {\n return undefined;\n }\n };\n };\n\n const typeTags = utils.filterTags(({\n tag,\n }) => {\n return tag !== 'import' && utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n }).map(tagToParsedType('type'));\n\n const namepathReferencingTags = utils.filterTags(({\n tag,\n }) => {\n return utils.isNamepathReferencingTag(tag);\n }).map(tagToParsedType('name'));\n\n const namepathOrUrlReferencingTags = utils.filterAllTags(({\n tag,\n }) => {\n return utils.isNamepathOrUrlReferencingTag(tag);\n }).map(tagToParsedType('namepathOrURL'));\n\n const tagsWithTypes = /** @type {TypeAndTagInfo[]} */ ([\n ...typeTags,\n ...namepathReferencingTags,\n ...namepathOrUrlReferencingTags,\n // Remove types which failed to parse\n ].filter(Boolean));\n\n for (const {\n tag,\n parsedType,\n } of tagsWithTypes) {\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n if (!disableReporting) {\n report(`The type '${value}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(value)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(value);\n /* c8 ignore next 3 */\n } else {\n context.markVariableAsUsed(value);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n type: 'boolean',\n },\n markVariablesAsUsed: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAMA,IAAAI,aAAA,GAAAC,uBAAA,CAAAL,OAAA;AAE4B,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CA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CAAC;EACJ;AACF,CAAC,EAAE;EACDmE,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJzD,WAAW,EAAE,kDAAkD;MAC/D0D,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV/F,YAAY,EAAE;UACZgG,KAAK,EAAE;YACL/D,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDhC,gBAAgB,EAAE;UAChBgC,IAAI,EAAE;QACR,CAAC;QACD/B,mBAAmB,EAAE;UACnB+B,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAgE,MAAA,CAAA5G,OAAA,GAAAA,OAAA,CAAA5B,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"noUndefinedTypes.cjs","names":["_path","require","_url","_synckit","_jsdoccomment","_iterateJsdoc","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","__dirname","dirname","fileURLToPath","pathToFileURL","__filename","toString","pathName","join","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","exports","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","scopeManager","globalScope","definedTypes","disableReporting","markVariablesAsUsed","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","Boolean","comments","getAllComments","comment","test","value","commentNode","parseComment","typedefDeclarations","flatMap","doc","tags","tag","isNamepathDefiningTag","name","importTags","type","description","typePart","imprt","getImports","createSyncFn","imports","importClause","dflt","named","namespace","types","push","binding","ancestorNodes","currentNode","_currentNode","parent","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","getValidRuntimeIdentifiers","scope","result","Set","variables","add","upper","allDefinedTypes","concat","getScope","tagToParsedType","propertyName","potentialType","parsedType","tryParseType","parseType","typeTags","filterTags","tagMightHaveTypePosition","namepathReferencingTags","isNamepathReferencingTag","namepathOrUrlReferencingTags","filterAllTags","isNamepathOrUrlReferencingTag","tagsWithTypes","traverse","nde","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","url","schema","additionalProperties","properties","items","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { createSyncFn } from 'synckit';\nimport {\n getJSDocComment,\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pathName = join(__dirname, '../import-worker.mjs');\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Awaited',\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\n/**\n * @param {string|false|undefined} [str]\n * @returns {undefined|string|false}\n */\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n\n // When is this ever `null`?\n const globalScope = /** @type {import('eslint').Scope.Scope} */ (\n scopeManager.globalScope\n );\n\n const\n /**\n * @type {{\n * definedTypes: string[],\n * disableReporting: boolean,\n * markVariablesAsUsed: boolean\n * }}\n */ {\n definedTypes = [],\n disableReporting = false,\n markVariablesAsUsed = true,\n } = context.options[0] || {};\n\n /** @type {(string|undefined)[]} */\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = /** @type {string[]} */ (Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter(Boolean));\n }\n\n const comments = sourceCode.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n });\n\n const typedefDeclarations = comments\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n\n const importTags = settings.mode === 'typescript' ? /** @type {string[]} */ (comments.flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return tag === 'import';\n });\n }).flatMap((tag) => {\n const {\n type, name, description\n } = tag;\n const typePart = type ? `{${type}} `: '';\n const imprt = 'import ' + (description\n ? `${typePart}${name} ${description}`\n : `${typePart}${name}`);\n\n const getImports = createSyncFn(pathName);\n const imports = /** @type {import('parse-imports').Import[]} */ (getImports(imprt));\n if (!imports) {\n return null;\n }\n\n return imports.flatMap(({importClause}) => {\n /* c8 ignore next */\n const {default: dflt, named, namespace} = importClause || {};\n const types = [];\n if (dflt) {\n types.push(dflt);\n }\n if (namespace) {\n types.push(namespace);\n }\n if (named) {\n for (const {binding} of named) {\n types.push(binding);\n }\n }\n\n return types;\n });\n }).filter(Boolean)) : [];\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n /**\n * @param {import('eslint').Rule.Node} ancestorNode\n * @returns {import('comment-parser').Spec[]}\n */\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdoc.tags.filter((tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags([\n 'template',\n ]);\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n /**\n * @param {import(\"eslint\").Scope.Scope | null} scope\n * @returns {Set<string>}\n */\n const getValidRuntimeIdentifiers = (scope) => {\n const result = new Set()\n while (scope) {\n for (const {name} of scope.variables) {\n result.add(name)\n }\n scope = scope.upper\n }\n return result\n };\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n /* c8 ignore next */\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(importTags)\n .concat(definedTypes)\n .concat(/** @type {string[]} */ (definedPreferredTypes))\n .concat(...getValidRuntimeIdentifiers(node && sourceCode.getScope(node)))\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n /**\n * @typedef {{\n * parsedType: import('jsdoc-type-pratt-parser').RootResult;\n * tag: import('comment-parser').Spec|import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * line?: import('../iterateJsdoc.js').Integer\n * }\n * }} TypeAndTagInfo\n */\n\n /**\n * @param {string} propertyName\n * @returns {(tag: (import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {\n * name?: string,\n * type?: string,\n * line?: import('../iterateJsdoc.js').Integer\n * })|import('comment-parser').Spec & {\n * namepathOrURL?: string\n * }\n * ) => undefined|TypeAndTagInfo}\n */\n const tagToParsedType = (propertyName) => {\n return (tag) => {\n try {\n const potentialType = tag[\n /** @type {\"type\"|\"name\"|\"namepathOrURL\"} */ (propertyName)\n ];\n return {\n parsedType: mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode),\n tag,\n };\n } catch {\n return undefined;\n }\n };\n };\n\n const typeTags = utils.filterTags(({\n tag,\n }) => {\n return tag !== 'import' && utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n }).map(tagToParsedType('type'));\n\n const namepathReferencingTags = utils.filterTags(({\n tag,\n }) => {\n return utils.isNamepathReferencingTag(tag);\n }).map(tagToParsedType('name'));\n\n const namepathOrUrlReferencingTags = utils.filterAllTags(({\n tag,\n }) => {\n return utils.isNamepathOrUrlReferencingTag(tag);\n }).map(tagToParsedType('namepathOrURL'));\n\n const tagsWithTypes = /** @type {TypeAndTagInfo[]} */ ([\n ...typeTags,\n ...namepathReferencingTags,\n ...namepathOrUrlReferencingTags,\n // Remove types which failed to parse\n ].filter(Boolean));\n\n for (const {\n tag,\n parsedType,\n } of tagsWithTypes) {\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n if (!disableReporting) {\n report(`The type '${value}' is undefined.`, null, tag);\n }\n } else if (markVariablesAsUsed && !extraTypes.includes(value)) {\n if (sourceCode.markVariableAsUsed) {\n sourceCode.markVariableAsUsed(value);\n /* c8 ignore next 3 */\n } else {\n context.markVariableAsUsed(value);\n }\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n disableReporting: {\n type: 'boolean',\n },\n markVariablesAsUsed: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAMA,IAAAI,aAAA,GAAAC,uBAAA,CAAAL,OAAA;AAE4B,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,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B,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVrG,YAAY,EAAE;UACZsG,KAAK,EAAE;YACLrE,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDhC,gBAAgB,EAAE;UAChBgC,IAAI,EAAE;QACR,CAAC;QACD/B,mBAAmB,EAAE;UACnB+B,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAsE,MAAA,CAAAlH,OAAA,GAAAA,OAAA,CAAA5B,OAAA","ignoreList":[]}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -59,7 +59,7 @@ import validTypes from './rules/validTypes.js';
|
|
|
59
59
|
import { getJsdocProcessorPlugin } from './getJsdocProcessorPlugin.js';
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* @typedef {"recommended" | "stylistic" | "contents" | "logical"} ConfigGroups
|
|
62
|
+
* @typedef {"recommended" | "stylistic" | "contents" | "logical" | "requirements"} ConfigGroups
|
|
63
63
|
* @typedef {"" | "-typescript" | "-typescript-flavor"} ConfigVariants
|
|
64
64
|
* @typedef {"" | "-error"} ErrorLevelVariants
|
|
65
65
|
* @type {import('eslint').ESLint.Plugin & {
|
|
@@ -222,6 +222,21 @@ export default iterateJsdoc(({
|
|
|
222
222
|
// Program scope inside
|
|
223
223
|
const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* @param {import("eslint").Scope.Scope | null} scope
|
|
227
|
+
* @returns {Set<string>}
|
|
228
|
+
*/
|
|
229
|
+
const getValidRuntimeIdentifiers = (scope) => {
|
|
230
|
+
const result = new Set()
|
|
231
|
+
while (scope) {
|
|
232
|
+
for (const {name} of scope.variables) {
|
|
233
|
+
result.add(name)
|
|
234
|
+
}
|
|
235
|
+
scope = scope.upper
|
|
236
|
+
}
|
|
237
|
+
return result
|
|
238
|
+
};
|
|
239
|
+
|
|
225
240
|
const allDefinedTypes = new Set(globalScope.variables.map(({
|
|
226
241
|
name,
|
|
227
242
|
}) => {
|
|
@@ -247,6 +262,7 @@ export default iterateJsdoc(({
|
|
|
247
262
|
.concat(importTags)
|
|
248
263
|
.concat(definedTypes)
|
|
249
264
|
.concat(/** @type {string[]} */ (definedPreferredTypes))
|
|
265
|
+
.concat(...getValidRuntimeIdentifiers(node && sourceCode.getScope(node)))
|
|
250
266
|
.concat(
|
|
251
267
|
settings.mode === 'jsdoc' ?
|
|
252
268
|
[] :
|