eslint-plugin-jsdoc 41.1.2 → 42.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 +313 -448
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/rules/tagLines.js +92 -16
- package/dist/rules/tagLines.js.map +1 -1
- package/package.json +1 -1
- package/dist/rules/newlineAfterDescription.js +0 -71
- package/dist/rules/newlineAfterDescription.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var _informativeDocs = _interopRequireDefault(require("./rules/informativeDocs")
|
|
|
21
21
|
var _matchDescription = _interopRequireDefault(require("./rules/matchDescription"));
|
|
22
22
|
var _matchName = _interopRequireDefault(require("./rules/matchName"));
|
|
23
23
|
var _multilineBlocks = _interopRequireDefault(require("./rules/multilineBlocks"));
|
|
24
|
-
var _newlineAfterDescription = _interopRequireDefault(require("./rules/newlineAfterDescription"));
|
|
25
24
|
var _noBadBlocks = _interopRequireDefault(require("./rules/noBadBlocks"));
|
|
26
25
|
var _noBlankBlockDescriptions = _interopRequireDefault(require("./rules/noBlankBlockDescriptions"));
|
|
27
26
|
var _noDefaults = _interopRequireDefault(require("./rules/noDefaults"));
|
|
@@ -77,7 +76,6 @@ const index = {
|
|
|
77
76
|
'match-description': _matchDescription.default,
|
|
78
77
|
'match-name': _matchName.default,
|
|
79
78
|
'multiline-blocks': _multilineBlocks.default,
|
|
80
|
-
'newline-after-description': _newlineAfterDescription.default,
|
|
81
79
|
'no-bad-blocks': _noBadBlocks.default,
|
|
82
80
|
'no-blank-block-descriptions': _noBlankBlockDescriptions.default,
|
|
83
81
|
'no-defaults': _noDefaults.default,
|
|
@@ -135,7 +133,6 @@ const createRecommendedRuleset = warnOrError => {
|
|
|
135
133
|
'jsdoc/match-description': 'off',
|
|
136
134
|
'jsdoc/match-name': 'off',
|
|
137
135
|
'jsdoc/multiline-blocks': warnOrError,
|
|
138
|
-
'jsdoc/newline-after-description': warnOrError,
|
|
139
136
|
'jsdoc/no-bad-blocks': 'off',
|
|
140
137
|
'jsdoc/no-blank-block-descriptions': 'off',
|
|
141
138
|
'jsdoc/no-defaults': 'off',
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTypes","_checkValues","_emptyTags","_implementsOnClasses","_informativeDocs","_matchDescription","_matchName","_multilineBlocks","_newlineAfterDescription","_noBadBlocks","_noBlankBlockDescriptions","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","informativeDocs","matchDescription","matchName","multilineBlocks","newlineAfterDescription","noBadBlocks","noBlankBlockDescriptions","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess';\nimport checkAlignment from './rules/checkAlignment';\nimport checkExamples from './rules/checkExamples';\nimport checkIndentation from './rules/checkIndentation';\nimport checkLineAlignment from './rules/checkLineAlignment';\nimport checkParamNames from './rules/checkParamNames';\nimport checkPropertyNames from './rules/checkPropertyNames';\nimport checkSyntax from './rules/checkSyntax';\nimport checkTagNames from './rules/checkTagNames';\nimport checkTypes from './rules/checkTypes';\nimport checkValues from './rules/checkValues';\nimport emptyTags from './rules/emptyTags';\nimport implementsOnClasses from './rules/implementsOnClasses';\nimport informativeDocs from './rules/informativeDocs';\nimport matchDescription from './rules/matchDescription';\nimport matchName from './rules/matchName';\nimport multilineBlocks from './rules/multilineBlocks';\nimport newlineAfterDescription from './rules/newlineAfterDescription';\nimport noBadBlocks from './rules/noBadBlocks';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions';\nimport noDefaults from './rules/noDefaults';\nimport noMissingSyntax from './rules/noMissingSyntax';\nimport noMultiAsterisks from './rules/noMultiAsterisks';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax';\nimport noTypes from './rules/noTypes';\nimport noUndefinedTypes from './rules/noUndefinedTypes';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix';\nimport requireDescription from './rules/requireDescription';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence';\nimport requireExample from './rules/requireExample';\nimport requireFileOverview from './rules/requireFileOverview';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription';\nimport requireJsdoc from './rules/requireJsdoc';\nimport requireParam from './rules/requireParam';\nimport requireParamDescription from './rules/requireParamDescription';\nimport requireParamName from './rules/requireParamName';\nimport requireParamType from './rules/requireParamType';\nimport requireProperty from './rules/requireProperty';\nimport requirePropertyDescription from './rules/requirePropertyDescription';\nimport requirePropertyName from './rules/requirePropertyName';\nimport requirePropertyType from './rules/requirePropertyType';\nimport requireReturns from './rules/requireReturns';\nimport requireReturnsCheck from './rules/requireReturnsCheck';\nimport requireReturnsDescription from './rules/requireReturnsDescription';\nimport requireReturnsType from './rules/requireReturnsType';\nimport requireThrows from './rules/requireThrows';\nimport requireYields from './rules/requireYields';\nimport requireYieldsCheck from './rules/requireYieldsCheck';\nimport sortTags from './rules/sortTags';\nimport tagLines from './rules/tagLines';\nimport textEscaping from './rules/textEscaping';\nimport validTypes from './rules/validTypes';\n\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'informative-docs': informativeDocs,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'newline-after-description': newlineAfterDescription,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\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\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/newline-after-description': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-defaults': 'off',\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\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable indent */\n },\n };\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');\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,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GAAGyD,kCAAkC,CAAC,MAAM,CAAC;AACpF1D,KAAK,CAACC,OAAO,CAAC,8BAA8B,CAAC,GAAGyD,kCAAkC,CAAC,OAAO,CAAC;AAAC,IAAAI,QAAA,GAE7E9D,KAAK;AAAA+D,OAAA,CAAAhE,OAAA,GAAA+D,QAAA;AAAAE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAhE,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_checkAccess","_interopRequireDefault","require","_checkAlignment","_checkExamples","_checkIndentation","_checkLineAlignment","_checkParamNames","_checkPropertyNames","_checkSyntax","_checkTagNames","_checkTypes","_checkValues","_emptyTags","_implementsOnClasses","_informativeDocs","_matchDescription","_matchName","_multilineBlocks","_noBadBlocks","_noBlankBlockDescriptions","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","informativeDocs","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess';\nimport checkAlignment from './rules/checkAlignment';\nimport checkExamples from './rules/checkExamples';\nimport checkIndentation from './rules/checkIndentation';\nimport checkLineAlignment from './rules/checkLineAlignment';\nimport checkParamNames from './rules/checkParamNames';\nimport checkPropertyNames from './rules/checkPropertyNames';\nimport checkSyntax from './rules/checkSyntax';\nimport checkTagNames from './rules/checkTagNames';\nimport checkTypes from './rules/checkTypes';\nimport checkValues from './rules/checkValues';\nimport emptyTags from './rules/emptyTags';\nimport implementsOnClasses from './rules/implementsOnClasses';\nimport informativeDocs from './rules/informativeDocs';\nimport matchDescription from './rules/matchDescription';\nimport matchName from './rules/matchName';\nimport multilineBlocks from './rules/multilineBlocks';\nimport noBadBlocks from './rules/noBadBlocks';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions';\nimport noDefaults from './rules/noDefaults';\nimport noMissingSyntax from './rules/noMissingSyntax';\nimport noMultiAsterisks from './rules/noMultiAsterisks';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax';\nimport noTypes from './rules/noTypes';\nimport noUndefinedTypes from './rules/noUndefinedTypes';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix';\nimport requireDescription from './rules/requireDescription';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence';\nimport requireExample from './rules/requireExample';\nimport requireFileOverview from './rules/requireFileOverview';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription';\nimport requireJsdoc from './rules/requireJsdoc';\nimport requireParam from './rules/requireParam';\nimport requireParamDescription from './rules/requireParamDescription';\nimport requireParamName from './rules/requireParamName';\nimport requireParamType from './rules/requireParamType';\nimport requireProperty from './rules/requireProperty';\nimport requirePropertyDescription from './rules/requirePropertyDescription';\nimport requirePropertyName from './rules/requirePropertyName';\nimport requirePropertyType from './rules/requirePropertyType';\nimport requireReturns from './rules/requireReturns';\nimport requireReturnsCheck from './rules/requireReturnsCheck';\nimport requireReturnsDescription from './rules/requireReturnsDescription';\nimport requireReturnsType from './rules/requireReturnsType';\nimport requireThrows from './rules/requireThrows';\nimport requireYields from './rules/requireYields';\nimport requireYieldsCheck from './rules/requireYieldsCheck';\nimport sortTags from './rules/sortTags';\nimport tagLines from './rules/tagLines';\nimport textEscaping from './rules/textEscaping';\nimport validTypes from './rules/validTypes';\n\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n '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-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\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/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-defaults': 'off',\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\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable indent */\n },\n };\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');\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,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AA,GAE7E7D,KAAK;AAAA8D,OAAA,CAAA/D,OAAA,GAAA8D,QAAA;AAAAE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA/D,OAAA"}
|
package/dist/rules/tagLines.js
CHANGED
|
@@ -13,14 +13,18 @@ var _default = (0, _iterateJsdoc.default)(({
|
|
|
13
13
|
}) => {
|
|
14
14
|
const [alwaysNever = 'never', {
|
|
15
15
|
count = 1,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
endLines = 0,
|
|
17
|
+
startLines = 0,
|
|
18
|
+
applyToEndTag = true,
|
|
18
19
|
tags = {}
|
|
19
20
|
} = {}] = context.options;
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line complexity -- Temporary
|
|
20
23
|
jsdoc.tags.some((tg, tagIdx) => {
|
|
21
24
|
let lastTag;
|
|
22
25
|
let lastEmpty = null;
|
|
23
26
|
let reportIndex = null;
|
|
27
|
+
let emptyLinesCount = 0;
|
|
24
28
|
for (const [idx, {
|
|
25
29
|
tokens: {
|
|
26
30
|
tag,
|
|
@@ -44,19 +48,34 @@ var _default = (0, _iterateJsdoc.default)(({
|
|
|
44
48
|
continue;
|
|
45
49
|
}
|
|
46
50
|
if (!end) {
|
|
51
|
+
if (empty) {
|
|
52
|
+
emptyLinesCount++;
|
|
53
|
+
} else {
|
|
54
|
+
emptyLinesCount = 0;
|
|
55
|
+
}
|
|
47
56
|
lastEmpty = empty ? idx : null;
|
|
48
57
|
}
|
|
49
58
|
lastTag = tag;
|
|
50
59
|
}
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
if (typeof endLines === 'number' && lastEmpty !== null && tagIdx === jsdoc.tags.length - 1) {
|
|
61
|
+
const lineDiff = endLines - emptyLinesCount;
|
|
62
|
+
if (lineDiff < 0) {
|
|
63
|
+
const fixer = () => {
|
|
64
|
+
utils.removeTag(tagIdx, {
|
|
65
|
+
tagSourceOffset: lastEmpty + lineDiff + 1
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
utils.reportJSDoc(`Expected ${endLines} trailing lines`, {
|
|
69
|
+
line: tg.source[lastEmpty].number + lineDiff + 1
|
|
70
|
+
}, fixer);
|
|
71
|
+
} else if (lineDiff > 0) {
|
|
72
|
+
const fixer = () => {
|
|
73
|
+
utils.addLines(tagIdx, lastEmpty, endLines - emptyLinesCount);
|
|
74
|
+
};
|
|
75
|
+
utils.reportJSDoc(`Expected ${endLines} trailing lines`, {
|
|
76
|
+
line: tg.source[lastEmpty].number
|
|
77
|
+
}, fixer);
|
|
78
|
+
}
|
|
60
79
|
return true;
|
|
61
80
|
}
|
|
62
81
|
if (reportIndex !== null) {
|
|
@@ -72,7 +91,7 @@ var _default = (0, _iterateJsdoc.default)(({
|
|
|
72
91
|
}
|
|
73
92
|
return false;
|
|
74
93
|
});
|
|
75
|
-
(
|
|
94
|
+
(applyToEndTag ? jsdoc.tags : jsdoc.tags.slice(0, -1)).some((tg, tagIdx) => {
|
|
76
95
|
const lines = [];
|
|
77
96
|
let currentTag;
|
|
78
97
|
let tagSourceIdx = 0;
|
|
@@ -123,6 +142,52 @@ var _default = (0, _iterateJsdoc.default)(({
|
|
|
123
142
|
}
|
|
124
143
|
return false;
|
|
125
144
|
});
|
|
145
|
+
if (typeof startLines === 'number') {
|
|
146
|
+
var _description$match, _description$match$;
|
|
147
|
+
const {
|
|
148
|
+
description,
|
|
149
|
+
lastDescriptionLine
|
|
150
|
+
} = utils.getDescription();
|
|
151
|
+
const trailingLines = (_description$match = description.match(/\n+$/u)) === null || _description$match === void 0 ? void 0 : (_description$match$ = _description$match[0]) === null || _description$match$ === void 0 ? void 0 : _description$match$.length;
|
|
152
|
+
const trailingDiff = (trailingLines ?? 0) - startLines;
|
|
153
|
+
if (trailingDiff > 0) {
|
|
154
|
+
utils.reportJSDoc(`Expected only ${startLines} line after block description`, {
|
|
155
|
+
line: lastDescriptionLine - trailingDiff
|
|
156
|
+
}, () => {
|
|
157
|
+
utils.setBlockDescription((info, seedTokens, descLines) => {
|
|
158
|
+
return descLines.slice(0, -trailingDiff).map(desc => {
|
|
159
|
+
return {
|
|
160
|
+
tokens: seedTokens({
|
|
161
|
+
...info,
|
|
162
|
+
description: desc,
|
|
163
|
+
postDelimiter: desc.trim() ? info.postDelimiter : ''
|
|
164
|
+
})
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
} else if (trailingDiff < 0) {
|
|
170
|
+
utils.reportJSDoc(`Expected ${startLines} lines after block description`, {
|
|
171
|
+
line: lastDescriptionLine
|
|
172
|
+
}, () => {
|
|
173
|
+
utils.setBlockDescription((info, seedTokens, descLines) => {
|
|
174
|
+
return [...descLines, ...Array.from({
|
|
175
|
+
length: -trailingDiff
|
|
176
|
+
}, () => {
|
|
177
|
+
return '';
|
|
178
|
+
})].map(desc => {
|
|
179
|
+
return {
|
|
180
|
+
tokens: seedTokens({
|
|
181
|
+
...info,
|
|
182
|
+
description: desc,
|
|
183
|
+
postDelimiter: desc.trim() ? info.postDelimiter : ''
|
|
184
|
+
})
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
126
191
|
}, {
|
|
127
192
|
iterateAllJsdocs: true,
|
|
128
193
|
meta: {
|
|
@@ -137,14 +202,25 @@ var _default = (0, _iterateJsdoc.default)(({
|
|
|
137
202
|
}, {
|
|
138
203
|
additionalProperties: false,
|
|
139
204
|
properties: {
|
|
205
|
+
applyToEndTag: {
|
|
206
|
+
type: 'boolean'
|
|
207
|
+
},
|
|
140
208
|
count: {
|
|
141
209
|
type: 'integer'
|
|
142
210
|
},
|
|
143
|
-
|
|
144
|
-
|
|
211
|
+
endLines: {
|
|
212
|
+
anyOf: [{
|
|
213
|
+
type: 'integer'
|
|
214
|
+
}, {
|
|
215
|
+
type: 'null'
|
|
216
|
+
}]
|
|
145
217
|
},
|
|
146
|
-
|
|
147
|
-
|
|
218
|
+
startLines: {
|
|
219
|
+
anyOf: [{
|
|
220
|
+
type: 'integer'
|
|
221
|
+
}, {
|
|
222
|
+
type: 'null'
|
|
223
|
+
}]
|
|
148
224
|
},
|
|
149
225
|
tags: {
|
|
150
226
|
patternProperties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagLines.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","alwaysNever","count","dropEndLines","noEndLines","tags","options","some","tg","tagIdx","lastTag","lastEmpty","reportIndex","idx","tokens","tag","name","type","description","end","source","entries","_tags$lastTag$slice","_tags$lastTag$slice2","includes","slice","lines","empty","length","fixer","removeTag","tagSourceOffset","reportJSDoc","line","number","currentTag","tagSourceIdx","splice","push","currentTg","tagCount","defaultAlways","overrideAlways","fixCount","_lines2","_lines","addLines","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","patternProperties","exports","module"],"sources":["../../src/rules/tagLines.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n alwaysNever = 'never',\n {\n count = 1,\n dropEndLines = false,\n noEndLines = false,\n tags = {},\n } = {},\n ] = context.options;\n\n jsdoc.tags.some((tg, tagIdx) => {\n let lastTag;\n let lastEmpty = null;\n\n let reportIndex = null;\n for (const [\n idx,\n {\n tokens: {\n tag,\n name,\n type,\n description,\n end,\n },\n },\n ] of tg.source.entries()) {\n // May be text after a line break within a tag description\n if (description) {\n reportIndex = null;\n }\n\n if (lastTag && [\n 'any', 'always',\n ].includes(tags[lastTag.slice(1)]?.lines)) {\n continue;\n }\n\n const empty = !tag && !name && !type && !description;\n if (\n empty && !end &&\n (alwaysNever === 'never' ||\n lastTag && tags[lastTag.slice(1)]?.lines === 'never'\n )\n ) {\n reportIndex = idx;\n\n continue;\n }\n\n if (!end) {\n lastEmpty = empty ? idx : null;\n }\n\n lastTag = tag;\n }\n\n if (dropEndLines && lastEmpty !== null && tagIdx === jsdoc.tags.length - 1) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: lastEmpty,\n });\n };\n\n utils.reportJSDoc(\n 'Expected no trailing lines',\n {\n line: tg.source[lastEmpty].number,\n },\n fixer,\n );\n\n return true;\n }\n\n if (reportIndex !== null) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: reportIndex,\n });\n };\n\n utils.reportJSDoc(\n 'Expected no lines between tags',\n {\n line: tg.source[0].number + 1,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n (noEndLines ? jsdoc.tags.slice(0, -1) : jsdoc.tags).some((tg, tagIdx) => {\n const lines = [];\n\n let currentTag;\n let tagSourceIdx = 0;\n for (const [\n idx,\n {\n number,\n tokens: {\n tag,\n name,\n type,\n description,\n end,\n },\n },\n ] of tg.source.entries()) {\n if (description) {\n lines.splice(0, lines.length);\n tagSourceIdx = idx;\n }\n\n if (tag) {\n currentTag = tag;\n }\n\n if (!tag && !name && !type && !description && !end) {\n lines.push({\n idx,\n number,\n });\n }\n }\n\n const currentTg = currentTag && tags[currentTag.slice(1)];\n const tagCount = currentTg?.count;\n\n const defaultAlways = alwaysNever === 'always' && currentTg?.lines !== 'never' &&\n currentTg?.lines !== 'any' && lines.length < count;\n\n let overrideAlways;\n let fixCount = count;\n if (!defaultAlways) {\n fixCount = typeof tagCount === 'number' ? tagCount : count;\n overrideAlways = currentTg?.lines === 'always' &&\n lines.length < fixCount;\n }\n\n if (defaultAlways || overrideAlways) {\n const fixer = () => {\n utils.addLines(tagIdx, lines[lines.length - 1]?.idx || tagSourceIdx + 1, fixCount - lines.length);\n };\n\n const line = lines[lines.length - 1]?.number || tg.source[tagSourceIdx].number;\n utils.reportJSDoc(\n `Expected ${fixCount} line${fixCount === 1 ? '' : 's'} between tags but found ${lines.length}`,\n {\n line,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces lines (or no lines) between tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines',\n },\n fixable: 'code',\n schema: [\n {\n enum: [\n 'always', 'any', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n count: {\n type: 'integer',\n },\n dropEndLines: {\n type: 'boolean',\n },\n noEndLines: {\n type: 'boolean',\n },\n tags: {\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n count: {\n type: 'integer',\n },\n lines: {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n },\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM,CACJC,WAAW,GAAG,OAAO,EACrB;IACEC,KAAK,GAAG,CAAC;IACTC,YAAY,GAAG,KAAK;IACpBC,UAAU,GAAG,KAAK;IAClBC,IAAI,GAAG,CAAC;EACV,CAAC,GAAG,CAAC,CAAC,CACP,GAAGP,OAAO,CAACQ,OAAO;EAEnBP,KAAK,CAACM,IAAI,CAACE,IAAI,CAAC,CAACC,EAAE,EAAEC,MAAM,KAAK;IAC9B,IAAIC,OAAO;IACX,IAAIC,SAAS,GAAG,IAAI;IAEpB,IAAIC,WAAW,GAAG,IAAI;IACtB,KAAK,MAAM,CACTC,GAAG,EACH;MACEC,MAAM,EAAE;QACNC,G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AAA;AAAA8D,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA9D,OAAA"}
|
|
1
|
+
{"version":3,"file":"tagLines.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","alwaysNever","count","endLines","startLines","applyToEndTag","tags","options","some","tg","tagIdx","lastTag","lastEmpty","reportIndex","emptyLinesCount","idx","tokens","tag","name","type","description","end","source","entries","_tags$lastTag$slice","_tags$lastTag$slice2","includes","slice","lines","empty","length","lineDiff","fixer","removeTag","tagSourceOffset","reportJSDoc","line","number","addLines","currentTag","tagSourceIdx","splice","push","currentTg","tagCount","defaultAlways","overrideAlways","fixCount","_lines2","_lines","_description$match","_description$match$","lastDescriptionLine","getDescription","trailingLines","match","trailingDiff","setBlockDescription","info","seedTokens","descLines","map","desc","postDelimiter","trim","Array","from","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","anyOf","patternProperties","exports","module"],"sources":["../../src/rules/tagLines.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n alwaysNever = 'never',\n {\n count = 1,\n endLines = 0,\n startLines = 0,\n applyToEndTag = true,\n tags = {},\n } = {},\n ] = context.options;\n\n // eslint-disable-next-line complexity -- Temporary\n jsdoc.tags.some((tg, tagIdx) => {\n let lastTag;\n let lastEmpty = null;\n\n let reportIndex = null;\n let emptyLinesCount = 0;\n for (const [\n idx,\n {\n tokens: {\n tag,\n name,\n type,\n description,\n end,\n },\n },\n ] of tg.source.entries()) {\n // May be text after a line break within a tag description\n if (description) {\n reportIndex = null;\n }\n\n if (lastTag && [\n 'any', 'always',\n ].includes(tags[lastTag.slice(1)]?.lines)) {\n continue;\n }\n\n const empty = !tag && !name && !type && !description;\n if (\n empty && !end &&\n (alwaysNever === 'never' ||\n lastTag && tags[lastTag.slice(1)]?.lines === 'never'\n )\n ) {\n reportIndex = idx;\n\n continue;\n }\n\n if (!end) {\n if (empty) {\n emptyLinesCount++;\n } else {\n emptyLinesCount = 0;\n }\n\n lastEmpty = empty ? idx : null;\n }\n\n lastTag = tag;\n }\n\n if (\n typeof endLines === 'number' &&\n lastEmpty !== null && tagIdx === jsdoc.tags.length - 1\n ) {\n const lineDiff = endLines - emptyLinesCount;\n\n if (lineDiff < 0) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: lastEmpty + lineDiff + 1,\n });\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number + lineDiff + 1,\n },\n fixer,\n );\n } else if (lineDiff > 0) {\n const fixer = () => {\n utils.addLines(tagIdx, lastEmpty, endLines - emptyLinesCount);\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number,\n },\n fixer,\n );\n }\n\n return true;\n }\n\n if (reportIndex !== null) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: reportIndex,\n });\n };\n\n utils.reportJSDoc(\n 'Expected no lines between tags',\n {\n line: tg.source[0].number + 1,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n (applyToEndTag ? jsdoc.tags : jsdoc.tags.slice(0, -1)).some((tg, tagIdx) => {\n const lines = [];\n\n let currentTag;\n let tagSourceIdx = 0;\n for (const [\n idx,\n {\n number,\n tokens: {\n tag,\n name,\n type,\n description,\n end,\n },\n },\n ] of tg.source.entries()) {\n if (description) {\n lines.splice(0, lines.length);\n tagSourceIdx = idx;\n }\n\n if (tag) {\n currentTag = tag;\n }\n\n if (!tag && !name && !type && !description && !end) {\n lines.push({\n idx,\n number,\n });\n }\n }\n\n const currentTg = currentTag && tags[currentTag.slice(1)];\n const tagCount = currentTg?.count;\n\n const defaultAlways = alwaysNever === 'always' && currentTg?.lines !== 'never' &&\n currentTg?.lines !== 'any' && lines.length < count;\n\n let overrideAlways;\n let fixCount = count;\n if (!defaultAlways) {\n fixCount = typeof tagCount === 'number' ? tagCount : count;\n overrideAlways = currentTg?.lines === 'always' &&\n lines.length < fixCount;\n }\n\n if (defaultAlways || overrideAlways) {\n const fixer = () => {\n utils.addLines(tagIdx, lines[lines.length - 1]?.idx || tagSourceIdx + 1, fixCount - lines.length);\n };\n\n const line = lines[lines.length - 1]?.number || tg.source[tagSourceIdx].number;\n utils.reportJSDoc(\n `Expected ${fixCount} line${fixCount === 1 ? '' : 's'} between tags but found ${lines.length}`,\n {\n line,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n if (typeof startLines === 'number') {\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n const trailingLines = description.match(/\\n+$/u)?.[0]?.length;\n const trailingDiff = (trailingLines ?? 0) - startLines;\n if (trailingDiff > 0) {\n utils.reportJSDoc(\n `Expected only ${startLines} line after block description`,\n {\n line: lastDescriptionLine - trailingDiff,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return descLines.slice(0, -trailingDiff).map((desc) => {\n return {\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? info.postDelimiter : '',\n }),\n };\n });\n });\n },\n );\n } else if (trailingDiff < 0) {\n utils.reportJSDoc(\n `Expected ${startLines} lines after block description`,\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return [\n ...descLines,\n ...Array.from({\n length: -trailingDiff,\n }, () => {\n return '';\n }),\n ].map((desc) => {\n return {\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? info.postDelimiter : '',\n }),\n };\n });\n });\n },\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces lines (or no lines) between tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines',\n },\n fixable: 'code',\n schema: [\n {\n enum: [\n 'always', 'any', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n applyToEndTag: {\n type: 'boolean',\n },\n count: {\n type: 'integer',\n },\n endLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n },\n startLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n },\n tags: {\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n count: {\n type: 'integer',\n },\n lines: {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n },\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM,CACJC,WAAW,GAAG,OAAO,EACrB;IACEC,KAAK,GAAG,CAAC;IACTC,QAAQ,GAAG,CAAC;IACZC,UAAU,GAAG,CAAC;IACdC,aAAa,GAAG,IAAI;IACpBC,IAAI,GAAG,CAAC;EACV,CAAC,GAAG,CAAC,CAAC,CACP,GAAGR,OAAO,CAACS,OAAO;;EAEnB;EACAR,KAAK,CAACO,IAAI,CAACE,IAAI,CAAC,CAACC,EAAE,EAAEC,MAAM,KAAK;IAC9B,IAAIC,OAAO;IACX,IAAIC,SAAS,GAAG,IAAI;IAEpB,IAAIC,WAAW,GAAG,IAAI;IACtB,IAAIC,eAAe,GAAG,CAAC;IACvB,KAAK,MAAM,CACTC,GAAG,EACH;MACEC,MAAM,EAAE;QACNC,GAAG;QACHC,IAAI;QACJC,IAAI;QACJC,WAAW;QACXC;MACF;IACF,CAAC,CACF,IAAIZ,EAAE,CAACa,MAAM,CAACC,OAAO,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
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = (0, _iterateJsdoc.default)(({
|
|
10
|
-
jsdoc,
|
|
11
|
-
report,
|
|
12
|
-
context,
|
|
13
|
-
jsdocNode,
|
|
14
|
-
sourceCode,
|
|
15
|
-
indent,
|
|
16
|
-
utils
|
|
17
|
-
}) => {
|
|
18
|
-
let always;
|
|
19
|
-
if (!jsdoc.description.trim() || !jsdoc.tags.length) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (0 in context.options) {
|
|
23
|
-
always = context.options[0] === 'always';
|
|
24
|
-
} else {
|
|
25
|
-
always = true;
|
|
26
|
-
}
|
|
27
|
-
const {
|
|
28
|
-
description,
|
|
29
|
-
lastDescriptionLine
|
|
30
|
-
} = utils.getDescription();
|
|
31
|
-
const descriptionEndsWithANewline = /\n\r?$/u.test(description);
|
|
32
|
-
if (always) {
|
|
33
|
-
if (!descriptionEndsWithANewline) {
|
|
34
|
-
const sourceLines = sourceCode.getText(jsdocNode).split('\n');
|
|
35
|
-
report('There must be a newline after the description of the JSDoc block.', fixer => {
|
|
36
|
-
// Add the new line
|
|
37
|
-
const injectedLine = `${indent} *` + (sourceLines[lastDescriptionLine].endsWith('\r') ? '\r' : '');
|
|
38
|
-
sourceLines.splice(lastDescriptionLine + 1, 0, injectedLine);
|
|
39
|
-
return fixer.replaceText(jsdocNode, sourceLines.join('\n'));
|
|
40
|
-
}, {
|
|
41
|
-
line: lastDescriptionLine
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
} else if (descriptionEndsWithANewline) {
|
|
45
|
-
const sourceLines = sourceCode.getText(jsdocNode).split('\n');
|
|
46
|
-
report('There must be no newline after the description of the JSDoc block.', fixer => {
|
|
47
|
-
// Remove the extra line
|
|
48
|
-
sourceLines.splice(lastDescriptionLine, 1);
|
|
49
|
-
return fixer.replaceText(jsdocNode, sourceLines.join('\n'));
|
|
50
|
-
}, {
|
|
51
|
-
line: lastDescriptionLine
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
iterateAllJsdocs: true,
|
|
56
|
-
meta: {
|
|
57
|
-
docs: {
|
|
58
|
-
description: 'Enforces a consistent padding of the block description.',
|
|
59
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description'
|
|
60
|
-
},
|
|
61
|
-
fixable: 'whitespace',
|
|
62
|
-
schema: [{
|
|
63
|
-
enum: ['always', 'never'],
|
|
64
|
-
type: 'string'
|
|
65
|
-
}],
|
|
66
|
-
type: 'layout'
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
exports.default = _default;
|
|
70
|
-
module.exports = exports.default;
|
|
71
|
-
//# sourceMappingURL=newlineAfterDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"newlineAfterDescription.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","jsdoc","report","context","jsdocNode","sourceCode","indent","utils","always","description","trim","tags","length","options","lastDescriptionLine","getDescription","descriptionEndsWithANewline","test","sourceLines","getText","split","fixer","injectedLine","endsWith","splice","replaceText","join","line","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","type","exports","module"],"sources":["../../src/rules/newlineAfterDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n jsdoc,\n report,\n context,\n jsdocNode,\n sourceCode,\n indent,\n utils,\n}) => {\n let always;\n\n if (!jsdoc.description.trim() || !jsdoc.tags.length) {\n return;\n }\n\n if (0 in context.options) {\n always = context.options[0] === 'always';\n } else {\n always = true;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n const descriptionEndsWithANewline = (/\\n\\r?$/u).test(description);\n\n if (always) {\n if (!descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n\n report('There must be a newline after the description of the JSDoc block.', (fixer) => {\n // Add the new line\n const injectedLine = `${indent} *` +\n (sourceLines[lastDescriptionLine].endsWith('\\r') ? '\\r' : '');\n sourceLines.splice(lastDescriptionLine + 1, 0, injectedLine);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n } else if (descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n report('There must be no newline after the description of the JSDoc block.', (fixer) => {\n // Remove the extra line\n sourceLines.splice(lastDescriptionLine, 1);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces a consistent padding of the block description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description',\n },\n fixable: 'whitespace',\n schema: [\n {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC,UAAU;EACVC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,IAAIC,MAAM;EAEV,IAAI,CAACP,KAAK,CAACQ,WAAW,CAACC,IA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