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
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,24 @@ const foo1 = () => {};
104
104
105
105
:::
106
106
107
+
Overloaded function declarations are not reported as errors by this rule. These are functions that have multiple declarations with the same name but different parameter types or return types (commonly used in TypeScript to provide type information for different ways of calling the same function).
108
+
109
+
Examples of **correct** TypeScript code for this rule with the default `"expression"` option:
110
+
111
+
::: correct
112
+
113
+
```ts
114
+
/*eslint func-style: ["error", "expression"]*/
115
+
116
+
function process(value:string):string;
117
+
function process(value:number):number;
118
+
function process(value:unknown) {
119
+
returnvalue;
120
+
}
121
+
```
122
+
123
+
:::
124
+
107
125
### declaration
108
126
109
127
Examples of **incorrect** code for this rule with the `"declaration"` option:
0 commit comments