You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/no-expression-statements.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@ This rule accepts an options object of the following type:
60
60
typeOptions= {
61
61
ignorePattern?:string[] |string;
62
62
ignoreVoid?:boolean;
63
+
ignoreSelfReturning?:boolean;
63
64
};
64
65
```
65
66
@@ -68,13 +69,20 @@ type Options = {
68
69
```ts
69
70
const defaults = {
70
71
ignoreVoid: false,
72
+
ignoreSelfReturning: false,
71
73
};
72
74
```
73
75
74
76
### `ignoreVoid`
75
77
76
78
When enabled, expression of type void are not flagged as violations. This options requires TypeScript in order to work.
77
79
80
+
### `ignoreSelfReturning`
81
+
82
+
Like `ignoreVoid` but instead does not flag function calls that always only return `this`.
83
+
84
+
Limitation: The function declaration must explicitly use `return this`; equivalents (such as assign this to a variable first, that is then returned) won't be considered valid.
85
+
78
86
### `ignorePattern`
79
87
80
88
This option takes a RegExp string or an array of RegExp strings.
0 commit comments