Enforce using a particular method signature syntax.
There are two ways to define an object/interface function property: property, using property signature for functions; method, using method signature for functions.
This rule applies only to .js and .ts files.
// code-linter.json5
{
"rules": {
"@typescript-eslint/method-signature-style": "error"
}
} // By default, the property syntax is used.
export interface T1 {
func: (arg: string) => number;
} // By default, the property syntax is used.
export interface T1 {
func(arg: string): number;
} plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.