Open EvgenyOrekhov opened 1 year ago
BTW, method-signature-style
rule uses function property style by default, so function property style might be more common.
I am not sure whether the plugin should enforce this behavior or not. There already is propertyType
to achieve pretty much the same thing in a configurable way:
{
order: [
'[properties]'
{ type: 'property', propertyType: '...' }
'[methods]'
]
}
However, it does not seem to work with interfaces as it is. I will try to create a PR to fix this soon.
Hello @EvgenyOrekhov! My PR was just merged and released as part of v1.21.0. Does it solve your issue?
There are 2 notations for methods:
baz(): string
baz: () => string
sortInterfaces: true
works with shorthand method signature, but not with function property signature.Minimal reproducible case:
Expected: warning "Expected property bar to come before method baz"
Actual: no warning