Skip to content

Commit

Permalink
feat(no-types, implements-on-classes): add contexts option whic…
Browse files Browse the repository at this point in the history
…h if set to `any` will allow checking of virtual functions
  • Loading branch information
brettz9 committed Dec 31, 2019
1 parent 7500b00 commit c4079b8
Show file tree
Hide file tree
Showing 9 changed files with 448 additions and 46 deletions.
14 changes: 13 additions & 1 deletion .README/rules/implements-on-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@ To indicate that a function follows another function's signature, one might
instead use `@type` to indicate the `@function` or `@callback` to which the
funciton is adhering.

#### Options

##### `contexts`

Set this to an array of strings representing the AST context
where you wish the rule to be applied.
Overrides the default contexts (see below). Set to `"any"` if you want
the rule to apply to any jsdoc block throughout your files (as is necessary
for finding function blocks not attached to a function declaration or
expression, i.e., `@callback` or `@function` (or its aliases `@func` or
`@method`) (including those associated with an `@interface`).

|||
|---|---|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|Tags|`implements` (prevented)|

<!-- assertions implementsOnClasses -->
14 changes: 13 additions & 1 deletion .README/rules/no-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ This rule reports types being used on `@param` or `@returns`.
The rule is intended to prevent the indication of types on tags where
the type information would be redundant with TypeScript.

#### Options

##### `contexts`

Set this to an array of strings representing the AST context
where you wish the rule to be applied.
Overrides the default contexts (see below). Set to `"any"` if you want
the rule to apply to any jsdoc block throughout your files (as is necessary
for finding function blocks not attached to a function declaration or
expression, i.e., `@callback` or `@function` (or its aliases `@func` or
`@method`) (including those associated with an `@interface`).

|||
|---|---|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
|Tags|`param`, `returns`|
|Aliases|`arg`, `argument`, `return`|

Expand Down

0 comments on commit c4079b8

Please sign in to comment.