-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@shopify/eslint-plugin: merge typescript naming convention rules #247
Conversation
@@ -131,6 +131,19 @@ module.exports = { | |||
selector: 'typeLike', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the --print-config
CLI arg to log out the eslint rules our repo used before the recent changes
I confirmed that the rules for typescript-eslint/naming-convention
matched those in this file, so merging the two rule sets together seems like our best bet
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": [
"camelCase",
"PascalCase",
"UPPER_CASE"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "default",
"filter": {
"match": true,
"regex": "^(__|UNSAFE_).+$"
},
"format": null
},
{
"selector": "typeLike",
"format": [
"PascalCase"
]
}
],
prefix: ['T'], | ||
}, | ||
{ | ||
selector: 'interface', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Seems like the old rule was being overwritten hence the revert on what was valid. No 🎩 yet.
2569a96
to
04548f6
Compare
@@ -7,6 +7,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | |||
|
|||
<!-- ## Unreleased --> | |||
|
|||
### Changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vsumner !
Description
While upgrading to v40.2.2, we noticed some changes in the
@typescript-eslint/naming-convention
rule.Some of the recent changes around enforcing T prefixes for generic types might have loosened up other checks.
These previously invalid declarations all became valid in ts/tsx files:
Type of change
This PR merges the two
@typescript-eslint/naming-convention
rules together to restore the previous config.Checklist