eslint-plugin-jsdoc 48.6.0 → 48.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/rules/checkTemplateNames.cjs +108 -0
- package/dist/rules/checkTemplateNames.cjs.map +1 -0
- package/dist/rules/requireTemplate.cjs +124 -0
- package/dist/rules/requireTemplate.cjs.map +1 -0
- package/package.json +19 -19
- package/src/index.js +6 -0
- package/src/rules/checkTemplateNames.js +101 -0
- package/src/rules/requireTemplate.js +119 -0
package/README.md
CHANGED
|
@@ -263,6 +263,7 @@ non-default-recommended fixer).
|
|
|
263
263
|
|:heavy_check_mark:|:wrench:|[check-tag-names](./docs/rules/check-tag-names.md#readme)|Reports invalid jsdoc (block) tag names|
|
|
264
264
|
|:heavy_check_mark:|:wrench:|[check-types](./docs/rules/check-types.md#readme)|Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements)|
|
|
265
265
|
|:heavy_check_mark:||[check-values](./docs/rules/check-values.md#readme)|Checks for expected content within some miscellaneous tags (`@version`, `@since`, `@license`, `@author`)|
|
|
266
|
+
| || [convert-to-jsdoc-comments](./docs/rules/convert-to-jsdoc-comments.md#readme) | Converts line and block comments preceding or following specified nodes into JSDoc comments|
|
|
266
267
|
|:heavy_check_mark:|:wrench:|[empty-tags](./docs/rules/empty-tags.md#readme)|Checks tags that are expected to be empty (e.g., `@abstract` or `@async`), reporting if they have content|
|
|
267
268
|
|:heavy_check_mark:||[implements-on-classes](./docs/rules/implements-on-classes.md#readme)|Prohibits use of `@implements` on non-constructor functions (to enforce the tag only being used on classes/constructors)|
|
|
268
269
|
|||[informative-docs](./docs/rules/informative-docs.md#readme)|Reports on JSDoc texts that serve only to restate their attached name.|
|
|
@@ -297,6 +298,7 @@ non-default-recommended fixer).
|
|
|
297
298
|
|:heavy_check_mark:||[require-returns-check](./docs/rules/require-returns-check.md#readme)|Requires a return statement be present in a function body if a `@returns` tag is specified in the jsdoc comment block (and reports if multiple `@returns` tags are present).|
|
|
298
299
|
|:heavy_check_mark:||[require-returns-description](./docs/rules/require-returns-description.md#readme)|Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).|
|
|
299
300
|
|:heavy_check_mark: (off in TS)||[require-returns-type](./docs/rules/require-returns-type.md#readme)|Requires that `@returns` tag has a type value (in curly brackets).|
|
|
301
|
+
| || [require-template](./docs/rules/require-template.md#readme) | Requires `@template` tags be present when type parameters are used.|
|
|
300
302
|
|||[require-throws](./docs/rules/require-throws.md#readme)|Requires that throw statements are documented|
|
|
301
303
|
|:heavy_check_mark:||[require-yields](./docs/rules/require-yields.md#readme)|Requires that yields are documented|
|
|
302
304
|
|:heavy_check_mark:||[require-yields-check](./docs/rules/require-yields-check.md#readme)|Ensures that if a `@yields` is present that a `yield` (or `yield` with a value) is present in the function body (or that if a `@next` is present that there is a `yield` with a return value present)|
|
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var _checkParamNames = _interopRequireDefault(require("./rules/checkParamNames.c
|
|
|
13
13
|
var _checkPropertyNames = _interopRequireDefault(require("./rules/checkPropertyNames.cjs"));
|
|
14
14
|
var _checkSyntax = _interopRequireDefault(require("./rules/checkSyntax.cjs"));
|
|
15
15
|
var _checkTagNames = _interopRequireDefault(require("./rules/checkTagNames.cjs"));
|
|
16
|
+
var _checkTemplateNames = _interopRequireDefault(require("./rules/checkTemplateNames.cjs"));
|
|
16
17
|
var _checkTypes = _interopRequireDefault(require("./rules/checkTypes.cjs"));
|
|
17
18
|
var _checkValues = _interopRequireDefault(require("./rules/checkValues.cjs"));
|
|
18
19
|
var _convertToJsdocComments = _interopRequireDefault(require("./rules/convertToJsdocComments.cjs"));
|
|
@@ -51,6 +52,7 @@ var _requireReturns = _interopRequireDefault(require("./rules/requireReturns.cjs
|
|
|
51
52
|
var _requireReturnsCheck = _interopRequireDefault(require("./rules/requireReturnsCheck.cjs"));
|
|
52
53
|
var _requireReturnsDescription = _interopRequireDefault(require("./rules/requireReturnsDescription.cjs"));
|
|
53
54
|
var _requireReturnsType = _interopRequireDefault(require("./rules/requireReturnsType.cjs"));
|
|
55
|
+
var _requireTemplate = _interopRequireDefault(require("./rules/requireTemplate.cjs"));
|
|
54
56
|
var _requireThrows = _interopRequireDefault(require("./rules/requireThrows.cjs"));
|
|
55
57
|
var _requireYields = _interopRequireDefault(require("./rules/requireYields.cjs"));
|
|
56
58
|
var _requireYieldsCheck = _interopRequireDefault(require("./rules/requireYieldsCheck.cjs"));
|
|
@@ -86,6 +88,7 @@ const index = {
|
|
|
86
88
|
'check-property-names': _checkPropertyNames.default,
|
|
87
89
|
'check-syntax': _checkSyntax.default,
|
|
88
90
|
'check-tag-names': _checkTagNames.default,
|
|
91
|
+
'check-template-names': _checkTemplateNames.default,
|
|
89
92
|
'check-types': _checkTypes.default,
|
|
90
93
|
'check-values': _checkValues.default,
|
|
91
94
|
'convert-to-jsdoc-comments': _convertToJsdocComments.default,
|
|
@@ -124,6 +127,7 @@ const index = {
|
|
|
124
127
|
'require-returns-check': _requireReturnsCheck.default,
|
|
125
128
|
'require-returns-description': _requireReturnsDescription.default,
|
|
126
129
|
'require-returns-type': _requireReturnsType.default,
|
|
130
|
+
'require-template': _requireTemplate.default,
|
|
127
131
|
'require-throws': _requireThrows.default,
|
|
128
132
|
'require-yields': _requireYields.default,
|
|
129
133
|
'require-yields-check': _requireYieldsCheck.default,
|
|
@@ -158,6 +162,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
158
162
|
'jsdoc/check-property-names': warnOrError,
|
|
159
163
|
'jsdoc/check-syntax': 'off',
|
|
160
164
|
'jsdoc/check-tag-names': warnOrError,
|
|
165
|
+
'jsdoc/check-template-names': 'off',
|
|
161
166
|
'jsdoc/check-types': warnOrError,
|
|
162
167
|
'jsdoc/check-values': warnOrError,
|
|
163
168
|
'jsdoc/convert-to-jsdoc-comments': 'off',
|
|
@@ -196,6 +201,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
196
201
|
'jsdoc/require-returns-check': warnOrError,
|
|
197
202
|
'jsdoc/require-returns-description': warnOrError,
|
|
198
203
|
'jsdoc/require-returns-type': warnOrError,
|
|
204
|
+
'jsdoc/require-template': 'off',
|
|
199
205
|
'jsdoc/require-throws': 'off',
|
|
200
206
|
'jsdoc/require-yields': warnOrError,
|
|
201
207
|
'jsdoc/require-yields-check': warnOrError,
|
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","_checkTypes","_checkValues","_convertToJsdocComments","_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","e","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","convertToJsdocComments","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","flatName","name","plugins","jsdoc","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 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 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<\n * \"recommended\"|\"recommended-error\"|\"recommended-typescript\"|\n * \"recommended-typescript-error\"|\"recommended-typescript-flavor\"|\n * \"recommended-typescript-flavor-error\"|\"flat/recommended\"|\n * \"flat/recommended-error\"|\"flat/recommended-typescript\"|\n * \"flat/recommended-typescript-error\"|\n * \"flat/recommended-typescript-flavor\"|\n * \"flat/recommended-typescript-flavor-error\",\n * import('eslint').Linter.FlatConfig\n * >\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-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 '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 * @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-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/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 * @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/* 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\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,OAAA;AACA,IAAAU,YAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,uBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,UAAA,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AC,OAAO,EAAE,mCAAmC,CAAC;AACrI/D,KAAK,CAACC,OAAO,CAAC,oCAAoC,CAAC,GAAGiE,wCAAwC,CAAC,MAAM,EAAE,oCAAoC,CAAC;AAC5IlE,KAAK,CAACC,OAAO,CAAC,0CAA0C,CAAC,GAAGiE,wCAAwC,CAAC,OAAO,EAAE,0CAA0C,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAvE,OAAA,GAE3IC,KAAK;AAAAuE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAvE,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","_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","e","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTemplateNames","checkTypes","checkValues","convertToJsdocComments","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","requireTemplate","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","flatName","name","plugins","jsdoc","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 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 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\n/**\n * @type {import('eslint').ESLint.Plugin & {\n * configs: Record<\n * \"recommended\"|\"recommended-error\"|\"recommended-typescript\"|\n * \"recommended-typescript-error\"|\"recommended-typescript-flavor\"|\n * \"recommended-typescript-flavor-error\"|\"flat/recommended\"|\n * \"flat/recommended-error\"|\"flat/recommended-typescript\"|\n * \"flat/recommended-typescript-error\"|\n * \"flat/recommended-typescript-flavor\"|\n * \"flat/recommended-typescript-flavor-error\",\n * import('eslint').Linter.FlatConfig\n * >\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 '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/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/* 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\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,sBA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E,wCAAwC,CAAC,OAAO,CAAC;AAExGpE,KAAK,CAACC,OAAO,CAAC,kBAAkB,CAAC,GAAG0D,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,CAAC;AACxF3D,KAAK,CAACC,OAAO,CAAC,wBAAwB,CAAC,GAAG0D,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC;AACrG3D,KAAK,CAACC,OAAO,CAAC,6BAA6B,CAAC,GAAGgE,kCAAkC,CAAC,MAAM,EAAE,6BAA6B,CAAC;AACxHjE,KAAK,CAACC,OAAO,CAAC,mCAAmC,CAAC,GAAGgE,kCAAkC,CAAC,OAAO,EAAE,mCAAmC,CAAC;AACrIjE,KAAK,CAACC,OAAO,CAAC,oCAAoC,CAAC,GAAGmE,wCAAwC,CAAC,MAAM,EAAE,oCAAoC,CAAC;AAC5IpE,KAAK,CAACC,OAAO,CAAC,0CAA0C,CAAC,GAAGmE,wCAAwC,CAAC,OAAO,EAAE,0CAA0C,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAzE,OAAA,GAE3IC,KAAK;AAAAyE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAzE,OAAA","ignoreList":[]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAyDA;;;;;;;;;;;;;GAaG;AACH,qBAbU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG;IAC1C,OAAW,EAAE,MAAM,CACnB,aAAmB,GAAC,mBAAmB,GAAC,wBAAwB,GAChE,8BAAsC,GAAC,+BAA+B,GACtE,qCAA6C,GAAC,kBAAkB,GAChE,wBAAgC,GAAC,6BAA6B,GAC9D,mCAA2C,GAC3C,oCAA4C,GAC5C,0CAAkD,EAClD,OAAa,QAAQ,EAAE,MAAM,CAAC,UAAU,CACnC,CAAA;CACF,CA+DF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
8
|
+
var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
11
|
+
context,
|
|
12
|
+
utils,
|
|
13
|
+
node,
|
|
14
|
+
settings,
|
|
15
|
+
report
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
mode
|
|
19
|
+
} = settings;
|
|
20
|
+
const templateTags = utils.getTags('template');
|
|
21
|
+
const usedNames = new Set();
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
24
|
+
*/
|
|
25
|
+
const checkParameters = aliasDeclaration => {
|
|
26
|
+
/* c8 ignore next -- Guard */
|
|
27
|
+
const {
|
|
28
|
+
params
|
|
29
|
+
} = aliasDeclaration.typeParameters ?? {
|
|
30
|
+
params: []
|
|
31
|
+
};
|
|
32
|
+
for (const {
|
|
33
|
+
name: {
|
|
34
|
+
name
|
|
35
|
+
}
|
|
36
|
+
} of params) {
|
|
37
|
+
usedNames.add(name);
|
|
38
|
+
}
|
|
39
|
+
for (const tag of templateTags) {
|
|
40
|
+
const {
|
|
41
|
+
name
|
|
42
|
+
} = tag;
|
|
43
|
+
const names = name.split(/,\s*/);
|
|
44
|
+
for (const name of names) {
|
|
45
|
+
if (!usedNames.has(name)) {
|
|
46
|
+
report(`@template ${name} not in use`, null, tag);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const handleTypeAliases = () => {
|
|
52
|
+
var _nde$declaration;
|
|
53
|
+
const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */
|
|
54
|
+
node;
|
|
55
|
+
if (!nde) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
switch (nde.type) {
|
|
59
|
+
case 'ExportNamedDeclaration':
|
|
60
|
+
if (((_nde$declaration = nde.declaration) === null || _nde$declaration === void 0 ? void 0 : _nde$declaration.type) === 'TSTypeAliasDeclaration') {
|
|
61
|
+
checkParameters(nde.declaration);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case 'TSTypeAliasDeclaration':
|
|
65
|
+
checkParameters(nde);
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const typedefTags = utils.getTags('typedef');
|
|
70
|
+
if (!typedefTags.length || typedefTags.length >= 2) {
|
|
71
|
+
handleTypeAliases();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const potentialType = typedefTags[0].type;
|
|
75
|
+
const parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)( /** @type {string} */potentialType) : (0, _jsdoccomment.parse)( /** @type {string} */potentialType, mode);
|
|
76
|
+
(0, _jsdoccomment.traverse)(parsedType, nde => {
|
|
77
|
+
const {
|
|
78
|
+
type,
|
|
79
|
+
value
|
|
80
|
+
} = /** @type {import('jsdoc-type-pratt-parser').NameResult} */nde;
|
|
81
|
+
if (type === 'JsdocTypeName' && /^[A-Z]$/.test(value)) {
|
|
82
|
+
usedNames.add(value);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
for (const tag of templateTags) {
|
|
86
|
+
const {
|
|
87
|
+
name
|
|
88
|
+
} = tag;
|
|
89
|
+
const names = name.split(/,\s*/);
|
|
90
|
+
for (const name of names) {
|
|
91
|
+
if (!usedNames.has(name)) {
|
|
92
|
+
report(`@template ${name} not in use`, null, tag);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
iterateAllJsdocs: true,
|
|
98
|
+
meta: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: 'Checks that any `@template` names are actually used in the connected `@typedef` or type alias.',
|
|
101
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header'
|
|
102
|
+
},
|
|
103
|
+
schema: [],
|
|
104
|
+
type: 'suggestion'
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
module.exports = exports.default;
|
|
108
|
+
//# sourceMappingURL=checkTemplateNames.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkTemplateNames.cjs","names":["_jsdoccomment","require","_iterateJsdoc","_interopRequireDefault","e","__esModule","default","_default","exports","iterateJsdoc","context","utils","node","settings","report","mode","templateTags","getTags","usedNames","Set","checkParameters","aliasDeclaration","params","typeParameters","name","add","tag","names","split","has","handleTypeAliases","_nde$declaration","nde","type","declaration","typedefTags","length","potentialType","parsedType","tryParseType","parseType","traverse","value","test","iterateAllJsdocs","meta","docs","description","url","schema","module"],"sources":["../../src/rules/checkTemplateNames.js"],"sourcesContent":["import {\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n utils,\n node,\n settings,\n report,\n}) => {\n const {\n mode\n } = settings;\n\n const templateTags = utils.getTags('template');\n\n const usedNames = new Set();\n /**\n * @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n */\n const checkParameters = (aliasDeclaration) => {\n /* c8 ignore next -- Guard */\n const {params} = aliasDeclaration.typeParameters ?? {params: []};\n for (const {name: {name}} of params) {\n usedNames.add(name);\n }\n for (const tag of templateTags) {\n const {name} = tag;\n const names = name.split(/,\\s*/);\n for (const name of names) {\n if (!usedNames.has(name)) {\n report(`@template ${name} not in use`, null, tag);\n }\n }\n }\n };\n\n const handleTypeAliases = () => {\n const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (\n node\n );\n if (!nde) {\n return;\n }\n switch (nde.type) {\n case 'ExportNamedDeclaration':\n if (nde.declaration?.type === 'TSTypeAliasDeclaration') {\n checkParameters(nde.declaration);\n }\n break;\n case 'TSTypeAliasDeclaration':\n checkParameters(nde);\n break;\n }\n };\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypeAliases();\n return;\n }\n\n const potentialType = typedefTags[0].type;\n const parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode)\n\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n if (type === 'JsdocTypeName' && (/^[A-Z]$/).test(value)) {\n usedNames.add(value);\n }\n });\n\n for (const tag of templateTags) {\n const {name} = tag;\n const names = name.split(/,\\s*/);\n for (const name of names) {\n if (!usedNames.has(name)) {\n report(`@template ${name} not in use`, null, tag);\n }\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that any `@template` names are actually used in the connected `@typedef` or type alias.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',\n },\n schema: [],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC,QAAQ;E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AC,CAAC;AAAAiB,MAAA,CAAA1C,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
8
|
+
var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
11
|
+
context,
|
|
12
|
+
utils,
|
|
13
|
+
node,
|
|
14
|
+
settings,
|
|
15
|
+
report
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
requireSeparateTemplates = false
|
|
19
|
+
} = context.options[0] || {};
|
|
20
|
+
const {
|
|
21
|
+
mode
|
|
22
|
+
} = settings;
|
|
23
|
+
const usedNames = new Set();
|
|
24
|
+
const templateTags = utils.getTags('template');
|
|
25
|
+
const templateNames = templateTags.flatMap(({
|
|
26
|
+
name
|
|
27
|
+
}) => {
|
|
28
|
+
return name.split(/,\s*/);
|
|
29
|
+
});
|
|
30
|
+
for (const tag of templateTags) {
|
|
31
|
+
const {
|
|
32
|
+
name
|
|
33
|
+
} = tag;
|
|
34
|
+
const names = name.split(/,\s*/);
|
|
35
|
+
if (requireSeparateTemplates && names.length > 1) {
|
|
36
|
+
report(`Missing separate @template for ${names[1]}`, null, tag);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
42
|
+
*/
|
|
43
|
+
const checkParameters = aliasDeclaration => {
|
|
44
|
+
/* c8 ignore next -- Guard */
|
|
45
|
+
const {
|
|
46
|
+
params
|
|
47
|
+
} = aliasDeclaration.typeParameters ?? {
|
|
48
|
+
params: []
|
|
49
|
+
};
|
|
50
|
+
for (const {
|
|
51
|
+
name: {
|
|
52
|
+
name
|
|
53
|
+
}
|
|
54
|
+
} of params) {
|
|
55
|
+
usedNames.add(name);
|
|
56
|
+
}
|
|
57
|
+
for (const usedName of usedNames) {
|
|
58
|
+
if (!templateNames.includes(usedName)) {
|
|
59
|
+
report(`Missing @template ${usedName}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const handleTypeAliases = () => {
|
|
64
|
+
var _nde$declaration;
|
|
65
|
+
const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */
|
|
66
|
+
node;
|
|
67
|
+
if (!nde) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
switch (nde.type) {
|
|
71
|
+
case 'ExportNamedDeclaration':
|
|
72
|
+
if (((_nde$declaration = nde.declaration) === null || _nde$declaration === void 0 ? void 0 : _nde$declaration.type) === 'TSTypeAliasDeclaration') {
|
|
73
|
+
checkParameters(nde.declaration);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case 'TSTypeAliasDeclaration':
|
|
77
|
+
checkParameters(nde);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const typedefTags = utils.getTags('typedef');
|
|
82
|
+
if (!typedefTags.length || typedefTags.length >= 2) {
|
|
83
|
+
handleTypeAliases();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const potentialType = typedefTags[0].type;
|
|
87
|
+
const parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)( /** @type {string} */potentialType) : (0, _jsdoccomment.parse)( /** @type {string} */potentialType, mode);
|
|
88
|
+
(0, _jsdoccomment.traverse)(parsedType, nde => {
|
|
89
|
+
const {
|
|
90
|
+
type,
|
|
91
|
+
value
|
|
92
|
+
} = /** @type {import('jsdoc-type-pratt-parser').NameResult} */nde;
|
|
93
|
+
if (type === 'JsdocTypeName' && /^[A-Z]$/.test(value)) {
|
|
94
|
+
usedNames.add(value);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Could check against whitelist/blacklist
|
|
99
|
+
for (const usedName of usedNames) {
|
|
100
|
+
if (!templateNames.includes(usedName)) {
|
|
101
|
+
report(`Missing @template ${usedName}`, null, typedefTags[0]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
iterateAllJsdocs: true,
|
|
106
|
+
meta: {
|
|
107
|
+
docs: {
|
|
108
|
+
description: 'Requires template tags for each generic type parameter',
|
|
109
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header'
|
|
110
|
+
},
|
|
111
|
+
schema: [{
|
|
112
|
+
additionalProperties: false,
|
|
113
|
+
properties: {
|
|
114
|
+
requireSeparateTemplates: {
|
|
115
|
+
type: 'boolean'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
type: 'object'
|
|
119
|
+
}],
|
|
120
|
+
type: 'suggestion'
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
module.exports = exports.default;
|
|
124
|
+
//# sourceMappingURL=requireTemplate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requireTemplate.cjs","names":["_jsdoccomment","require","_iterateJsdoc","_interopRequireDefault","e","__esModule","default","_default","exports","iterateJsdoc","context","utils","node","settings","report","requireSeparateTemplates","options","mode","usedNames","Set","templateTags","getTags","templateNames","flatMap","name","split","tag","names","length","checkParameters","aliasDeclaration","params","typeParameters","add","usedName","includes","handleTypeAliases","_nde$declaration","nde","type","declaration","typedefTags","potentialType","parsedType","tryParseType","parseType","traverse","value","test","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","module"],"sources":["../../src/rules/requireTemplate.js"],"sourcesContent":["import {\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n utils,\n node,\n settings,\n report,\n}) => {\n const {\n requireSeparateTemplates = false,\n } = context.options[0] || {};\n\n const {\n mode\n } = settings;\n\n const usedNames = new Set();\n const templateTags = utils.getTags('template');\n const templateNames = templateTags.flatMap(({name}) => {\n return name.split(/,\\s*/);\n });\n\n for (const tag of templateTags) {\n const {name} = tag;\n const names = name.split(/,\\s*/);\n if (requireSeparateTemplates && names.length > 1) {\n report(`Missing separate @template for ${names[1]}`, null, tag);\n }\n }\n\n /**\n * @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n */\n const checkParameters = (aliasDeclaration) => {\n /* c8 ignore next -- Guard */\n const {params} = aliasDeclaration.typeParameters ?? {params: []};\n for (const {name: {name}} of params) {\n usedNames.add(name);\n }\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`);\n }\n }\n };\n\n const handleTypeAliases = () => {\n const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (\n node\n );\n if (!nde) {\n return;\n }\n switch (nde.type) {\n case 'ExportNamedDeclaration':\n if (nde.declaration?.type === 'TSTypeAliasDeclaration') {\n checkParameters(nde.declaration);\n }\n break;\n case 'TSTypeAliasDeclaration':\n checkParameters(nde);\n break;\n }\n };\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypeAliases();\n return;\n }\n\n const potentialType = typedefTags[0].type;\n const parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode)\n\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n if (type === 'JsdocTypeName' && (/^[A-Z]$/).test(value)) {\n usedNames.add(value);\n }\n });\n\n // Could check against whitelist/blacklist\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`, null, typedefTags[0]);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires template tags for each generic type parameter',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n requireSeparateTemplates: {\n type: 'boolean'\n }\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,wBAAwB,GAAG;EAC7B,CAAC,GAAGL,OAAO,CAACM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJC;EACF,CAAC,GAAGJ,QAAQ;EAEZ,MAAMK,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC3B,MAAMC,YAAY,GAAGT,KAAK,CAACU,OAAO,CAAC,UAAU,CAAC;EAC9C,MAAMC,aAAa,GAAGF,YAAY,CAACG,OAAO,CAAC,CAAC;IAACC;EAAI,CAAC,KAAK;IACrD,OAAOA,IAAI,CAACC,KAAK,CAAC,MAAM,CAAC;EAC3B,CAAC,CAAC;EAEF,KAAK,MAAMC,GAAG,IAAIN,YAAY,EAAE;IAC9B,MAAM;MAACI;IAAI,CAAC,GAAGE,GAAG;IAClB,MAAMC,KAAK,GAAGH,IAAI,CAACC,KAAK,CAAC,MAA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|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "~0.
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.46.0",
|
|
9
9
|
"are-docs-informative": "^0.0.2",
|
|
10
10
|
"comment-parser": "1.4.1",
|
|
11
11
|
"debug": "^4.3.5",
|
|
12
12
|
"escape-string-regexp": "^4.0.0",
|
|
13
13
|
"esquery": "^1.6.0",
|
|
14
14
|
"parse-imports": "^2.1.1",
|
|
15
|
-
"semver": "^7.6.
|
|
15
|
+
"semver": "^7.6.3",
|
|
16
16
|
"spdx-expression-parse": "^4.0.0",
|
|
17
|
-
"synckit": "^0.9.
|
|
17
|
+
"synckit": "^0.9.1"
|
|
18
18
|
},
|
|
19
19
|
"description": "JSDoc linting rules for ESLint.",
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babel/cli": "^7.24.
|
|
22
|
-
"@babel/core": "^7.24.
|
|
23
|
-
"@babel/eslint-parser": "^7.24.
|
|
24
|
-
"@babel/node": "^7.24.
|
|
21
|
+
"@babel/cli": "^7.24.8",
|
|
22
|
+
"@babel/core": "^7.24.9",
|
|
23
|
+
"@babel/eslint-parser": "^7.24.8",
|
|
24
|
+
"@babel/node": "^7.24.8",
|
|
25
25
|
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
|
26
26
|
"@babel/plugin-transform-flow-strip-types": "^7.24.7",
|
|
27
|
-
"@babel/preset-env": "^7.24.
|
|
27
|
+
"@babel/preset-env": "^7.24.8",
|
|
28
28
|
"@es-joy/escodegen": "^3.5.1",
|
|
29
29
|
"@es-joy/jsdoc-eslint-parser": "^0.21.1",
|
|
30
30
|
"@hkdobrev/run-if-changed": "^0.3.1",
|
|
@@ -39,31 +39,31 @@
|
|
|
39
39
|
"@types/json-schema": "^7.0.15",
|
|
40
40
|
"@types/lodash.defaultsdeep": "^4.6.9",
|
|
41
41
|
"@types/mocha": "^10.0.7",
|
|
42
|
-
"@types/node": "^20.14.
|
|
42
|
+
"@types/node": "^20.14.11",
|
|
43
43
|
"@types/semver": "^7.5.8",
|
|
44
44
|
"@types/spdx-expression-parse": "^3.0.5",
|
|
45
|
-
"@typescript-eslint/types": "^7.16.
|
|
45
|
+
"@typescript-eslint/types": "^7.16.1",
|
|
46
46
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
47
47
|
"babel-plugin-istanbul": "^7.0.0",
|
|
48
48
|
"babel-plugin-transform-import-meta": "^2.2.1",
|
|
49
49
|
"c8": "^10.1.2",
|
|
50
|
-
"camelcase": "^
|
|
51
|
-
"chai": "^
|
|
50
|
+
"camelcase": "^8.0.0",
|
|
51
|
+
"chai": "^5.1.1",
|
|
52
52
|
"cross-env": "^7.0.3",
|
|
53
|
-
"decamelize": "^
|
|
54
|
-
"eslint": "9.
|
|
55
|
-
"eslint-config-canonical": "~43.0.
|
|
53
|
+
"decamelize": "^6.0.0",
|
|
54
|
+
"eslint": "9.7.0",
|
|
55
|
+
"eslint-config-canonical": "~43.0.14",
|
|
56
56
|
"espree": "^10.1.0",
|
|
57
|
-
"gitdown": "^
|
|
57
|
+
"gitdown": "^4.1.1",
|
|
58
58
|
"glob": "^10.4.2",
|
|
59
59
|
"globals": "^15.8.0",
|
|
60
|
-
"husky": "^9.
|
|
60
|
+
"husky": "^9.1.1",
|
|
61
61
|
"jsdoc-type-pratt-parser": "^4.0.0",
|
|
62
62
|
"json-schema": "^0.4.0",
|
|
63
63
|
"lint-staged": "^15.2.7",
|
|
64
64
|
"lodash.defaultsdeep": "^4.6.1",
|
|
65
65
|
"mocha": "^10.6.0",
|
|
66
|
-
"open-editor": "^
|
|
66
|
+
"open-editor": "^5.0.0",
|
|
67
67
|
"replace": "^1.2.2",
|
|
68
68
|
"rimraf": "^5.0.7",
|
|
69
69
|
"semantic-release": "^24.0.0",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"test-cov": "cross-env TIMING=1 c8 --reporter text npm run test-no-cov",
|
|
145
145
|
"test-index": "npm run test-no-cov -- test/rules/index.js"
|
|
146
146
|
},
|
|
147
|
-
"version": "48.
|
|
147
|
+
"version": "48.8.0"
|
|
148
148
|
}
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import checkParamNames from './rules/checkParamNames.js';
|
|
|
7
7
|
import checkPropertyNames from './rules/checkPropertyNames.js';
|
|
8
8
|
import checkSyntax from './rules/checkSyntax.js';
|
|
9
9
|
import checkTagNames from './rules/checkTagNames.js';
|
|
10
|
+
import checkTemplateNames from './rules/checkTemplateNames.js';
|
|
10
11
|
import checkTypes from './rules/checkTypes.js';
|
|
11
12
|
import checkValues from './rules/checkValues.js';
|
|
12
13
|
import convertToJsdocComments from './rules/convertToJsdocComments.js';
|
|
@@ -45,6 +46,7 @@ import requireReturns from './rules/requireReturns.js';
|
|
|
45
46
|
import requireReturnsCheck from './rules/requireReturnsCheck.js';
|
|
46
47
|
import requireReturnsDescription from './rules/requireReturnsDescription.js';
|
|
47
48
|
import requireReturnsType from './rules/requireReturnsType.js';
|
|
49
|
+
import requireTemplate from './rules/requireTemplate.js';
|
|
48
50
|
import requireThrows from './rules/requireThrows.js';
|
|
49
51
|
import requireYields from './rules/requireYields.js';
|
|
50
52
|
import requireYieldsCheck from './rules/requireYieldsCheck.js';
|
|
@@ -80,6 +82,7 @@ const index = {
|
|
|
80
82
|
'check-property-names': checkPropertyNames,
|
|
81
83
|
'check-syntax': checkSyntax,
|
|
82
84
|
'check-tag-names': checkTagNames,
|
|
85
|
+
'check-template-names': checkTemplateNames,
|
|
83
86
|
'check-types': checkTypes,
|
|
84
87
|
'check-values': checkValues,
|
|
85
88
|
'convert-to-jsdoc-comments': convertToJsdocComments,
|
|
@@ -118,6 +121,7 @@ const index = {
|
|
|
118
121
|
'require-returns-check': requireReturnsCheck,
|
|
119
122
|
'require-returns-description': requireReturnsDescription,
|
|
120
123
|
'require-returns-type': requireReturnsType,
|
|
124
|
+
'require-template': requireTemplate,
|
|
121
125
|
'require-throws': requireThrows,
|
|
122
126
|
'require-yields': requireYields,
|
|
123
127
|
'require-yields-check': requireYieldsCheck,
|
|
@@ -153,6 +157,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
153
157
|
'jsdoc/check-property-names': warnOrError,
|
|
154
158
|
'jsdoc/check-syntax': 'off',
|
|
155
159
|
'jsdoc/check-tag-names': warnOrError,
|
|
160
|
+
'jsdoc/check-template-names': 'off',
|
|
156
161
|
'jsdoc/check-types': warnOrError,
|
|
157
162
|
'jsdoc/check-values': warnOrError,
|
|
158
163
|
'jsdoc/convert-to-jsdoc-comments': 'off',
|
|
@@ -191,6 +196,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
191
196
|
'jsdoc/require-returns-check': warnOrError,
|
|
192
197
|
'jsdoc/require-returns-description': warnOrError,
|
|
193
198
|
'jsdoc/require-returns-type': warnOrError,
|
|
199
|
+
'jsdoc/require-template': 'off',
|
|
194
200
|
'jsdoc/require-throws': 'off',
|
|
195
201
|
'jsdoc/require-yields': warnOrError,
|
|
196
202
|
'jsdoc/require-yields-check': warnOrError,
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parse as parseType,
|
|
3
|
+
traverse,
|
|
4
|
+
tryParse as tryParseType,
|
|
5
|
+
} from '@es-joy/jsdoccomment';
|
|
6
|
+
import iterateJsdoc from '../iterateJsdoc.js';
|
|
7
|
+
|
|
8
|
+
export default iterateJsdoc(({
|
|
9
|
+
context,
|
|
10
|
+
utils,
|
|
11
|
+
node,
|
|
12
|
+
settings,
|
|
13
|
+
report,
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
mode
|
|
17
|
+
} = settings;
|
|
18
|
+
|
|
19
|
+
const templateTags = utils.getTags('template');
|
|
20
|
+
|
|
21
|
+
const usedNames = new Set();
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
24
|
+
*/
|
|
25
|
+
const checkParameters = (aliasDeclaration) => {
|
|
26
|
+
/* c8 ignore next -- Guard */
|
|
27
|
+
const {params} = aliasDeclaration.typeParameters ?? {params: []};
|
|
28
|
+
for (const {name: {name}} of params) {
|
|
29
|
+
usedNames.add(name);
|
|
30
|
+
}
|
|
31
|
+
for (const tag of templateTags) {
|
|
32
|
+
const {name} = tag;
|
|
33
|
+
const names = name.split(/,\s*/);
|
|
34
|
+
for (const name of names) {
|
|
35
|
+
if (!usedNames.has(name)) {
|
|
36
|
+
report(`@template ${name} not in use`, null, tag);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleTypeAliases = () => {
|
|
43
|
+
const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (
|
|
44
|
+
node
|
|
45
|
+
);
|
|
46
|
+
if (!nde) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
switch (nde.type) {
|
|
50
|
+
case 'ExportNamedDeclaration':
|
|
51
|
+
if (nde.declaration?.type === 'TSTypeAliasDeclaration') {
|
|
52
|
+
checkParameters(nde.declaration);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case 'TSTypeAliasDeclaration':
|
|
56
|
+
checkParameters(nde);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const typedefTags = utils.getTags('typedef');
|
|
62
|
+
if (!typedefTags.length || typedefTags.length >= 2) {
|
|
63
|
+
handleTypeAliases();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const potentialType = typedefTags[0].type;
|
|
68
|
+
const parsedType = mode === 'permissive' ?
|
|
69
|
+
tryParseType(/** @type {string} */ (potentialType)) :
|
|
70
|
+
parseType(/** @type {string} */ (potentialType), mode)
|
|
71
|
+
|
|
72
|
+
traverse(parsedType, (nde) => {
|
|
73
|
+
const {
|
|
74
|
+
type,
|
|
75
|
+
value,
|
|
76
|
+
} = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);
|
|
77
|
+
if (type === 'JsdocTypeName' && (/^[A-Z]$/).test(value)) {
|
|
78
|
+
usedNames.add(value);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
for (const tag of templateTags) {
|
|
83
|
+
const {name} = tag;
|
|
84
|
+
const names = name.split(/,\s*/);
|
|
85
|
+
for (const name of names) {
|
|
86
|
+
if (!usedNames.has(name)) {
|
|
87
|
+
report(`@template ${name} not in use`, null, tag);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
iterateAllJsdocs: true,
|
|
93
|
+
meta: {
|
|
94
|
+
docs: {
|
|
95
|
+
description: 'Checks that any `@template` names are actually used in the connected `@typedef` or type alias.',
|
|
96
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',
|
|
97
|
+
},
|
|
98
|
+
schema: [],
|
|
99
|
+
type: 'suggestion',
|
|
100
|
+
},
|
|
101
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parse as parseType,
|
|
3
|
+
traverse,
|
|
4
|
+
tryParse as tryParseType,
|
|
5
|
+
} from '@es-joy/jsdoccomment';
|
|
6
|
+
import iterateJsdoc from '../iterateJsdoc.js';
|
|
7
|
+
|
|
8
|
+
export default iterateJsdoc(({
|
|
9
|
+
context,
|
|
10
|
+
utils,
|
|
11
|
+
node,
|
|
12
|
+
settings,
|
|
13
|
+
report,
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
requireSeparateTemplates = false,
|
|
17
|
+
} = context.options[0] || {};
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
mode
|
|
21
|
+
} = settings;
|
|
22
|
+
|
|
23
|
+
const usedNames = new Set();
|
|
24
|
+
const templateTags = utils.getTags('template');
|
|
25
|
+
const templateNames = templateTags.flatMap(({name}) => {
|
|
26
|
+
return name.split(/,\s*/);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
for (const tag of templateTags) {
|
|
30
|
+
const {name} = tag;
|
|
31
|
+
const names = name.split(/,\s*/);
|
|
32
|
+
if (requireSeparateTemplates && names.length > 1) {
|
|
33
|
+
report(`Missing separate @template for ${names[1]}`, null, tag);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
39
|
+
*/
|
|
40
|
+
const checkParameters = (aliasDeclaration) => {
|
|
41
|
+
/* c8 ignore next -- Guard */
|
|
42
|
+
const {params} = aliasDeclaration.typeParameters ?? {params: []};
|
|
43
|
+
for (const {name: {name}} of params) {
|
|
44
|
+
usedNames.add(name);
|
|
45
|
+
}
|
|
46
|
+
for (const usedName of usedNames) {
|
|
47
|
+
if (!templateNames.includes(usedName)) {
|
|
48
|
+
report(`Missing @template ${usedName}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const handleTypeAliases = () => {
|
|
54
|
+
const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (
|
|
55
|
+
node
|
|
56
|
+
);
|
|
57
|
+
if (!nde) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
switch (nde.type) {
|
|
61
|
+
case 'ExportNamedDeclaration':
|
|
62
|
+
if (nde.declaration?.type === 'TSTypeAliasDeclaration') {
|
|
63
|
+
checkParameters(nde.declaration);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case 'TSTypeAliasDeclaration':
|
|
67
|
+
checkParameters(nde);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const typedefTags = utils.getTags('typedef');
|
|
73
|
+
if (!typedefTags.length || typedefTags.length >= 2) {
|
|
74
|
+
handleTypeAliases();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const potentialType = typedefTags[0].type;
|
|
79
|
+
const parsedType = mode === 'permissive' ?
|
|
80
|
+
tryParseType(/** @type {string} */ (potentialType)) :
|
|
81
|
+
parseType(/** @type {string} */ (potentialType), mode)
|
|
82
|
+
|
|
83
|
+
traverse(parsedType, (nde) => {
|
|
84
|
+
const {
|
|
85
|
+
type,
|
|
86
|
+
value,
|
|
87
|
+
} = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);
|
|
88
|
+
if (type === 'JsdocTypeName' && (/^[A-Z]$/).test(value)) {
|
|
89
|
+
usedNames.add(value);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Could check against whitelist/blacklist
|
|
94
|
+
for (const usedName of usedNames) {
|
|
95
|
+
if (!templateNames.includes(usedName)) {
|
|
96
|
+
report(`Missing @template ${usedName}`, null, typedefTags[0]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
iterateAllJsdocs: true,
|
|
101
|
+
meta: {
|
|
102
|
+
docs: {
|
|
103
|
+
description: 'Requires template tags for each generic type parameter',
|
|
104
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',
|
|
105
|
+
},
|
|
106
|
+
schema: [
|
|
107
|
+
{
|
|
108
|
+
additionalProperties: false,
|
|
109
|
+
properties: {
|
|
110
|
+
requireSeparateTemplates: {
|
|
111
|
+
type: 'boolean'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
type: 'object',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
type: 'suggestion',
|
|
118
|
+
},
|
|
119
|
+
});
|