eslint-plugin-jsdoc 44.2.7 → 46.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 +24 -18
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/docs/rules/check-examples.md +1 -1
- package/docs/rules/check-indentation.md +1 -1
- package/docs/rules/check-line-alignment.md +1 -1
- package/docs/rules/check-param-names.md +1 -1
- package/docs/rules/check-types.md +1 -1
- package/docs/rules/check-values.md +1 -1
- package/docs/rules/match-description.md +1 -1
- package/docs/rules/multiline-blocks.md +1 -1
- package/docs/rules/no-multi-asterisks.md +1 -1
- package/docs/rules/no-undefined-types.md +1 -1
- package/docs/rules/require-asterisk-prefix.md +1 -1
- package/docs/rules/require-description-complete-sentence.md +1 -1
- package/docs/rules/require-description.md +1 -1
- package/docs/rules/require-example.md +1 -1
- package/docs/rules/require-hyphen-before-param-description.md +1 -1
- package/docs/rules/require-param-description.md +1 -1
- package/docs/rules/require-param-type.md +1 -1
- package/docs/rules/require-param.md +1 -1
- package/docs/rules/require-returns-check.md +1 -1
- package/docs/rules/require-returns.md +1 -1
- package/docs/rules/require-throws.md +1 -1
- package/docs/rules/require-yields-check.md +1 -1
- package/docs/rules/require-yields.md +1 -1
- package/docs/rules/sort-tags.md +1 -1
- package/docs/rules/tag-lines.md +1 -1
- package/docs/rules/text-escaping.md +1 -1
- package/package.json +5 -2
- package/dist/bin/generateRule.js +0 -237
- package/dist/bin/generateRule.js.map +0 -1
- package/dist/bin/gitdown.d.ts +0 -12
package/README.md
CHANGED
|
@@ -131,25 +131,31 @@ as failing errors, you may use the "recommended-error" config:
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
If you plan to use TypeScript syntax (and not just "typescript"
|
|
134
|
-
`mode` to indicate the JSDoc flavor is TypeScript), you can
|
|
135
|
-
the following:
|
|
134
|
+
`mode` to indicate the JSDoc flavor is TypeScript), you can use:
|
|
136
135
|
|
|
137
|
-
```
|
|
136
|
+
```json
|
|
138
137
|
{
|
|
139
|
-
|
|
140
|
-
"jsdoc/no-types": 1,
|
|
141
|
-
"jsdoc/require-param-type": 0,
|
|
142
|
-
"jsdoc/require-property-type": 0,
|
|
143
|
-
"jsdoc/require-returns-type": 0,
|
|
144
|
-
}
|
|
138
|
+
"extends": ["plugin:jsdoc/recommended-typescript"]
|
|
145
139
|
}
|
|
146
140
|
```
|
|
147
141
|
|
|
148
|
-
...or
|
|
142
|
+
...or to report with failing errors instead of mere warnings:
|
|
149
143
|
|
|
150
144
|
```json
|
|
151
145
|
{
|
|
152
|
-
"extends": ["plugin:jsdoc/recommended-typescript"]
|
|
146
|
+
"extends": ["plugin:jsdoc/recommended-typescript-error"]
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
If you are not using TypeScript syntax (your source files are still `.js` files)
|
|
151
|
+
but you are using the TypeScript flavor within JSDoc (i.e., the default
|
|
152
|
+
"typescript" `mode` in `eslint-plugin-jsdoc`) and you are perhaps using
|
|
153
|
+
`allowJs` and `checkJs` options of TypeScript's `tsconfig.json`), you may
|
|
154
|
+
use:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"extends": ["plugin:jsdoc/recommended-typescript-flavor"]
|
|
153
159
|
}
|
|
154
160
|
```
|
|
155
161
|
|
|
@@ -157,7 +163,7 @@ the following:
|
|
|
157
163
|
|
|
158
164
|
```json
|
|
159
165
|
{
|
|
160
|
-
"extends": ["plugin:jsdoc/recommended-typescript-error"]
|
|
166
|
+
"extends": ["plugin:jsdoc/recommended-typescript-flavor-error"]
|
|
161
167
|
}
|
|
162
168
|
```
|
|
163
169
|
|
|
@@ -235,12 +241,12 @@ non-default-recommended fixer).
|
|
|
235
241
|
||:wrench:|[no-bad-blocks](./docs/rules/no-bad-blocks.md#readme)|This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block|
|
|
236
242
|
||:wrench:|[no-blank-block-descriptions](./docs/rules/no-blank-block-descriptions.md#readme)|If tags are present, this rule will prevent empty lines in the block description. If no tags are present, this rule will prevent extra empty lines in the block description.|
|
|
237
243
|
||:wrench:|[no-blank-blocks](./docs/rules/no-blank-blocks.md#readme)|Reports and optionally removes blocks with whitespace only|
|
|
238
|
-
|
|
244
|
+
|:heavy_check_mark:|:wrench:|[no-defaults](./docs/rules/no-defaults.md#readme)|This rule reports defaults being used on the relevant portion of `@param` or `@default`|
|
|
239
245
|
|||[no-missing-syntax](./docs/rules/no-missing-syntax.md#readme)|This rule lets you report if certain always expected comment structures are missing.|
|
|
240
246
|
|:heavy_check_mark:|:wrench:|[no-multi-asterisks](./docs/rules/no-multi-asterisks.md#readme)|Prevents use of multiple asterisks at the beginning of lines|
|
|
241
247
|
|||[no-restricted-syntax](./docs/rules/no-restricted-syntax.md#readme)|Reports when certain comment structures are present|
|
|
242
|
-
|
|
243
|
-
|:heavy_check_mark
|
|
248
|
+
|On in TS|:wrench:|[no-types](./docs/rules/no-types.md#readme)|Prohibits types on `@param` or `@returns` (redundant with TypeScript)|
|
|
249
|
+
|:heavy_check_mark: (off in TS and TS flavor)||[no-undefined-types](./docs/rules/no-undefined-types.md#readme)|Besides some expected built-in types, prohibits any types not specified as globals or within `@typedef` |
|
|
244
250
|
||:wrench:|[require-asterisk-prefix](./docs/rules/require-asterisk-prefix.md#readme)|Requires that each JSDoc line starts with an `*`|
|
|
245
251
|
|||[require-description](./docs/rules/require-description.md#readme)|Requires that all functions (and potentially other contexts) have a description.|
|
|
246
252
|
||:wrench:|[require-description-complete-sentence](./docs/rules/require-description-complete-sentence.md#readme)|Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences|
|
|
@@ -251,15 +257,15 @@ non-default-recommended fixer).
|
|
|
251
257
|
|:heavy_check_mark:|:wrench:|[require-param](./docs/rules/require-param.md#readme)|Requires that all function parameters are documented with a `@param` tag.|
|
|
252
258
|
|:heavy_check_mark:||[require-param-description](./docs/rules/require-param-description.md#readme)|Requires that each `@param` tag has a `description` value.|
|
|
253
259
|
|:heavy_check_mark:||[require-param-name](./docs/rules/require-param-name.md#readme)|Requires that all `@param` tags have names.|
|
|
254
|
-
|:heavy_check_mark
|
|
260
|
+
|:heavy_check_mark: (off in TS)||[require-param-type](./docs/rules/require-param-type.md#readme)|Requires that each `@param` tag has a type value (within curly brackets).|
|
|
255
261
|
|:heavy_check_mark:|:wrench:|[require-property](./docs/rules/require-property.md#readme)|Requires that all `@typedef` and `@namespace` tags have `@property` tags when their type is a plain `object`, `Object`, or `PlainObject`.|
|
|
256
262
|
|:heavy_check_mark:||[require-property-description](./docs/rules/require-property-description.md#readme)|Requires that each `@property` tag has a `description` value.|
|
|
257
263
|
|:heavy_check_mark:||[require-property-name](./docs/rules/require-property-name.md#readme)|Requires that all `@property` tags have names.|
|
|
258
|
-
|:heavy_check_mark
|
|
264
|
+
|:heavy_check_mark: (off in TS)||[require-property-type](./docs/rules/require-property-type.md#readme)|Requires that each `@property` tag has a type value (within curly brackets).|
|
|
259
265
|
|:heavy_check_mark:||[require-returns](./docs/rules/require-returns.md#readme)|Requires that return statements are documented.|
|
|
260
266
|
|:heavy_check_mark:||[require-returns-check](./docs/rules/require-returns-check.md#readme)|Requires a return statement be present in a function body if a `@returns` tag is specified in the jsdoc comment block (and reports if multiple `@returns` tags are present).|
|
|
261
267
|
|:heavy_check_mark:||[require-returns-description](./docs/rules/require-returns-description.md#readme)|Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).|
|
|
262
|
-
|:heavy_check_mark
|
|
268
|
+
|:heavy_check_mark: (off in TS)||[require-returns-type](./docs/rules/require-returns-type.md#readme)|Requires that `@returns` tag has a type value (in curly brackets).|
|
|
263
269
|
|||[require-throws](./docs/rules/require-throws.md#readme)|Requires that throw statements are documented|
|
|
264
270
|
|:heavy_check_mark:||[require-yields](./docs/rules/require-yields.md#readme)|Requires that yields are documented|
|
|
265
271
|
|:heavy_check_mark:||[require-yields-check](./docs/rules/require-yields-check.md#readme)|Ensures that if a `@yields` is present that a `yield` (or `yield` with a value) is present in the function body (or that if a `@next` is present that there is a `yield` with a return value present)|
|
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ const createRecommendedRuleset = warnOrError => {
|
|
|
146
146
|
'jsdoc/no-bad-blocks': 'off',
|
|
147
147
|
'jsdoc/no-blank-block-descriptions': 'off',
|
|
148
148
|
'jsdoc/no-blank-blocks': 'off',
|
|
149
|
-
'jsdoc/no-defaults':
|
|
149
|
+
'jsdoc/no-defaults': warnOrError,
|
|
150
150
|
'jsdoc/no-missing-syntax': 'off',
|
|
151
151
|
'jsdoc/no-multi-asterisks': warnOrError,
|
|
152
152
|
'jsdoc/no-restricted-syntax': 'off',
|
|
@@ -197,6 +197,7 @@ const createRecommendedTypeScriptRuleset = warnOrError => {
|
|
|
197
197
|
typed: true
|
|
198
198
|
}],
|
|
199
199
|
'jsdoc/no-types': warnOrError,
|
|
200
|
+
'jsdoc/no-undefined-types': 'off',
|
|
200
201
|
'jsdoc/require-param-type': 'off',
|
|
201
202
|
'jsdoc/require-property-type': 'off',
|
|
202
203
|
'jsdoc/require-returns-type': 'off'
|
|
@@ -205,6 +206,23 @@ const createRecommendedTypeScriptRuleset = warnOrError => {
|
|
|
205
206
|
};
|
|
206
207
|
};
|
|
207
208
|
|
|
209
|
+
/**
|
|
210
|
+
* @param {"warn"|"error"} warnOrError
|
|
211
|
+
* @returns {import('eslint').ESLint.ConfigData}
|
|
212
|
+
*/
|
|
213
|
+
const createRecommendedTypeScriptFlavorRuleset = warnOrError => {
|
|
214
|
+
const ruleset = createRecommendedRuleset(warnOrError);
|
|
215
|
+
return {
|
|
216
|
+
...ruleset,
|
|
217
|
+
rules: {
|
|
218
|
+
...ruleset.rules,
|
|
219
|
+
/* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */
|
|
220
|
+
'jsdoc/no-undefined-types': 'off'
|
|
221
|
+
/* eslint-enable indent */
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
|
|
208
226
|
/* istanbul ignore if -- TS */
|
|
209
227
|
if (!index.configs) {
|
|
210
228
|
throw new Error('TypeScript guard');
|
|
@@ -213,6 +231,8 @@ index.configs.recommended = createRecommendedRuleset('warn');
|
|
|
213
231
|
index.configs['recommended-error'] = createRecommendedRuleset('error');
|
|
214
232
|
index.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');
|
|
215
233
|
index.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');
|
|
234
|
+
index.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');
|
|
235
|
+
index.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error');
|
|
216
236
|
var _default = index;
|
|
217
237
|
exports.default = _default;
|
|
218
238
|
module.exports = exports.default;
|
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","_noBadBlocks","_noBlankBlockDescriptions","_noBlankBlocks","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","informativeDocs","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","Error","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess';\nimport checkAlignment from './rules/checkAlignment';\nimport checkExamples from './rules/checkExamples';\nimport checkIndentation from './rules/checkIndentation';\nimport checkLineAlignment from './rules/checkLineAlignment';\nimport checkParamNames from './rules/checkParamNames';\nimport checkPropertyNames from './rules/checkPropertyNames';\nimport checkSyntax from './rules/checkSyntax';\nimport checkTagNames from './rules/checkTagNames';\nimport checkTypes from './rules/checkTypes';\nimport checkValues from './rules/checkValues';\nimport emptyTags from './rules/emptyTags';\nimport implementsOnClasses from './rules/implementsOnClasses';\nimport informativeDocs from './rules/informativeDocs';\nimport matchDescription from './rules/matchDescription';\nimport matchName from './rules/matchName';\nimport multilineBlocks from './rules/multilineBlocks';\nimport noBadBlocks from './rules/noBadBlocks';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions';\nimport noBlankBlocks from './rules/noBlankBlocks';\nimport noDefaults from './rules/noDefaults';\nimport noMissingSyntax from './rules/noMissingSyntax';\nimport noMultiAsterisks from './rules/noMultiAsterisks';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax';\nimport noTypes from './rules/noTypes';\nimport noUndefinedTypes from './rules/noUndefinedTypes';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix';\nimport requireDescription from './rules/requireDescription';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence';\nimport requireExample from './rules/requireExample';\nimport requireFileOverview from './rules/requireFileOverview';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription';\nimport requireJsdoc from './rules/requireJsdoc';\nimport requireParam from './rules/requireParam';\nimport requireParamDescription from './rules/requireParamDescription';\nimport requireParamName from './rules/requireParamName';\nimport requireParamType from './rules/requireParamType';\nimport requireProperty from './rules/requireProperty';\nimport requirePropertyDescription from './rules/requirePropertyDescription';\nimport requirePropertyName from './rules/requirePropertyName';\nimport requirePropertyType from './rules/requirePropertyType';\nimport requireReturns from './rules/requireReturns';\nimport requireReturnsCheck from './rules/requireReturnsCheck';\nimport requireReturnsDescription from './rules/requireReturnsDescription';\nimport requireReturnsType from './rules/requireReturnsType';\nimport requireThrows from './rules/requireThrows';\nimport requireYields from './rules/requireYields';\nimport requireYieldsCheck from './rules/requireYieldsCheck';\nimport sortTags from './rules/sortTags';\nimport tagLines from './rules/tagLines';\nimport textEscaping from './rules/textEscaping';\nimport validTypes from './rules/validTypes';\n\n/**\n * @type {import('eslint').ESLint.Plugin}\n */\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'informative-docs': informativeDocs,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-throws': requireThrows,\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'valid-types': validTypes,\n },\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/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': '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\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/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/* istanbul ignore if -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\n\nexport default index;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,YAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,UAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,oBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,iBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,UAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,gBAAA,GAAAjB,sBAAA,CAAAC,OAAA;AACA,IAAAiB,YAAA,GAAAlB,sBA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AK;MAC5B,mBAAmB,EAAEA;IACvB;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAME,kCAAkC,GAAIF,WAAW,IAAK;EAC1D,MAAMG,OAAO,GAAGJ,wBAAwB,CAACC,WAAW,CAAC;EAErD,OAAO;IACL,GAAGG,OAAO;IACVzD,KAAK,EAAE;MACL,GAAGyD,OAAO,CAACzD,KAAK;MAChB;MACE,uBAAuB,EAAE,CACvBsD,WAAW,EAAE;QACXI,KAAK,EAAE;MACT,CAAC,CACF;MACD,gBAAgB,EAAEJ,WAAW;MAC7B,0BAA0B,EAAE,KAAK;MACjC,6BAA6B,EAAE,KAAK;MACpC,4BAA4B,EAAE;MAChC;IACF;EACF,CAAC;AACH,CAAC;;AAED;AACA,IAAI,CAACxD,KAAK,CAACC,OAAO,EAAE;EAClB,MAAM,IAAI4D,KAAK,CAAC,kBAAkB,CAAC;AACrC;AAEA7D,KAAK,CAACC,OAAO,CAAC6D,WAAW,GAAGP,wBAAwB,CAAC,MAAM,CAAC;AAC5DvD,KAAK,CAACC,OAAO,CAAC,mBAAmB,CAAC,GAAGsD,wBAAwB,CAAC,OAAO,CAAC;AACtEvD,KAAK,CAACC,OAAO,CAAC,wBAAwB,CAAC,GAAGyD,kCAAkC,CAAC,MAAM,CAAC;AACpF1D,KAAK,CAACC,OAAO,CAAC,8BAA8B,CAAC,GAAGyD,kCAAkC,CAAC,OAAO,CAAC;AAAC,IAAAK,QAAA,GAE7E/D,KAAK;AAAAgE,OAAA,CAAAjE,OAAA,GAAAgE,QAAA;AAAAE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjE,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","_noBlankBlocks","_noDefaults","_noMissingSyntax","_noMultiAsterisks","_noRestrictedSyntax","_noTypes","_noUndefinedTypes","_requireAsteriskPrefix","_requireDescription","_requireDescriptionCompleteSentence","_requireExample","_requireFileOverview","_requireHyphenBeforeParamDescription","_requireJsdoc","_requireParam","_requireParamDescription","_requireParamName","_requireParamType","_requireProperty","_requirePropertyDescription","_requirePropertyName","_requirePropertyType","_requireReturns","_requireReturnsCheck","_requireReturnsDescription","_requireReturnsType","_requireThrows","_requireYields","_requireYieldsCheck","_sortTags","_tagLines","_textEscaping","_validTypes","obj","__esModule","default","index","configs","rules","checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTypes","checkValues","emptyTags","implementsOnClasses","informativeDocs","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","validTypes","createRecommendedRuleset","warnOrError","plugins","createRecommendedTypeScriptRuleset","ruleset","typed","createRecommendedTypeScriptFlavorRuleset","Error","recommended","_default","exports","module"],"sources":["../src/index.js"],"sourcesContent":["import checkAccess from './rules/checkAccess';\nimport checkAlignment from './rules/checkAlignment';\nimport checkExamples from './rules/checkExamples';\nimport checkIndentation from './rules/checkIndentation';\nimport checkLineAlignment from './rules/checkLineAlignment';\nimport checkParamNames from './rules/checkParamNames';\nimport checkPropertyNames from './rules/checkPropertyNames';\nimport checkSyntax from './rules/checkSyntax';\nimport checkTagNames from './rules/checkTagNames';\nimport checkTypes from './rules/checkTypes';\nimport checkValues from './rules/checkValues';\nimport emptyTags from './rules/emptyTags';\nimport implementsOnClasses from './rules/implementsOnClasses';\nimport informativeDocs from './rules/informativeDocs';\nimport matchDescription from './rules/matchDescription';\nimport matchName from './rules/matchName';\nimport multilineBlocks from './rules/multilineBlocks';\nimport noBadBlocks from './rules/noBadBlocks';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions';\nimport noBlankBlocks from './rules/noBlankBlocks';\nimport noDefaults from './rules/noDefaults';\nimport noMissingSyntax from './rules/noMissingSyntax';\nimport noMultiAsterisks from './rules/noMultiAsterisks';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax';\nimport noTypes from './rules/noTypes';\nimport noUndefinedTypes from './rules/noUndefinedTypes';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix';\nimport requireDescription from './rules/requireDescription';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence';\nimport requireExample from './rules/requireExample';\nimport requireFileOverview from './rules/requireFileOverview';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription';\nimport requireJsdoc from './rules/requireJsdoc';\nimport requireParam from './rules/requireParam';\nimport requireParamDescription from './rules/requireParamDescription';\nimport requireParamName from './rules/requireParamName';\nimport requireParamType from './rules/requireParamType';\nimport requireProperty from './rules/requireProperty';\nimport requirePropertyDescription from './rules/requirePropertyDescription';\nimport requirePropertyName from './rules/requirePropertyName';\nimport requirePropertyType from './rules/requirePropertyType';\nimport requireReturns from './rules/requireReturns';\nimport requireReturnsCheck from './rules/requireReturnsCheck';\nimport requireReturnsDescription from './rules/requireReturnsDescription';\nimport requireReturnsType from './rules/requireReturnsType';\nimport requireThrows from './rules/requireThrows';\nimport requireYields from './rules/requireYields';\nimport requireYieldsCheck from './rules/requireYieldsCheck';\nimport sortTags from './rules/sortTags';\nimport tagLines from './rules/tagLines';\nimport textEscaping from './rules/textEscaping';\nimport validTypes from './rules/validTypes';\n\n/**\n * @type {import('eslint').ESLint.Plugin}\n */\nconst index = {\n configs: {},\n rules: {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'empty-tags': emptyTags,\n 'implements-on-classes': implementsOnClasses,\n 'informative-docs': informativeDocs,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-throws': requireThrows,\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'valid-types': validTypes,\n },\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedRuleset = (warnOrError) => {\n return {\n plugins: [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-blank-blocks': 'off',\n 'jsdoc/no-defaults': warnOrError,\n 'jsdoc/no-missing-syntax': 'off',\n 'jsdoc/no-multi-asterisks': warnOrError,\n 'jsdoc/no-restricted-syntax': 'off',\n 'jsdoc/no-types': 'off',\n 'jsdoc/no-undefined-types': warnOrError,\n 'jsdoc/require-asterisk-prefix': 'off',\n 'jsdoc/require-description': 'off',\n 'jsdoc/require-description-complete-sentence': 'off',\n 'jsdoc/require-example': 'off',\n 'jsdoc/require-file-overview': 'off',\n 'jsdoc/require-hyphen-before-param-description': 'off',\n 'jsdoc/require-jsdoc': warnOrError,\n 'jsdoc/require-param': warnOrError,\n 'jsdoc/require-param-description': warnOrError,\n 'jsdoc/require-param-name': warnOrError,\n 'jsdoc/require-param-type': warnOrError,\n 'jsdoc/require-property': warnOrError,\n 'jsdoc/require-property-description': warnOrError,\n 'jsdoc/require-property-name': warnOrError,\n 'jsdoc/require-property-type': warnOrError,\n 'jsdoc/require-returns': warnOrError,\n 'jsdoc/require-returns-check': warnOrError,\n 'jsdoc/require-returns-description': warnOrError,\n 'jsdoc/require-returns-type': warnOrError,\n 'jsdoc/require-throws': 'off',\n 'jsdoc/require-yields': warnOrError,\n 'jsdoc/require-yields-check': warnOrError,\n 'jsdoc/sort-tags': 'off',\n 'jsdoc/tag-lines': warnOrError,\n 'jsdoc/text-escaping': 'off',\n 'jsdoc/valid-types': warnOrError,\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @returns {import('eslint').ESLint.ConfigData}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError) => {\n const ruleset = createRecommendedRuleset(warnOrError);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/no-undefined-types': 'off',\n /* eslint-enable indent */\n },\n };\n};\n\n/* istanbul ignore if -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\nindex.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');\nindex.configs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;MACD,gBAAgB,EAAEJ,WAAW;MAC7B,0BAA0B,EAAE,KAAK;MACjC,0BAA0B,EAAE,KAAK;MACjC,6BAA6B,EAAE,KAAK;MACpC,4BAA4B,EAAE;MAChC;IACF;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMK,wCAAwC,GAAIL,WAAW,IAAK;EAChE,MAAMG,OAAO,GAAGJ,wBAAwB,CAACC,WAAW,CAAC;EAErD,OAAO;IACL,GAAGG,OAAO;IACVzD,KAAK,EAAE;MACL,GAAGyD,OAAO,CAACzD,KAAK;MAChB;MACE,0BAA0B,EAAE;MAC9B;IACF;EACF,CAAC;AACH,CAAC;;AAED;AACA,IAAI,CAACF,KAAK,CAACC,OAAO,EAAE;EAClB,MAAM,IAAI6D,KAAK,CAAC,kBAAkB,CAAC;AACrC;AAEA9D,KAAK,CAACC,OAAO,CAAC8D,WAAW,GAAGR,wBAAwB,CAAC,MAAM,CAAC;AAC5DvD,KAAK,CAACC,OAAO,CAAC,mBAAmB,CAAC,GAAGsD,wBAAwB,CAAC,OAAO,CAAC;AACtEvD,KAAK,CAACC,OAAO,CAAC,wBAAwB,CAAC,GAAGyD,kCAAkC,CAAC,MAAM,CAAC;AACpF1D,KAAK,CAACC,OAAO,CAAC,8BAA8B,CAAC,GAAGyD,kCAAkC,CAAC,OAAO,CAAC;AAC3F1D,KAAK,CAACC,OAAO,CAAC,+BAA+B,CAAC,GAAG4D,wCAAwC,CAAC,MAAM,CAAC;AACjG7D,KAAK,CAACC,OAAO,CAAC,qCAAqC,CAAC,GAAG4D,wCAAwC,CAAC,OAAO,CAAC;AAAC,IAAAG,QAAA,GAE1FhE,KAAK;AAAAiE,OAAA,CAAAlE,OAAA,GAAAiE,QAAA;AAAAE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlE,OAAA"}
|
|
@@ -212,7 +212,7 @@ expression-oriented rules will be used by default as well:
|
|
|
212
212
|
|Context|everywhere|
|
|
213
213
|
|Tags|`example`|
|
|
214
214
|
|Recommended|false|
|
|
215
|
-
|Options
|
|
215
|
+
|Options|`allowInlineConfig`, `baseConfig`, `captionRequired`, `checkDefaults`, `checkEslintrc`, `checkParams`, `checkProperties`, `configFile`, `exampleCodeRegex`, `matchingFileName`, `matchingFileNameDefaults`, `matchingFileNameParams`, `matchingFileNameProperties`, `noDefaultExampleRules`, `paddedIndent`, `rejectExampleCodeRegex`, `reportUnusedDisableDirectives`|
|
|
216
216
|
|
|
217
217
|
<a name="user-content-check-examples-failing-examples"></a>
|
|
218
218
|
<a name="check-examples-failing-examples"></a>
|
|
@@ -64,7 +64,7 @@ report a padding issue:
|
|
|
64
64
|
|Context|everywhere|
|
|
65
65
|
|Tags|N/A|
|
|
66
66
|
|Recommended|false|
|
|
67
|
-
|Options
|
|
67
|
+
|Options|`excludeTags`|
|
|
68
68
|
|
|
69
69
|
<a name="user-content-check-indentation-failing-examples"></a>
|
|
70
70
|
<a name="check-indentation-failing-examples"></a>
|
|
@@ -79,7 +79,7 @@ Default to the empty string (no indent).
|
|
|
79
79
|
|||
|
|
80
80
|
|---|---|
|
|
81
81
|
|Context|everywhere|
|
|
82
|
-
|Options|
|
|
82
|
+
|Options|string ("always", "never", "any") followed by object with `customSpacings`, `preserveMainDescriptionPostDelimiter`, `tags`, `wrapIndent`|
|
|
83
83
|
|Tags|`param`, `property`, `returns` and others added by `tags`|
|
|
84
84
|
|Aliases|`arg`, `argument`, `prop`, `return`|
|
|
85
85
|
|Recommended|false|
|
|
@@ -123,7 +123,7 @@ that are available and actually used in the function.
|
|
|
123
123
|
|||
|
|
124
124
|
|---|---|
|
|
125
125
|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
|
|
126
|
-
|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `
|
|
126
|
+
|Options|`allowExtraTrailingParamDocs`, `checkDestructured`, `checkRestProperty`, `checkTypesPattern`, `disableExtraPropertyReporting`, `enableFixer`, `useDefaultObjectProperties`|
|
|
127
127
|
|Tags|`param`|
|
|
128
128
|
|Aliases|`arg`, `argument`|
|
|
129
129
|
|Recommended|true|
|
|
@@ -183,7 +183,7 @@ permitted.
|
|
|
183
183
|
|Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`|
|
|
184
184
|
|Closure-only|`package`, `private`, `protected`, `public`, `static`|
|
|
185
185
|
|Recommended|true|
|
|
186
|
-
|Options|`
|
|
186
|
+
|Options|`exemptTagContexts`, `noDefaults`, `unifyParentAndChildTypeChecks`|
|
|
187
187
|
|Settings|`preferredTypes`, `mode`, `structuredTags`|
|
|
188
188
|
|
|
189
189
|
<a name="user-content-check-types-failing-examples"></a>
|
|
@@ -78,7 +78,7 @@ Whether to enable validation that `@variation` must be a number. Defaults to
|
|
|
78
78
|
|Context|everywhere|
|
|
79
79
|
|Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`|
|
|
80
80
|
|Recommended|true|
|
|
81
|
-
|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`|
|
|
81
|
+
|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`, `numericOnlyVariation`|
|
|
82
82
|
|Settings|`tagNamePreference`|
|
|
83
83
|
|
|
84
84
|
<a name="user-content-check-values-failing-examples"></a>
|
|
@@ -186,7 +186,7 @@ section of our README for more on the expected format.
|
|
|
186
186
|
|Aliases|`@desc`|
|
|
187
187
|
|Recommended|false|
|
|
188
188
|
|Settings||
|
|
189
|
-
|Options|`contexts`, `
|
|
189
|
+
|Options|`contexts`, `mainDescription`, `matchDescription`, `message`, `tags`|
|
|
190
190
|
|
|
191
191
|
<a name="user-content-match-description-failing-examples"></a>
|
|
192
192
|
<a name="match-description-failing-examples"></a>
|
|
@@ -120,7 +120,7 @@ cannot be reliably added after the tag either).
|
|
|
120
120
|
|Tags|Any (though `singleLineTags` and `multilineTags` control the application)|
|
|
121
121
|
|Recommended|true|
|
|
122
122
|
|Settings||
|
|
123
|
-
|Options|`
|
|
123
|
+
|Options|`allowMultipleTags`, `minimumLengthForMultiline`, `multilineTags`, `noFinalLineText`, `noMultilineBlocks`, `noSingleLineBlocks`, `noZeroLineText`, `singleLineTags`|
|
|
124
124
|
|
|
125
125
|
<a name="user-content-failing-examples"></a>
|
|
126
126
|
<a name="failing-examples"></a>
|
|
@@ -68,7 +68,7 @@ Prevent the likes of this:
|
|
|
68
68
|
|Tags|(any)|
|
|
69
69
|
|Recommended|true|
|
|
70
70
|
|Settings||
|
|
71
|
-
|Options|`preventAtEnd`, `preventAtMiddleLines`|
|
|
71
|
+
|Options|`allowWhitespace`, `preventAtEnd`, `preventAtMiddleLines`|
|
|
72
72
|
|
|
73
73
|
<a name="user-content-failing-examples"></a>
|
|
74
74
|
<a name="failing-examples"></a>
|
|
@@ -79,7 +79,7 @@ An option object may have the following keys:
|
|
|
79
79
|
|Aliases|`constructor`, `const`, `extends`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`|
|
|
80
80
|
|Closure-only|`package`, `private`, `protected`, `public`, `static`|
|
|
81
81
|
|Recommended|true|
|
|
82
|
-
|Options|`definedTypes`, `
|
|
82
|
+
|Options|`definedTypes`, `disableReporting`, `markVariablesAsUsed`|
|
|
83
83
|
|Settings|`preferredTypes`, `mode`, `structuredTags`|
|
|
84
84
|
|
|
85
85
|
|
|
@@ -53,7 +53,7 @@ which applies to the main jsdoc block description.
|
|
|
53
53
|
|---|---|
|
|
54
54
|
|Context|everywhere|
|
|
55
55
|
|Tags|All or as limited by the `tags` option|
|
|
56
|
-
|Options|
|
|
56
|
+
|Options|string ("always", "never", "any") followed by object with `tags`|
|
|
57
57
|
|
|
58
58
|
<a name="user-content-failing-examples"></a>
|
|
59
59
|
<a name="failing-examples"></a>
|
|
@@ -90,7 +90,7 @@ nouns, for example).
|
|
|
90
90
|
|Tags|doc block, `param`, `returns`, `description`, `property`, `summary`, `file`, `classdesc`, `todo`, `deprecated`, `throws`, 'yields' and others added by `tags`|
|
|
91
91
|
|Aliases|`arg`, `argument`, `return`, `desc`, `prop`, `fileoverview`, `overview`, `exception`, `yield`|
|
|
92
92
|
|Recommended|false|
|
|
93
|
-
|Options|`
|
|
93
|
+
|Options|`abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`, `tags`|
|
|
94
94
|
|
|
95
95
|
<a name="user-content-require-description-complete-sentence-failing-examples"></a>
|
|
96
96
|
<a name="require-description-complete-sentence-failing-examples"></a>
|
|
@@ -52,7 +52,7 @@ An options object may have any of the following properties:
|
|
|
52
52
|
| Tags | `description` or jsdoc block |
|
|
53
53
|
| Aliases | `desc` |
|
|
54
54
|
| Recommended | false |
|
|
55
|
-
| Options
|
|
55
|
+
| Options |`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `descriptionStyle`, `exemptedBy`|
|
|
56
56
|
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
57
57
|
|
|
58
58
|
<a name="user-content-require-description-failing-examples"></a>
|
|
@@ -98,7 +98,7 @@ Defaults to `true`.
|
|
|
98
98
|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|
|
99
99
|
|Tags|`example`|
|
|
100
100
|
|Recommended|false|
|
|
101
|
-
|Options|`
|
|
101
|
+
|Options|`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `enableFixer`, `exemptedBy`, `exemptNoArguments`|
|
|
102
102
|
|Settings|`ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
103
103
|
|
|
104
104
|
<a name="user-content-failing-examples"></a>
|
|
@@ -48,7 +48,7 @@ other tags besides the `@param` tag (or the `@arg` tag if so set):
|
|
|
48
48
|
|Tags|`param` and optionally other tags within `tags`|
|
|
49
49
|
|Aliases|`arg`, `argument`; potentially `prop` or other aliases|
|
|
50
50
|
|Recommended|false|
|
|
51
|
-
|Options|
|
|
51
|
+
|Options|string ("always", "never") followed by object with `tags`|
|
|
52
52
|
|
|
53
53
|
<a name="user-content-require-hyphen-before-param-description-failing-examples"></a>
|
|
54
54
|
<a name="require-hyphen-before-param-description-failing-examples"></a>
|
|
@@ -64,7 +64,7 @@ section of our README for more on the expected format.
|
|
|
64
64
|
|Tags|`param`|
|
|
65
65
|
|Aliases|`arg`, `argument`|
|
|
66
66
|
|Recommended|true|
|
|
67
|
-
|Options|`
|
|
67
|
+
|Options|`contexts`, `defaultDestructuredRootDescription`, `setDefaultDestructuredRootDescription`|
|
|
68
68
|
|Settings|`exemptDestructuredRootsFromChecks`|
|
|
69
69
|
|
|
70
70
|
<a name="user-content-require-param-description-failing-examples"></a>
|
|
@@ -63,7 +63,7 @@ section of our README for more on the expected format.
|
|
|
63
63
|
|Tags|`param`|
|
|
64
64
|
|Aliases|`arg`, `argument`|
|
|
65
65
|
|Recommended|true|
|
|
66
|
-
|Options|`
|
|
66
|
+
|Options|`contexts`, `defaultDestructuredRootType`, `setDefaultDestructuredRootType`|
|
|
67
67
|
|Settings|`exemptDestructuredRootsFromChecks`|
|
|
68
68
|
|
|
69
69
|
<a name="user-content-require-param-type-failing-examples"></a>
|
|
@@ -447,7 +447,7 @@ supplied as default values. Defaults to `false`.
|
|
|
447
447
|
| Tags | `param` |
|
|
448
448
|
| Aliases | `arg`, `argument` |
|
|
449
449
|
|Recommended | true|
|
|
450
|
-
| Options
|
|
450
|
+
| Options |`autoIncrementBase`, `checkConstructors`, `checkDestructured`, `checkDestructuredRoots`, `checkGetters`, `checkRestProperty`, `checkSetters`, `checkTypesPattern`, `contexts`, `enableFixer`, `enableRestElementFixer`, `enableRootFixer`, `exemptedBy`, `unnamedRootBase`, `useDefaultObjectProperties`|
|
|
451
451
|
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
452
452
|
|
|
453
453
|
<a name="user-content-require-param-failing-examples"></a>
|
|
@@ -54,7 +54,7 @@ Will also report if multiple `@returns` tags are present.
|
|
|
54
54
|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
|
|
55
55
|
|Tags|`returns`|
|
|
56
56
|
|Aliases|`return`|
|
|
57
|
-
|Options|`exemptAsync`, `reportMissingReturnForUndefinedTypes`|
|
|
57
|
+
|Options|`exemptAsync`, `exemptGenerators`, `reportMissingReturnForUndefinedTypes`|
|
|
58
58
|
|Recommended|true|
|
|
59
59
|
|
|
60
60
|
<a name="user-content-require-returns-check-failing-examples"></a>
|
|
@@ -61,7 +61,7 @@ Will also report if multiple `@returns` tags are present.
|
|
|
61
61
|
| Tags | `returns` |
|
|
62
62
|
| Aliases | `return` |
|
|
63
63
|
|Recommended|true|
|
|
64
|
-
| Options
|
|
64
|
+
| Options |`checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync`|
|
|
65
65
|
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
66
66
|
|
|
67
67
|
<a name="user-content-require-returns-failing-examples"></a>
|
|
@@ -49,7 +49,7 @@ on why TypeScript doesn't offer such a feature.
|
|
|
49
49
|
| Tags | `throws` |
|
|
50
50
|
| Aliases | `exception` |
|
|
51
51
|
|Recommended|true|
|
|
52
|
-
| Options
|
|
52
|
+
| Options |`contexts`, `exemptedBy`|
|
|
53
53
|
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
54
54
|
|
|
55
55
|
<a name="user-content-require-throws-failing-examples"></a>
|
|
@@ -54,7 +54,7 @@ Will also report if multiple `@yields` tags are present.
|
|
|
54
54
|
|Tags|`yields`|
|
|
55
55
|
|Aliases|`yield`|
|
|
56
56
|
|Recommended|true|
|
|
57
|
-
|Options|`checkGeneratorsOnly`|
|
|
57
|
+
|Options|`checkGeneratorsOnly`, `contexts`, `exemptedBy`, `next`|
|
|
58
58
|
|
|
59
59
|
<a name="user-content-require-yields-check-failing-examples"></a>
|
|
60
60
|
<a name="require-yields-check-failing-examples"></a>
|
|
@@ -75,7 +75,7 @@ option to expect a non-standard `@next` tag.
|
|
|
75
75
|
|Tags|`yields`|
|
|
76
76
|
|Aliases|`yield`|
|
|
77
77
|
|Recommended|true|
|
|
78
|
-
| Options
|
|
78
|
+
| Options |`contexts`, `exemptedBy`, `forceRequireNext`, `forceRequireYields`, `next`, `nextWithGeneratorTag`, `withGeneratorTag`|
|
|
79
79
|
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
80
80
|
|
|
81
81
|
<a name="user-content-require-yields-failing-examples"></a>
|
package/docs/rules/sort-tags.md
CHANGED
|
@@ -272,7 +272,7 @@ such tags. Do not use with `true` if you are using `tag-lines` and `always`.
|
|
|
272
272
|
|Tags|any|
|
|
273
273
|
|Recommended|false|
|
|
274
274
|
|Settings||
|
|
275
|
-
|Options|`
|
|
275
|
+
|Options|`alphabetizeExtras`, `linesBetween`, `reportIntraTagGroupSpacing`, `reportTagGroupSpacing`, `tagSequence`|
|
|
276
276
|
|
|
277
277
|
<a name="user-content-sort-tags-failing-examples"></a>
|
|
278
278
|
<a name="sort-tags-failing-examples"></a>
|
package/docs/rules/tag-lines.md
CHANGED
|
@@ -94,7 +94,7 @@ following keys:
|
|
|
94
94
|
|Tags|Any|
|
|
95
95
|
|Recommended|true|
|
|
96
96
|
|Settings|N/A|
|
|
97
|
-
|Options|
|
|
97
|
+
|Options|string ("always", "any", "never") followed by object with `applyToEndTag`, `count`, `endLines`, `startLines`, `tags`|
|
|
98
98
|
|
|
99
99
|
<a name="user-content-tag-lines-failing-examples"></a>
|
|
100
100
|
<a name="tag-lines-failing-examples"></a>
|
|
@@ -52,7 +52,7 @@ This option escapes the first backtick (`` ` ``) in a paired sequence.
|
|
|
52
52
|
|Tags|``|
|
|
53
53
|
|Recommended|false|
|
|
54
54
|
|Settings||
|
|
55
|
-
|Options
|
|
55
|
+
|Options|`escapeHTML`, `escapeMarkdown`|
|
|
56
56
|
|
|
57
57
|
<a name="user-content-text-escaping-failing-examples"></a>
|
|
58
58
|
<a name="text-escaping-failing-examples"></a>
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@babel/plugin-transform-flow-strip-types": "^7.21.0",
|
|
25
25
|
"@babel/preset-env": "^7.21.5",
|
|
26
26
|
"@babel/register": "^7.21.0",
|
|
27
|
+
"@es-joy/escodegen": "^3.5.1",
|
|
27
28
|
"@es-joy/jsdoc-eslint-parser": "^0.19.0",
|
|
28
29
|
"@hkdobrev/run-if-changed": "^0.3.1",
|
|
29
30
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"decamelize": "^5.0.1",
|
|
49
50
|
"eslint": "8.41.0",
|
|
50
51
|
"eslint-config-canonical": "~41.0.4",
|
|
52
|
+
"espree": "^9.5.2",
|
|
51
53
|
"gitdown": "^3.1.5",
|
|
52
54
|
"glob": "^10.2.6",
|
|
53
55
|
"husky": "^8.0.3",
|
|
@@ -120,8 +122,9 @@
|
|
|
120
122
|
"tsc": "tsc",
|
|
121
123
|
"build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored",
|
|
122
124
|
"check-docs": "babel-node ./src/bin/generateDocs.js --check",
|
|
123
|
-
"create-docs": "babel-node ./src/bin/generateDocs.js",
|
|
125
|
+
"create-docs": "npm run create-options && babel-node ./src/bin/generateDocs.js",
|
|
124
126
|
"create-rule": "babel-node ./src/bin/generateRule.js",
|
|
127
|
+
"create-options": "node ./src/bin/generateOptions.mjs",
|
|
125
128
|
"install-offline": "pnpm install --prefer-offline --no-audit",
|
|
126
129
|
"lint": "npm run lint-arg -- .",
|
|
127
130
|
"lint-arg": "eslint --report-unused-disable-directives",
|
|
@@ -132,5 +135,5 @@
|
|
|
132
135
|
"test-cov": "cross-env TIMING=1 nyc --reporter text npm run test-no-cov",
|
|
133
136
|
"test-index": "npm run test-no-cov -- test/rules/index.js"
|
|
134
137
|
},
|
|
135
|
-
"version": "
|
|
138
|
+
"version": "46.0.0"
|
|
136
139
|
}
|
package/dist/bin/generateRule.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _camelcase = _interopRequireDefault(require("camelcase"));
|
|
4
|
-
var _fs = require("fs");
|
|
5
|
-
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
6
|
-
var _openEditor = _interopRequireDefault(require("open-editor"));
|
|
7
|
-
var _path = require("path");
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* eslint-disable no-console -- CLI */ /**
|
|
11
|
-
* @example
|
|
12
|
-
*
|
|
13
|
-
* ```shell
|
|
14
|
-
* npm run create-rule my-new-rule -- --recommended
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
// Todo: Would ideally have prompts, e.g., to ask for whether
|
|
18
|
-
// type was problem/layout, etc.
|
|
19
|
-
const [,, ruleName, ...options] = process.argv;
|
|
20
|
-
const recommended = options.includes('--recommended');
|
|
21
|
-
(async () => {
|
|
22
|
-
if (!ruleName) {
|
|
23
|
-
console.error('Please supply a rule name');
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (/[A-Z]/u.test(ruleName)) {
|
|
27
|
-
console.error('Please ensure the rule has no capital letters');
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const ruleNamesPath = './test/rules/ruleNames.json';
|
|
31
|
-
// @ts-expect-error Older types?
|
|
32
|
-
const ruleNames = JSON.parse(await _promises.default.readFile(ruleNamesPath));
|
|
33
|
-
if (!ruleNames.includes(ruleName)) {
|
|
34
|
-
ruleNames.push(ruleName);
|
|
35
|
-
ruleNames.sort();
|
|
36
|
-
}
|
|
37
|
-
await _promises.default.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n');
|
|
38
|
-
console.log('ruleNames', ruleNames);
|
|
39
|
-
const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc';
|
|
40
|
-
|
|
41
|
-
export default iterateJsdoc(({
|
|
42
|
-
context,
|
|
43
|
-
utils,
|
|
44
|
-
}) => {
|
|
45
|
-
// Rule here
|
|
46
|
-
}, {
|
|
47
|
-
iterateAllJsdocs: true,
|
|
48
|
-
meta: {
|
|
49
|
-
docs: {
|
|
50
|
-
description: '',
|
|
51
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',
|
|
52
|
-
},
|
|
53
|
-
schema: [
|
|
54
|
-
{
|
|
55
|
-
additionalProperties: false,
|
|
56
|
-
properties: {
|
|
57
|
-
// Option properties here (or remove the object)
|
|
58
|
-
},
|
|
59
|
-
type: 'object',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
type: 'suggestion',
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
`;
|
|
66
|
-
const camelCasedRuleName = (0, _camelcase.default)(ruleName);
|
|
67
|
-
const rulePath = `./src/rules/${camelCasedRuleName}.js`;
|
|
68
|
-
if (!(0, _fs.existsSync)(rulePath)) {
|
|
69
|
-
await _promises.default.writeFile(rulePath, ruleTemplate);
|
|
70
|
-
}
|
|
71
|
-
const ruleTestTemplate = `export default {
|
|
72
|
-
invalid: [
|
|
73
|
-
{
|
|
74
|
-
code: \`
|
|
75
|
-
\`,
|
|
76
|
-
errors: [
|
|
77
|
-
{
|
|
78
|
-
line: 2,
|
|
79
|
-
message: '',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
valid: [
|
|
85
|
-
{
|
|
86
|
-
code: \`
|
|
87
|
-
\`,
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
};
|
|
91
|
-
`;
|
|
92
|
-
const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;
|
|
93
|
-
if (!(0, _fs.existsSync)(ruleTestPath)) {
|
|
94
|
-
await _promises.default.writeFile(ruleTestPath, ruleTestTemplate);
|
|
95
|
-
}
|
|
96
|
-
const ruleReadmeTemplate = `### \`${ruleName}\`
|
|
97
|
-
|
|
98
|
-
|||
|
|
99
|
-
|---|---|
|
|
100
|
-
|Context|everywhere|
|
|
101
|
-
|Tags|\`\`|
|
|
102
|
-
|Recommended|${recommended ? 'true' : 'false'}|
|
|
103
|
-
|Settings||
|
|
104
|
-
|Options||
|
|
105
|
-
|
|
106
|
-
<!-- assertions ${camelCasedRuleName} -->
|
|
107
|
-
`;
|
|
108
|
-
const ruleReadmePath = `./.README/rules/${ruleName}.md`;
|
|
109
|
-
if (!(0, _fs.existsSync)(ruleReadmePath)) {
|
|
110
|
-
await _promises.default.writeFile(ruleReadmePath, ruleReadmeTemplate);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @param {object} cfg
|
|
115
|
-
* @param {string} cfg.path
|
|
116
|
-
* @param {RegExp} cfg.oldRegex
|
|
117
|
-
* @param {string} cfg.checkName
|
|
118
|
-
* @param {string} cfg.newLine
|
|
119
|
-
* @param {boolean} [cfg.oldIsCamel]
|
|
120
|
-
* @returns {Promise<void>}
|
|
121
|
-
*/
|
|
122
|
-
const replaceInOrder = async ({
|
|
123
|
-
path,
|
|
124
|
-
oldRegex,
|
|
125
|
-
checkName,
|
|
126
|
-
newLine,
|
|
127
|
-
oldIsCamel
|
|
128
|
-
}) => {
|
|
129
|
-
/**
|
|
130
|
-
* @typedef {number} Integer
|
|
131
|
-
*/
|
|
132
|
-
/**
|
|
133
|
-
* @typedef {{
|
|
134
|
-
* matchedLine: string,
|
|
135
|
-
* offset: Integer,
|
|
136
|
-
* oldRule: string,
|
|
137
|
-
* }} OffsetInfo
|
|
138
|
-
*/
|
|
139
|
-
/**
|
|
140
|
-
* @type {OffsetInfo[]}
|
|
141
|
-
*/
|
|
142
|
-
const offsets = [];
|
|
143
|
-
let readme = await _promises.default.readFile(path, 'utf8');
|
|
144
|
-
readme.replace(oldRegex,
|
|
145
|
-
/**
|
|
146
|
-
* @param {string} matchedLine
|
|
147
|
-
* @param {string} n1
|
|
148
|
-
* @param {Integer} offset
|
|
149
|
-
* @param {string} str
|
|
150
|
-
* @param {object} groups
|
|
151
|
-
* @param {string} groups.oldRule
|
|
152
|
-
* @returns {string}
|
|
153
|
-
*/
|
|
154
|
-
(matchedLine, n1, offset, str, {
|
|
155
|
-
oldRule
|
|
156
|
-
}) => {
|
|
157
|
-
offsets.push({
|
|
158
|
-
matchedLine,
|
|
159
|
-
offset,
|
|
160
|
-
oldRule
|
|
161
|
-
});
|
|
162
|
-
return matchedLine;
|
|
163
|
-
});
|
|
164
|
-
offsets.sort(({
|
|
165
|
-
oldRule
|
|
166
|
-
}, {
|
|
167
|
-
oldRule: oldRuleB
|
|
168
|
-
}) => {
|
|
169
|
-
return oldRule < oldRuleB ? -1 : oldRule > oldRuleB ? 1 : 0;
|
|
170
|
-
});
|
|
171
|
-
let alreadyIncluded = false;
|
|
172
|
-
const itemIndex = offsets.findIndex(({
|
|
173
|
-
oldRule
|
|
174
|
-
}) => {
|
|
175
|
-
alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;
|
|
176
|
-
return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;
|
|
177
|
-
});
|
|
178
|
-
let item = itemIndex !== undefined && offsets[itemIndex];
|
|
179
|
-
if (item && itemIndex === 0 &&
|
|
180
|
-
// This property would not always be sufficient but in this case it is.
|
|
181
|
-
oldIsCamel) {
|
|
182
|
-
item.offset = 0;
|
|
183
|
-
}
|
|
184
|
-
if (!item) {
|
|
185
|
-
item = /** @type {OffsetInfo} */offsets.pop();
|
|
186
|
-
item.offset += item.matchedLine.length;
|
|
187
|
-
}
|
|
188
|
-
if (alreadyIncluded) {
|
|
189
|
-
console.log(`Rule name is already present in ${checkName}.`);
|
|
190
|
-
} else {
|
|
191
|
-
readme = readme.slice(0, item.offset) + (item.offset ? '\n' : '') + newLine + (item.offset ? '' : '\n') + readme.slice(item.offset);
|
|
192
|
-
await _promises.default.writeFile(path, readme);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// await replaceInOrder({
|
|
197
|
-
// checkName: 'README',
|
|
198
|
-
// newLine: `{"gitdown": "include", "file": "./rules/${ruleName}.md"}`,
|
|
199
|
-
// oldRegex: /\n\{"gitdown": "include", "file": ".\/rules\/(?<oldRule>[^.]*).md"\}/gu,
|
|
200
|
-
// path: './.README/README.md',
|
|
201
|
-
// });
|
|
202
|
-
|
|
203
|
-
await replaceInOrder({
|
|
204
|
-
checkName: 'index import',
|
|
205
|
-
newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`,
|
|
206
|
-
oldIsCamel: true,
|
|
207
|
-
oldRegex: /\nimport (?<oldRule>[^ ]*) from '.\/rules\/\1';/gu,
|
|
208
|
-
path: './src/index.js'
|
|
209
|
-
});
|
|
210
|
-
await replaceInOrder({
|
|
211
|
-
checkName: 'index recommended',
|
|
212
|
-
newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\'off\''},`,
|
|
213
|
-
oldRegex: /\n\s{6}'jsdoc\/(?<oldRule>[^']*)': .*?,/gu,
|
|
214
|
-
path: './src/index.js'
|
|
215
|
-
});
|
|
216
|
-
await replaceInOrder({
|
|
217
|
-
checkName: 'index rules',
|
|
218
|
-
newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`,
|
|
219
|
-
oldRegex: /\n\s{4}'(?<oldRule>[^']*)': [^,]*,/gu,
|
|
220
|
-
path: './src/index.js'
|
|
221
|
-
});
|
|
222
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require('./generateDocs.js')));
|
|
223
|
-
|
|
224
|
-
/*
|
|
225
|
-
console.log('Paths to open for further editing\n');
|
|
226
|
-
console.log(`open ${ruleReadmePath}`);
|
|
227
|
-
console.log(`open ${rulePath}`);
|
|
228
|
-
console.log(`open ${ruleTestPath}\n`);
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
// Set chdir as somehow still in operation from other test
|
|
232
|
-
process.chdir((0, _path.resolve)(__dirname, '../../'));
|
|
233
|
-
await (0, _openEditor.default)([
|
|
234
|
-
// Could even add editor line column numbers like `${rulePath}:1:1`
|
|
235
|
-
ruleReadmePath, ruleTestPath, rulePath]);
|
|
236
|
-
})();
|
|
237
|
-
//# sourceMappingURL=generateRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRule.js","names":["_camelcase","_interopRequireDefault","require","_fs","_promises","_openEditor","_path","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ruleName","options","process","argv","recommended","includes","console","error","test","ruleNamesPath","ruleNames","JSON","parse","fs","readFile","push","sort","writeFile","stringify","log","ruleTemplate","camelCasedRuleName","camelCase","rulePath","existsSync","ruleTestTemplate","ruleTestPath","ruleReadmeTemplate","ruleReadmePath","replaceInOrder","path","oldRegex","checkName","newLine","oldIsCamel","offsets","readme","replace","matchedLine","n1","offset","str","oldRule","oldRuleB","alreadyIncluded","itemIndex","findIndex","item","undefined","pop","length","slice","repeat","Promise","resolve","then","chdir","__dirname","open"],"sources":["../../src/bin/generateRule.js"],"sourcesContent":["/* eslint-disable no-console -- CLI */\n\n/**\n * @example\n *\n * ```shell\n * npm run create-rule my-new-rule -- --recommended\n * ```\n */\n\nimport camelCase from 'camelcase';\nimport {\n existsSync,\n} from 'fs';\nimport fs from 'fs/promises';\nimport open from 'open-editor';\nimport {\n resolve,\n} from 'path';\n\n// Todo: Would ideally have prompts, e.g., to ask for whether\n// type was problem/layout, etc.\n\nconst [\n , , ruleName,\n ...options\n] = process.argv;\n\nconst recommended = options.includes('--recommended');\n\n(async () => {\n if (!ruleName) {\n console.error('Please supply a rule name');\n\n return;\n }\n\n if ((/[A-Z]/u).test(ruleName)) {\n console.error('Please ensure the rule has no capital letters');\n\n return;\n }\n\n const ruleNamesPath = './test/rules/ruleNames.json';\n // @ts-expect-error Older types?\n const ruleNames = JSON.parse(await fs.readFile(\n ruleNamesPath,\n ));\n if (!ruleNames.includes(ruleName)) {\n ruleNames.push(ruleName);\n ruleNames.sort();\n }\n\n await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\\n');\n console.log('ruleNames', ruleNames);\n\n const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n // Rule here\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n // Option properties here (or remove the object)\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n`;\n\n const camelCasedRuleName = camelCase(ruleName);\n\n const rulePath = `./src/rules/${camelCasedRuleName}.js`;\n\n if (!existsSync(rulePath)) {\n await fs.writeFile(rulePath, ruleTemplate);\n }\n\n const ruleTestTemplate = `export default {\n invalid: [\n {\n code: \\`\n \\`,\n errors: [\n {\n line: 2,\n message: '',\n },\n ],\n },\n ],\n valid: [\n {\n code: \\`\n \\`,\n },\n ],\n};\n`;\n\n const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;\n if (!existsSync(ruleTestPath)) {\n await fs.writeFile(ruleTestPath, ruleTestTemplate);\n }\n\n const ruleReadmeTemplate = `### \\`${ruleName}\\`\n\n|||\n|---|---|\n|Context|everywhere|\n|Tags|\\`\\`|\n|Recommended|${recommended ? 'true' : 'false'}|\n|Settings||\n|Options||\n\n<!-- assertions ${camelCasedRuleName} -->\n`;\n\n const ruleReadmePath = `./.README/rules/${ruleName}.md`;\n if (!existsSync(ruleReadmePath)) {\n await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);\n }\n\n /**\n * @param {object} cfg\n * @param {string} cfg.path\n * @param {RegExp} cfg.oldRegex\n * @param {string} cfg.checkName\n * @param {string} cfg.newLine\n * @param {boolean} [cfg.oldIsCamel]\n * @returns {Promise<void>}\n */\n const replaceInOrder = async ({\n path,\n oldRegex,\n checkName,\n newLine,\n oldIsCamel,\n }) => {\n /**\n * @typedef {number} Integer\n */\n /**\n * @typedef {{\n * matchedLine: string,\n * offset: Integer,\n * oldRule: string,\n * }} OffsetInfo\n */\n /**\n * @type {OffsetInfo[]}\n */\n const offsets = [];\n\n let readme = await fs.readFile(path, 'utf8');\n readme.replace(\n oldRegex,\n /**\n * @param {string} matchedLine\n * @param {string} n1\n * @param {Integer} offset\n * @param {string} str\n * @param {object} groups\n * @param {string} groups.oldRule\n * @returns {string}\n */\n (matchedLine, n1, offset, str, {\n oldRule,\n }) => {\n offsets.push({\n matchedLine,\n offset,\n oldRule,\n });\n\n return matchedLine;\n },\n );\n\n offsets.sort(({\n oldRule,\n }, {\n oldRule: oldRuleB,\n }) => {\n return oldRule < oldRuleB ? -1 : (oldRule > oldRuleB ? 1 : 0);\n });\n\n let alreadyIncluded = false;\n const itemIndex = offsets.findIndex(({\n oldRule,\n }) => {\n alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;\n\n return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;\n });\n let item = itemIndex !== undefined && offsets[itemIndex];\n if (item && itemIndex === 0 &&\n\n // This property would not always be sufficient but in this case it is.\n oldIsCamel\n ) {\n item.offset = 0;\n }\n\n if (!item) {\n item = /** @type {OffsetInfo} */ (offsets.pop());\n item.offset += item.matchedLine.length;\n }\n\n if (alreadyIncluded) {\n console.log(`Rule name is already present in ${checkName}.`);\n } else {\n readme = readme.slice(0, item.offset) +\n (item.offset ? '\\n' : '') +\n newLine +\n (item.offset ? '' : '\\n') +\n readme.slice(item.offset);\n\n await fs.writeFile(path, readme);\n }\n };\n\n // await replaceInOrder({\n // checkName: 'README',\n // newLine: `{\"gitdown\": \"include\", \"file\": \"./rules/${ruleName}.md\"}`,\n // oldRegex: /\\n\\{\"gitdown\": \"include\", \"file\": \".\\/rules\\/(?<oldRule>[^.]*).md\"\\}/gu,\n // path: './.README/README.md',\n // });\n\n await replaceInOrder({\n checkName: 'index import',\n newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`,\n oldIsCamel: true,\n oldRegex: /\\nimport (?<oldRule>[^ ]*) from '.\\/rules\\/\\1';/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index recommended',\n newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\\'off\\''},`,\n oldRegex: /\\n\\s{6}'jsdoc\\/(?<oldRule>[^']*)': .*?,/gu,\n path: './src/index.js',\n });\n\n await replaceInOrder({\n checkName: 'index rules',\n newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`,\n oldRegex: /\\n\\s{4}'(?<oldRule>[^']*)': [^,]*,/gu,\n path: './src/index.js',\n });\n\n await import('./generateDocs.js');\n\n /*\n console.log('Paths to open for further editing\\n');\n console.log(`open ${ruleReadmePath}`);\n console.log(`open ${rulePath}`);\n console.log(`open ${ruleTestPath}\\n`);\n */\n\n // Set chdir as somehow still in operation from other test\n process.chdir(resolve(__dirname, '../../'));\n await open([\n // Could even add editor line column numbers like `${rulePath}:1:1`\n ruleReadmePath,\n ruleTestPath,\n rulePath,\n ]);\n})();\n"],"mappings":";;AAUA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEc,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAR,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAS,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAA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