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/src/rules/func-style.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ This rule has a string option:
64
64
This rule has an object option for two exceptions:
65
65
66
66
*`"allowArrowFunctions"`: `true` (default `false`) allows the use of arrow functions. This option applies only when the string option is set to `"declaration"` (arrow functions are always allowed when the string option is set to `"expression"`, regardless of this option)
67
+
*`"allowTypeAnnotation"`: `true` (default `false`) allows the use of function expressions and arrow functions when the variable declaration has type annotation, regardless of the `allowArrowFunctions` option. This option applies only when the string option is set to `"declaration"`. (TypeScript only)
67
68
*`"overrides"`:
68
69
*`"namedExports": "expression" | "declaration" | "ignore"`: used to override function styles in named exports
69
70
* `"expression"`: like string option
@@ -173,6 +174,24 @@ const foo = () => {};
173
174
174
175
:::
175
176
177
+
### allowTypeAnnotation
178
+
179
+
Examples of **correct** TypeScript code for this rule with the `"declaration", { "allowTypeAnnotation": true }` options:
0 commit comments