Closed
Description
The titles a bit average, but this relates a bit to #1475.
Basically, because of the overlap of memberLike
& method
, it's not possible to have allow properties that are assigned functions to have the PascelCase
format without allowing public methods on classes to have that format too.
Repro
{
"rules": {
"@typescript-eslint/naming-convention": ["error",
{ "selector": "memberLike", "format": ["camelCase"] },
{ "selector": "property", "format": ["camelCase", "PascalCase"] }
]
}
}
class MyClass {
public MyMethod(): void {
//
}
}
const o = {
Literal(node): void {
//
}
};
Expected Result
MyClass#MyMethod
is flagged as not being camelcase, while o#Literal
is fine.
Actual Result
Both MyMethod
& Literal
are flagged as not being in camelcase.
Additional Info
Versions
Also tried against canary.
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.16.0 |
@typescript-eslint/parser |
2.16.0 |
TypeScript |
3.7.5 |
ESLint |
6.8.0 |
node |
12.14.1 |
npm |
6.13.6 |