-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
{
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "memberLike",
"format": ["camelCase"]
},
{
"selector": "property",
"format": ["camelCase", "PascalCase"]
}
]
}
}
const foo = { MyProperty: 42 };
Expected Result
Because typescript-eslint 4.8.2 doesn't report error for this, I expect typescript-eslint 4.9.x also doesn't report error.
Actual Result
The following error is reported.
1:15 error Object Literal Property name `MyProperty` must match one of the following formats: camelCase @typescript-eslint/naming-convention
Previously property
had a higher precedence than memberLike
, but it is now a meta selector and the precedence seems to be lower (ref: #2807).
I know it works as expected if I use "selector": ["classProperty", "objectLiteralProperty", "typeProperty"]
instead of "selector": "property"
, but I report this issue because it feels like a breaking change in a minor upgrade for me.
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.9.1 |
@typescript-eslint/parser |
4.9.1 |
TypeScript |
4.1.2 |
ESLint |
7.15.0 |
node |
14.6.0 |
CarsonF
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin