Skip to content

Commit

Permalink
Revert "feat: add a global option for checking constructors, getters …
Browse files Browse the repository at this point in the history
…or setters and remove `avoidExampleOnConstructors` option."

This reverts commit 49f106c.
  • Loading branch information
brettz9 committed Apr 20, 2020
1 parent 49f106c commit 5c8ef9f
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 909 deletions.
17 changes: 7 additions & 10 deletions .README/rules/require-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ An options object may have any of the following properties:
- `descriptionStyle` - Whether to accept implicit descriptions (`"body"`) or
`@description` tags (`"tag"`) as satisfying the rule. Set to `"any"` to
accept either style. Defaults to `"body"`.
- `checkConstructors` - A value indicating whether `constructor`s should be checked. Defaults to `true`.
- `checkGetters` - A value indicating whether getters should be checked. Defaults to `true`.
- `checkSetters` - A value indicating whether getters should be checked. Defaults to `true`.

| | |
| -------- | ------------------------------------------------------------------------------------------------------------- |
| Context | `ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled |
| Tags | `description` or jsdoc block |
| Aliases | `desc` |
| Options | `contexts`, `exemptedBy`, `descriptionStyle`, `checkConstructors`, `checkGetters`, `checkSetters` |
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|||
|---|---|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|Tags|`description` or jsdoc block|
|Aliases|`desc`|
|Options|`contexts`, `exemptedBy`, `descriptionStyle`|
|Settings|`overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|

<!-- assertions requireDescription -->
18 changes: 6 additions & 12 deletions .README/rules/require-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,19 @@ block avoids the need for an `@example`. Defaults to an array with
so be sure to add back `inheritdoc` if you wish its presence to cause
exemption of the rule.

##### `avoidExampleOnConstructors`

Set to `true` to avoid the need for an example on a constructor (whether
indicated as such by a jsdoc tag or by being within an ES6 `class`).
Defaults to `false`.

##### `contexts`

Set this to an array of strings representing the AST context
where you wish the rule to be applied (e.g., `ClassDeclaration` for ES6 classes).
Overrides the default contexts (see below). Set to `"any"` if you want
the rule to apply to any jsdoc block throughout your files.

##### `checkConstructors`

A value indicating whether `constructor`s should be checked. Defaults to `true`.

##### `checkGetters`

A value indicating whether getters should be checked. Defaults to `false`.

##### `checkSetters`

A value indicating whether getters should be checked. Defaults to `false`.

#### Fixer

The fixer for `require-example` will add an empty `@example`, but it will still
Expand Down
26 changes: 7 additions & 19 deletions .README/rules/require-param.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,12 @@ contexts (see below). May be useful for adding such as
`TSMethodSignature` in TypeScript or restricting the contexts
which are checked.

##### `checkConstructors`

A value indicating whether `constructor`s should be checked. Defaults to `true`.

##### `checkGetters`

A value indicating whether getters should be checked. Defaults to `false`.

##### `checkSetters`

A value indicating whether getters should be checked. Defaults to `false`.

| | |
| -------- | ------------------------------------------------------------------------------------------------------------- |
| Context | `ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled |
| Tags | `param` |
| Aliases | `arg`, `argument` |
| Options | `contexts`, `exemptedBy`, `checkConstructors`, `checkGetters`, `checkSetters` |
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|||
|---|---|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|Tags|`param`|
|Aliases|`arg`, `argument`|
|Options|`contexts`, `exemptedBy`|
|Settings|`overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|

<!-- assertions requireParam -->
16 changes: 7 additions & 9 deletions .README/rules/require-returns.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Will also report if multiple `@returns` tags are present.

#### Options

- `checkConstructors` - A value indicating whether `constructor`s should
be checked for `@returns` tags. Defaults to `false`.
- `checkGetters` - Boolean to determine whether getter methods should
be checked for `@returns` tags. Defaults to `true`.
- `exemptedBy` - Array of tags (e.g., `['type']`) whose presence on the document
Expand Down Expand Up @@ -42,12 +40,12 @@ Will also report if multiple `@returns` tags are present.
'jsdoc/require-returns': ['error', {forceReturnsWithAsync: true}]
```

| | |
| -------- | ------------------------------------------------------------------------------------------------------------- |
| Context | `ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled |
| Tags | `returns` |
| Aliases | `return` |
| Options | `checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync` |
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|||
|---|---|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|Tags|`returns`|
|Aliases|`return`|
|Options|`checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync`|
|Settings|`overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|

<!-- assertions requireReturns -->
Loading

0 comments on commit 5c8ef9f

Please sign in to comment.