Skip to content

Commit c4079b8

Browse files
committed
feat(no-types, implements-on-classes): add contexts option which if set to any will allow checking of virtual functions
1 parent 7500b00 commit c4079b8

File tree

9 files changed

+448
-46
lines changed

9 files changed

+448
-46
lines changed

.README/rules/implements-on-classes.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@ To indicate that a function follows another function's signature, one might
99
instead use `@type` to indicate the `@function` or `@callback` to which the
1010
funciton is adhering.
1111

12+
#### Options
13+
14+
##### `contexts`
15+
16+
Set this to an array of strings representing the AST context
17+
where you wish the rule to be applied.
18+
Overrides the default contexts (see below). Set to `"any"` if you want
19+
the rule to apply to any jsdoc block throughout your files (as is necessary
20+
for finding function blocks not attached to a function declaration or
21+
expression, i.e., `@callback` or `@function` (or its aliases `@func` or
22+
`@method`) (including those associated with an `@interface`).
23+
1224
|||
1325
|---|---|
14-
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
26+
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
1527
|Tags|`implements` (prevented)|
1628

1729
<!-- assertions implementsOnClasses -->

.README/rules/no-types.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@ This rule reports types being used on `@param` or `@returns`.
55
The rule is intended to prevent the indication of types on tags where
66
the type information would be redundant with TypeScript.
77

8+
#### Options
9+
10+
##### `contexts`
11+
12+
Set this to an array of strings representing the AST context
13+
where you wish the rule to be applied.
14+
Overrides the default contexts (see below). Set to `"any"` if you want
15+
the rule to apply to any jsdoc block throughout your files (as is necessary
16+
for finding function blocks not attached to a function declaration or
17+
expression, i.e., `@callback` or `@function` (or its aliases `@func` or
18+
`@method`) (including those associated with an `@interface`).
19+
820
|||
921
|---|---|
10-
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
22+
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
1123
|Tags|`param`, `returns`|
1224
|Aliases|`arg`, `argument`, `return`|
1325

0 commit comments

Comments
 (0)