-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(eslint-plugin): [naming-convention] add modifiers exported
, global
, and destructured
modifiers - add selectors classProperty
, objectLiteralProperty
, typeProperty
, classMethod
, objectLiteralMethod
, typeMethod
#2802
feat(eslint-plugin): [naming-convention] add modifiers exported
, global
, and destructured
modifiers - add selectors classProperty
, objectLiteralProperty
, typeProperty
, classMethod
, objectLiteralMethod
, typeMethod
#2802
Conversation
Thanks for the PR, @bradzacher! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Codecov Report
@@ Coverage Diff @@
## master #2802 +/- ##
==========================================
- Coverage 92.80% 92.75% -0.06%
==========================================
Files 300 301 +1
Lines 9857 10189 +332
Branches 2769 2889 +120
==========================================
+ Hits 9148 9451 +303
- Misses 332 341 +9
- Partials 377 397 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
TODO
- add example for disabling naming convention for destructured variables.
- fix destructured applying to names that aren't directly destructured names:
const {
a, // a should be matched
b = 2, // b should be matched
c: d, // c should be ignored, d should not be matched
e: f = 3, // e should be ignored, f should not not be matched
};
cbac387
to
5323fff
Compare
…lobal`, and `destructured` modifiers - add selectors `classProperty`, `objectLiteralProperty`, `typeProperty`, `classMethod`, `objectLiteralMethod`, `typeMethod` Fixes #2239 Fixes #2512 Fixes #2318 Fixes #1477 Big update to add a bunch of stuff. I couldn't be bothered splitting this out into separate PRs. Adds the following modifiers: - `exported` - matches anything that is exported from the module. - `global` - matches a variable/function declared in the top-level scope. - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, ignored: y, z = 2}`). Adds the following selectors (self explanatory - just breaking the selectors up): - `classProperty` - `objectLiteralProperty` - `typeProperty` - `classMethod` - `objectLiteralMethod` - `typeMethod` Converts - `property` to a meta selector for `classProperty`, `objectLiteralProperty`, `typeProperty` - `method` to a meta selector for `classMethod`, `objectLiteralMethod`, `typeMethod`
5323fff
to
3c91b53
Compare
I'm going to split this for commit cleanliness |
…` selectors into more granular `classXXX`, `objectLiteralXXX`, `typeXXX` Fixes #1477 Closes #2802 This allows users to target different types of properties differently. Adds the following selectors (self explanatory - just breaking the selectors up): - `classProperty` - `objectLiteralProperty` - `typeProperty` - `classMethod` - `objectLiteralMethod` - `typeMethod` Converts - `property` to a meta selector for `classProperty`, `objectLiteralProperty`, `typeProperty` - `method` to a meta selector for `classMethod`, `objectLiteralMethod`, `typeMethod`
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #2802 Adds the following modifiers: - `exported` - matches anything that is exported from the module. - `global` - matches a variable/function declared in the top-level scope. - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, ignored: y, z = 2}`).
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #2802 Adds the following modifiers: - `exported` - matches anything that is exported from the module. - `global` - matches a variable/function declared in the top-level scope. - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
…` selectors into more granular `classXXX`, `objectLiteralXXX`, `typeXXX` (#2807) Fixes #1477 Closes #2802 This allows users to target different types of properties differently. Adds the following selectors (self explanatory - just breaking the selectors up): - `classProperty` - `objectLiteralProperty` - `typeProperty` - `classMethod` - `objectLiteralMethod` - `typeMethod` For backwards compatibility, also converts - `property` to a meta selector for `classProperty`, `objectLiteralProperty`, `typeProperty` - `method` to a meta selector for `classMethod`, `objectLiteralMethod`, `typeMethod`
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #2802 Adds the following modifiers: - `exported` - matches anything that is exported from the module. - `global` - matches a variable/function declared in the top-level scope. - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
…lobal`, and `destructured` (#2808) Fixes #2239 Fixes #2512 Fixes #2318 Closes #2802 Adds the following modifiers: - `exported` - matches anything that is exported from the module. - `global` - matches a variable/function declared in the top-level scope. - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
Fixes #2239
Fixes #2512
Fixes #2318
Fixes #1477
Closes #2691
Big update to add a bunch of stuff.
I couldn't be bothered splitting this out into separate PRs.
Adds the following modifiers:
exported
- matches anything that is exported from the module.global
- matches a variable/function declared in the top-level scope.destructured
- matches a variable declared via an object destructuring pattern (const {x, ignored: y, z = 2}
).Adds the following selectors (self explanatory - just breaking the selectors up):
classProperty
objectLiteralProperty
typeProperty
classMethod
objectLiteralMethod
typeMethod
Converts
property
to a meta selector forclassProperty
,objectLiteralProperty
,typeProperty
method
to a meta selector forclassMethod
,objectLiteralMethod
,typeMethod