eslint-plugin-jsdoc 48.11.0 → 49.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/rules/checkTemplateNames.cjs +1 -1
- package/dist/rules/checkTemplateNames.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.cjs +96 -0
- package/dist/rules/linesBeforeBlock.cjs.map +1 -0
- package/package.json +1 -1
- package/src/index.js +3 -0
- package/src/rules/checkTemplateNames.js +1 -1
- package/src/rules/linesBeforeBlock.js +101 -0
package/README.md
CHANGED
|
@@ -277,6 +277,7 @@ non-default-recommended fixer).
|
|
|
277
277
|
|: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|
|
|
278
278
|
|: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)|
|
|
279
279
|
|||[informative-docs](./docs/rules/informative-docs.md#readme)|Reports on JSDoc texts that serve only to restate their attached name.|
|
|
280
|
+
|:heavy_check_mark:||[lines-before-block](./docs/rules/lines-before-block.md#readme)|Enforces minimum number of newlines before JSDoc comment blocks|
|
|
280
281
|
|||[match-description](./docs/rules/match-description.md#readme)|Defines customizable regular expression rules for your tag descriptions|
|
|
281
282
|
||:wrench:|[match-name](./docs/rules/match-name.md#readme)|Reports the name portion of a JSDoc tag if matching or not matching a given regular expression|
|
|
282
283
|
|:heavy_check_mark:|:wrench:|[multiline-blocks](./docs/rules/multiline-blocks.md#readme)|Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks|
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var _emptyTags = _interopRequireDefault(require("./rules/emptyTags.cjs"));
|
|
|
21
21
|
var _implementsOnClasses = _interopRequireDefault(require("./rules/implementsOnClasses.cjs"));
|
|
22
22
|
var _importsAsDependencies = _interopRequireDefault(require("./rules/importsAsDependencies.cjs"));
|
|
23
23
|
var _informativeDocs = _interopRequireDefault(require("./rules/informativeDocs.cjs"));
|
|
24
|
+
var _linesBeforeBlock = _interopRequireDefault(require("./rules/linesBeforeBlock.cjs"));
|
|
24
25
|
var _matchDescription = _interopRequireDefault(require("./rules/matchDescription.cjs"));
|
|
25
26
|
var _matchName = _interopRequireDefault(require("./rules/matchName.cjs"));
|
|
26
27
|
var _multilineBlocks = _interopRequireDefault(require("./rules/multilineBlocks.cjs"));
|
|
@@ -97,6 +98,7 @@ const index = {
|
|
|
97
98
|
'implements-on-classes': _implementsOnClasses.default,
|
|
98
99
|
'imports-as-dependencies': _importsAsDependencies.default,
|
|
99
100
|
'informative-docs': _informativeDocs.default,
|
|
101
|
+
'lines-before-block': _linesBeforeBlock.default,
|
|
100
102
|
'match-description': _matchDescription.default,
|
|
101
103
|
'match-name': _matchName.default,
|
|
102
104
|
'multiline-blocks': _multilineBlocks.default,
|
|
@@ -171,6 +173,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
171
173
|
'jsdoc/implements-on-classes': warnOrError,
|
|
172
174
|
'jsdoc/imports-as-dependencies': 'off',
|
|
173
175
|
'jsdoc/informative-docs': 'off',
|
|
176
|
+
'jsdoc/lines-before-block': warnOrError,
|
|
174
177
|
'jsdoc/match-description': 'off',
|
|
175
178
|
'jsdoc/match-name': 'off',
|
|
176
179
|
'jsdoc/multiline-blocks': 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","_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","_getJsdocProcessorPlugin","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","examples","files","getJsdocProcessorPlugin","processor","checkDefaults","checkParams","checkProperties","quotes","semi","strict","map","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 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 * @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\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,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,mBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,YAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,uBAAA,GAAAb,sBAAA,CAAAC,OAAA;AAC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C;AACH,CAAC,CAAC,CACF;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAArF,OAAA,GAEYC,KAAK;AAAAqF,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAArF,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","Error","recommended","examples","files","getJsdocProcessorPlugin","processor","checkDefaults","checkParams","checkProperties","quotes","semi","strict","map","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 * @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 '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': warnOrError,\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\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,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AC,CACD;AAEFjF,KAAK,CAACC,OAAO,CAAC,kCAAkC,CAAC,GAAG,mDAAqD,CACvG;EACE8D,IAAI,EAAE,wCAAwC;EAC9CC,OAAO,EAAE;IACPQ,QAAQ,EAAE,IAAAE,gDAAuB,EAAC;MAChCE,aAAa,EAAE,IAAI;MACnBC,WAAW,EAAE,IAAI;MACjBC,eAAe,EAAE;IACnB,CAAC;EACH;AACF,CAAC,EACD,GAAG9E,KAAK,CAACC,OAAO,CAACuE,QAAQ,CAACU,GAAG,CAAEC,MAAM,IAAK;EACxC,OAAO;IACL,GAAGA,MAAM;IACTnB,OAAO,EAAE,CAAC;EACZ,CAAC;AACH,CAAC,CAAC,EACF,GAAGhE,KAAK,CAACC,OAAO,CAAC,qBAAqB,CAAC,CAACiF,GAAG,CAAEC,MAAM,IAAK;EACtD,OAAO;IACL,GAAGA,MAAM;IACTnB,OAAO,EAAE,CAAC;EACZ,CAAC;AACH,CAAC,CAAC,CACF;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAtF,OAAA,GAEYC,KAAK;AAAAsF,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAtF,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":";AA4DA;;;;;;;;;;;;;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,CAgEF"}
|
|
@@ -163,7 +163,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
163
163
|
meta: {
|
|
164
164
|
docs: {
|
|
165
165
|
description: 'Checks that any `@template` names are actually used in the connected `@typedef` or type alias.',
|
|
166
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/
|
|
166
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-template-names.md#repos-sticky-header'
|
|
167
167
|
},
|
|
168
168
|
schema: [],
|
|
169
169
|
type: 'suggestion'
|
|
@@ -1 +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","checkForUsedTypes","potentialType","parsedType","tryParseType","parseType","traverse","nde","type","value","test","add","checkParamsAndReturnsTags","paramName","getPreferredTagName","tagName","paramTags","paramTag","returnsName","returnsTags","returnsTag","checkTemplateTags","tag","name","names","split","has","checkParameters","aliasDeclaration","checkParamsAndReturns","params","typeParameters","handleTypeAliases","_nde$declaration","declaration","callbackTags","functionTags","length","typedefTags","potentialTypedefType","propertyName","propertyTags","propertyTag","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 {string} potentialType\n */\n const checkForUsedTypes = (potentialType) => {\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\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\n const checkParamsAndReturnsTags = () => {\n const paramName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n const paramTags = utils.getTags(paramName);\n for (const paramTag of paramTags) {\n checkForUsedTypes(paramTag.type);\n }\n\n const returnsName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'returns',\n }));\n const returnsTags = utils.getTags(returnsName);\n for (const returnsTag of returnsTags) {\n checkForUsedTypes(returnsTag.type);\n }\n };\n\n const checkTemplateTags = () => {\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 /**\n * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|\n * import('@typescript-eslint/types').TSESTree.ClassDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n * @param {boolean} [checkParamsAndReturns]\n */\n const checkParameters = (aliasDeclaration, checkParamsAndReturns) => {\n /* c8 ignore next -- Guard */\n const {params} = aliasDeclaration.typeParameters ?? {params: []};\n for (const {name: {name}} of params) {\n usedNames.add(name);\n }\n if (checkParamsAndReturns) {\n checkParamsAndReturnsTags();\n }\n\n checkTemplateTags();\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 'ExportDefaultDeclaration':\n case 'ExportNamedDeclaration':\n switch (nde.declaration?.type) {\n case 'FunctionDeclaration':\n checkParameters(nde.declaration, true);\n break;\n case 'ClassDeclaration':\n case 'TSTypeAliasDeclaration':\n case 'TSInterfaceDeclaration':\n checkParameters(nde.declaration);\n break;\n }\n break;\n case 'FunctionDeclaration':\n checkParameters(nde, true);\n break;\n case 'ClassDeclaration':\n case 'TSTypeAliasDeclaration':\n case 'TSInterfaceDeclaration':\n checkParameters(nde);\n break;\n }\n };\n\n const callbackTags = utils.getTags('callback');\n const functionTags = utils.getTags('function');\n if (callbackTags.length || functionTags.length) {\n checkParamsAndReturnsTags();\n checkTemplateTags();\n return;\n }\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypeAliases();\n return;\n }\n\n const potentialTypedefType = typedefTags[0].type;\n checkForUsedTypes(potentialTypedefType);\n\n const propertyName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'property',\n }));\n const propertyTags = utils.getTags(propertyName);\n for (const propertyTag of propertyTags) {\n checkForUsedTypes(propertyTag.type);\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/
|
|
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","checkForUsedTypes","potentialType","parsedType","tryParseType","parseType","traverse","nde","type","value","test","add","checkParamsAndReturnsTags","paramName","getPreferredTagName","tagName","paramTags","paramTag","returnsName","returnsTags","returnsTag","checkTemplateTags","tag","name","names","split","has","checkParameters","aliasDeclaration","checkParamsAndReturns","params","typeParameters","handleTypeAliases","_nde$declaration","declaration","callbackTags","functionTags","length","typedefTags","potentialTypedefType","propertyName","propertyTags","propertyTag","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 {string} potentialType\n */\n const checkForUsedTypes = (potentialType) => {\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\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\n const checkParamsAndReturnsTags = () => {\n const paramName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n const paramTags = utils.getTags(paramName);\n for (const paramTag of paramTags) {\n checkForUsedTypes(paramTag.type);\n }\n\n const returnsName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'returns',\n }));\n const returnsTags = utils.getTags(returnsName);\n for (const returnsTag of returnsTags) {\n checkForUsedTypes(returnsTag.type);\n }\n };\n\n const checkTemplateTags = () => {\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 /**\n * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|\n * import('@typescript-eslint/types').TSESTree.ClassDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n * @param {boolean} [checkParamsAndReturns]\n */\n const checkParameters = (aliasDeclaration, checkParamsAndReturns) => {\n /* c8 ignore next -- Guard */\n const {params} = aliasDeclaration.typeParameters ?? {params: []};\n for (const {name: {name}} of params) {\n usedNames.add(name);\n }\n if (checkParamsAndReturns) {\n checkParamsAndReturnsTags();\n }\n\n checkTemplateTags();\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 'ExportDefaultDeclaration':\n case 'ExportNamedDeclaration':\n switch (nde.declaration?.type) {\n case 'FunctionDeclaration':\n checkParameters(nde.declaration, true);\n break;\n case 'ClassDeclaration':\n case 'TSTypeAliasDeclaration':\n case 'TSInterfaceDeclaration':\n checkParameters(nde.declaration);\n break;\n }\n break;\n case 'FunctionDeclaration':\n checkParameters(nde, true);\n break;\n case 'ClassDeclaration':\n case 'TSTypeAliasDeclaration':\n case 'TSInterfaceDeclaration':\n checkParameters(nde);\n break;\n }\n };\n\n const callbackTags = utils.getTags('callback');\n const functionTags = utils.getTags('function');\n if (callbackTags.length || functionTags.length) {\n checkParamsAndReturnsTags();\n checkTemplateTags();\n return;\n }\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypeAliases();\n return;\n }\n\n const potentialTypedefType = typedefTags[0].type;\n checkForUsedTypes(potentialTypedefType);\n\n const propertyName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'property',\n }));\n const propertyTags = utils.getTags(propertyName);\n for (const propertyTag of propertyTags) {\n checkForUsedTypes(propertyTag.type);\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/check-template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,GAAGD,WAAW,CAAC,CAAC,CAAC,CAAC9B,IAAI;EAChDP,iBAAiB,CAACsC,oBAAoB,CAAC;EAEvC,MAAMC,YAAY,GAAG,qBAAuBhD,KAAK,CAACsB,mBAAmB,CAAC;IACpEC,OAAO,EAAE;EACX,CAAC,CAAE;EACH,MAAM0B,YAAY,GAAGjD,KAAK,CAACM,OAAO,CAAC0C,YAAY,CAAC;EAChD,KAAK,MAAME,WAAW,IAAID,YAAY,EAAE;IACtCxC,iBAAiB,CAACyC,WAAW,CAAClC,IAAI,CAAC;EACrC;EAEA,KAAK,MAAMc,GAAG,IAAIzB,YAAY,EAAE;IAC9B,MAAM;MAAC0B;IAAI,CAAC,GAAGD,GAAG;IAClB,MAAME,KAAK,GAAGD,IAAI,CAACE,KAAK,CAAC,MAAM,CAAC;IAChC,KAAK,MAAMF,IAAI,IAAIC,KAAK,EAAE;MACxB,IAAI,CAACzB,SAAS,CAAC2B,GAAG,CAACH,IAAI,CAAC,EAAE;QACxB5B,MAAM,CAAC,aAAa4B,IAAI,aAAa,EAAE,IAAI,EAAED,GAAG,CAAC;MACnD;IACF;EACF;AACF,CAAC,EAAE;EACDqB,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,gGAAgG;MAC7GC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,EAAE;IACVxC,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAyC,MAAA,CAAA5D,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
10
|
+
context,
|
|
11
|
+
jsdocNode,
|
|
12
|
+
sourceCode,
|
|
13
|
+
report,
|
|
14
|
+
utils
|
|
15
|
+
}) => {
|
|
16
|
+
var _tokenBefore$loc, _jsdocNode$loc;
|
|
17
|
+
const {
|
|
18
|
+
lines = 1,
|
|
19
|
+
ignoreSameLine = true,
|
|
20
|
+
excludedTags = ['type']
|
|
21
|
+
} = context.options[0] || {};
|
|
22
|
+
if (utils.hasATag(excludedTags)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const tokensBefore = sourceCode.getTokensBefore(jsdocNode, {
|
|
26
|
+
includeComments: true
|
|
27
|
+
});
|
|
28
|
+
const tokenBefore = tokensBefore.slice(-1)[0];
|
|
29
|
+
if (!tokenBefore) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (((_tokenBefore$loc = tokenBefore.loc) === null || _tokenBefore$loc === void 0 || (_tokenBefore$loc = _tokenBefore$loc.end) === null || _tokenBefore$loc === void 0 ? void 0 : _tokenBefore$loc.line) + lines >= ( /** @type {number} */(_jsdocNode$loc = jsdocNode.loc) === null || _jsdocNode$loc === void 0 || (_jsdocNode$loc = _jsdocNode$loc.start) === null || _jsdocNode$loc === void 0 ? void 0 : _jsdocNode$loc.line)) {
|
|
33
|
+
var _jsdocNode$loc2, _tokenBefore$loc2;
|
|
34
|
+
const startLine = (_jsdocNode$loc2 = jsdocNode.loc) === null || _jsdocNode$loc2 === void 0 || (_jsdocNode$loc2 = _jsdocNode$loc2.start) === null || _jsdocNode$loc2 === void 0 ? void 0 : _jsdocNode$loc2.line;
|
|
35
|
+
const sameLine = ((_tokenBefore$loc2 = tokenBefore.loc) === null || _tokenBefore$loc2 === void 0 || (_tokenBefore$loc2 = _tokenBefore$loc2.end) === null || _tokenBefore$loc2 === void 0 ? void 0 : _tokenBefore$loc2.line) === startLine;
|
|
36
|
+
if (sameLine && ignoreSameLine) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** @type {import('eslint').Rule.ReportFixer} */
|
|
41
|
+
const fix = fixer => {
|
|
42
|
+
let indent = '';
|
|
43
|
+
if (sameLine) {
|
|
44
|
+
var _jsdocNode$loc3, _tokenBefore$loc3, _jsdocNode$value$matc;
|
|
45
|
+
const spaceDiff = /** @type {number} */((_jsdocNode$loc3 = jsdocNode.loc) === null || _jsdocNode$loc3 === void 0 || (_jsdocNode$loc3 = _jsdocNode$loc3.start) === null || _jsdocNode$loc3 === void 0 ? void 0 : _jsdocNode$loc3.column) - ( /** @type {number} */(_tokenBefore$loc3 = tokenBefore.loc) === null || _tokenBefore$loc3 === void 0 || (_tokenBefore$loc3 = _tokenBefore$loc3.end) === null || _tokenBefore$loc3 === void 0 ? void 0 : _tokenBefore$loc3.column);
|
|
46
|
+
// @ts-expect-error Should be a comment
|
|
47
|
+
indent = /** @type {import('estree').Comment} */(_jsdocNode$value$matc = jsdocNode.value.match(/^\*\n([ \t]*) \*/)) === null || _jsdocNode$value$matc === void 0 || (_jsdocNode$value$matc = _jsdocNode$value$matc[1]) === null || _jsdocNode$value$matc === void 0 ? void 0 : _jsdocNode$value$matc.slice(spaceDiff);
|
|
48
|
+
if (!indent) {
|
|
49
|
+
/** @type {import('eslint').AST.Token|import('estree').Comment|undefined} */
|
|
50
|
+
let tokenPrior = tokenBefore;
|
|
51
|
+
let startColumn;
|
|
52
|
+
while (tokenPrior && ((_tokenPrior = tokenPrior) === null || _tokenPrior === void 0 || (_tokenPrior = _tokenPrior.loc) === null || _tokenPrior === void 0 || (_tokenPrior = _tokenPrior.start) === null || _tokenPrior === void 0 ? void 0 : _tokenPrior.line) === startLine) {
|
|
53
|
+
var _tokenPrior, _tokenPrior$loc;
|
|
54
|
+
startColumn = (_tokenPrior$loc = tokenPrior.loc) === null || _tokenPrior$loc === void 0 || (_tokenPrior$loc = _tokenPrior$loc.start) === null || _tokenPrior$loc === void 0 ? void 0 : _tokenPrior$loc.column;
|
|
55
|
+
tokenPrior = tokensBefore.pop();
|
|
56
|
+
}
|
|
57
|
+
indent = ' '.repeat( /* c8 ignore next */
|
|
58
|
+
/** @type {number} */startColumn ? startColumn - 1 : 0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return fixer.insertTextAfter( /** @type {import('eslint').AST.Token} */
|
|
62
|
+
tokenBefore, '\n'.repeat(lines) + (sameLine ? '\n' + indent : ''));
|
|
63
|
+
};
|
|
64
|
+
report(`Required ${lines} line(s) before JSDoc block`, fix);
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
iterateAllJsdocs: true,
|
|
68
|
+
meta: {
|
|
69
|
+
fixable: 'code',
|
|
70
|
+
docs: {
|
|
71
|
+
description: 'Enforces minimum number of newlines before JSDoc comment blocks',
|
|
72
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header'
|
|
73
|
+
},
|
|
74
|
+
schema: [{
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
properties: {
|
|
77
|
+
excludedTags: {
|
|
78
|
+
type: 'array',
|
|
79
|
+
items: {
|
|
80
|
+
type: 'string'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
ignoreSameLine: {
|
|
84
|
+
type: 'boolean'
|
|
85
|
+
},
|
|
86
|
+
lines: {
|
|
87
|
+
type: 'integer'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
type: 'object'
|
|
91
|
+
}],
|
|
92
|
+
type: 'suggestion'
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
module.exports = exports.default;
|
|
96
|
+
//# sourceMappingURL=linesBeforeBlock.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linesBeforeBlock.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdocNode","sourceCode","report","utils","_tokenBefore$loc","_jsdocNode$loc","lines","ignoreSameLine","excludedTags","options","hasATag","tokensBefore","getTokensBefore","includeComments","tokenBefore","slice","loc","end","line","start","_jsdocNode$loc2","_tokenBefore$loc2","startLine","sameLine","fix","fixer","indent","_jsdocNode$loc3","_tokenBefore$loc3","_jsdocNode$value$matc","spaceDiff","column","value","match","tokenPrior","startColumn","_tokenPrior","_tokenPrior$loc","pop","repeat","insertTextAfter","iterateAllJsdocs","meta","fixable","docs","description","url","schema","additionalProperties","properties","type","items","module"],"sources":["../../src/rules/linesBeforeBlock.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdocNode,\n sourceCode,\n report,\n utils,\n}) => {\n const {\n lines = 1,\n ignoreSameLine = true,\n excludedTags = ['type']\n } = context.options[0] || {};\n\n if (utils.hasATag(excludedTags)) {\n return;\n }\n\n const tokensBefore = sourceCode.getTokensBefore(jsdocNode, {includeComments: true});\n const tokenBefore = tokensBefore.slice(-1)[0];\n if (!tokenBefore) {\n return;\n }\n\n if (tokenBefore.loc?.end?.line + lines >=\n /** @type {number} */\n (jsdocNode.loc?.start?.line)\n ) {\n const startLine = jsdocNode.loc?.start?.line;\n const sameLine = tokenBefore.loc?.end?.line === startLine;\n\n if (sameLine && ignoreSameLine) {\n return;\n }\n\n /** @type {import('eslint').Rule.ReportFixer} */\n const fix = (fixer) => {\n let indent = '';\n if (sameLine) {\n const spaceDiff = /** @type {number} */ (jsdocNode.loc?.start?.column) -\n /** @type {number} */ (tokenBefore.loc?.end?.column);\n // @ts-expect-error Should be a comment\n indent = /** @type {import('estree').Comment} */ (\n jsdocNode\n ).value.match(/^\\*\\n([ \\t]*) \\*/)?.[1]?.slice(spaceDiff);\n if (!indent) {\n /** @type {import('eslint').AST.Token|import('estree').Comment|undefined} */\n let tokenPrior = tokenBefore;\n let startColumn;\n while (tokenPrior && tokenPrior?.loc?.start?.line === startLine) {\n startColumn = tokenPrior.loc?.start?.column;\n tokenPrior = tokensBefore.pop();\n }\n indent = ' '.repeat(\n /* c8 ignore next */\n /** @type {number} */ (startColumn ? startColumn - 1 : 0)\n );\n }\n }\n\n return fixer.insertTextAfter(\n /** @type {import('eslint').AST.Token} */\n (tokenBefore),\n '\\n'.repeat(lines) +\n (sameLine ? '\\n' + indent : '')\n );\n };\n report(`Required ${lines} line(s) before JSDoc block`, fix);\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n fixable: 'code',\n docs: {\n description: 'Enforces minimum number of newlines before JSDoc comment blocks',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n excludedTags: {\n type: 'array',\n items: {\n type: 'string'\n }\n },\n ignoreSameLine: {\n type: 'boolean',\n },\n lines: {\n type: 'integer'\n }\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,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,SAAS;EACTC,UAAU;EACVC,MAAM;EACNC;AACF,CAAC,KAAK;EAAA,IAAAC,gBAAA,EAAAC,cAAA;EACJ,MAAM;IACJC,KAAK,GAAG,CAAC;IACTC,cAAc,GAAG,IAAI;IACrBC,YAAY,GAAG,CAAC,MAAM;EACxB,CAAC,GAAGT,OAAO,CAACU,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,IAAIN,KAAK,CAACO,OAAO,CAACF,YAAY,CAAC,EAAE;IAC/B;EACF;EAEA,MAAMG,YAAY,GAAGV,UAAU,CAACW,eAAe,CAACZ,SAAS,EAAE;IAACa,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IACH,CAAC;IACDxB,MAAM,CAAC,YAAYI,KAAK,6BAA6B,EAAEkB,GAAG,CAAC;EAC7D;AACF,CAAC,EAAE;EACDiB,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,OAAO,EAAE,MAAM;IACfC,IAAI,EAAE;MACJC,WAAW,EAAE,iEAAiE;MAC9EC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVzC,YAAY,EAAE;UACZ0C,IAAI,EAAE,OAAO;UACbC,KAAK,EAAE;YACLD,IAAI,EAAE;UACR;QACF,CAAC;QACD3C,cAAc,EAAE;UACd2C,IAAI,EAAE;QACR,CAAC;QACD5C,KAAK,EAAE;UACL4C,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAE,MAAA,CAAAvD,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import emptyTags from './rules/emptyTags.js';
|
|
|
15
15
|
import implementsOnClasses from './rules/implementsOnClasses.js';
|
|
16
16
|
import importsAsDependencies from './rules/importsAsDependencies.js';
|
|
17
17
|
import informativeDocs from './rules/informativeDocs.js';
|
|
18
|
+
import linesBeforeBlock from './rules/linesBeforeBlock.js';
|
|
18
19
|
import matchDescription from './rules/matchDescription.js';
|
|
19
20
|
import matchName from './rules/matchName.js';
|
|
20
21
|
import multilineBlocks from './rules/multilineBlocks.js';
|
|
@@ -92,6 +93,7 @@ const index = {
|
|
|
92
93
|
'implements-on-classes': implementsOnClasses,
|
|
93
94
|
'imports-as-dependencies': importsAsDependencies,
|
|
94
95
|
'informative-docs': informativeDocs,
|
|
96
|
+
'lines-before-block': linesBeforeBlock,
|
|
95
97
|
'match-description': matchDescription,
|
|
96
98
|
'match-name': matchName,
|
|
97
99
|
'multiline-blocks': multilineBlocks,
|
|
@@ -167,6 +169,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
167
169
|
'jsdoc/implements-on-classes': warnOrError,
|
|
168
170
|
'jsdoc/imports-as-dependencies': 'off',
|
|
169
171
|
'jsdoc/informative-docs': 'off',
|
|
172
|
+
'jsdoc/lines-before-block': warnOrError,
|
|
170
173
|
'jsdoc/match-description': 'off',
|
|
171
174
|
'jsdoc/match-name': 'off',
|
|
172
175
|
'jsdoc/multiline-blocks': warnOrError,
|
|
@@ -164,7 +164,7 @@ export default iterateJsdoc(({
|
|
|
164
164
|
meta: {
|
|
165
165
|
docs: {
|
|
166
166
|
description: 'Checks that any `@template` names are actually used in the connected `@typedef` or type alias.',
|
|
167
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/
|
|
167
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-template-names.md#repos-sticky-header',
|
|
168
168
|
},
|
|
169
169
|
schema: [],
|
|
170
170
|
type: 'suggestion',
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import iterateJsdoc from '../iterateJsdoc.js';
|
|
2
|
+
|
|
3
|
+
export default iterateJsdoc(({
|
|
4
|
+
context,
|
|
5
|
+
jsdocNode,
|
|
6
|
+
sourceCode,
|
|
7
|
+
report,
|
|
8
|
+
utils,
|
|
9
|
+
}) => {
|
|
10
|
+
const {
|
|
11
|
+
lines = 1,
|
|
12
|
+
ignoreSameLine = true,
|
|
13
|
+
excludedTags = ['type']
|
|
14
|
+
} = context.options[0] || {};
|
|
15
|
+
|
|
16
|
+
if (utils.hasATag(excludedTags)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const tokensBefore = sourceCode.getTokensBefore(jsdocNode, {includeComments: true});
|
|
21
|
+
const tokenBefore = tokensBefore.slice(-1)[0];
|
|
22
|
+
if (!tokenBefore) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (tokenBefore.loc?.end?.line + lines >=
|
|
27
|
+
/** @type {number} */
|
|
28
|
+
(jsdocNode.loc?.start?.line)
|
|
29
|
+
) {
|
|
30
|
+
const startLine = jsdocNode.loc?.start?.line;
|
|
31
|
+
const sameLine = tokenBefore.loc?.end?.line === startLine;
|
|
32
|
+
|
|
33
|
+
if (sameLine && ignoreSameLine) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @type {import('eslint').Rule.ReportFixer} */
|
|
38
|
+
const fix = (fixer) => {
|
|
39
|
+
let indent = '';
|
|
40
|
+
if (sameLine) {
|
|
41
|
+
const spaceDiff = /** @type {number} */ (jsdocNode.loc?.start?.column) -
|
|
42
|
+
/** @type {number} */ (tokenBefore.loc?.end?.column);
|
|
43
|
+
// @ts-expect-error Should be a comment
|
|
44
|
+
indent = /** @type {import('estree').Comment} */ (
|
|
45
|
+
jsdocNode
|
|
46
|
+
).value.match(/^\*\n([ \t]*) \*/)?.[1]?.slice(spaceDiff);
|
|
47
|
+
if (!indent) {
|
|
48
|
+
/** @type {import('eslint').AST.Token|import('estree').Comment|undefined} */
|
|
49
|
+
let tokenPrior = tokenBefore;
|
|
50
|
+
let startColumn;
|
|
51
|
+
while (tokenPrior && tokenPrior?.loc?.start?.line === startLine) {
|
|
52
|
+
startColumn = tokenPrior.loc?.start?.column;
|
|
53
|
+
tokenPrior = tokensBefore.pop();
|
|
54
|
+
}
|
|
55
|
+
indent = ' '.repeat(
|
|
56
|
+
/* c8 ignore next */
|
|
57
|
+
/** @type {number} */ (startColumn ? startColumn - 1 : 0)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return fixer.insertTextAfter(
|
|
63
|
+
/** @type {import('eslint').AST.Token} */
|
|
64
|
+
(tokenBefore),
|
|
65
|
+
'\n'.repeat(lines) +
|
|
66
|
+
(sameLine ? '\n' + indent : '')
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
report(`Required ${lines} line(s) before JSDoc block`, fix);
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
iterateAllJsdocs: true,
|
|
73
|
+
meta: {
|
|
74
|
+
fixable: 'code',
|
|
75
|
+
docs: {
|
|
76
|
+
description: 'Enforces minimum number of newlines before JSDoc comment blocks',
|
|
77
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header',
|
|
78
|
+
},
|
|
79
|
+
schema: [
|
|
80
|
+
{
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
properties: {
|
|
83
|
+
excludedTags: {
|
|
84
|
+
type: 'array',
|
|
85
|
+
items: {
|
|
86
|
+
type: 'string'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
ignoreSameLine: {
|
|
90
|
+
type: 'boolean',
|
|
91
|
+
},
|
|
92
|
+
lines: {
|
|
93
|
+
type: 'integer'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
type: 'object',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
type: 'suggestion',
|
|
100
|
+
},
|
|
101
|
+
});
|