Skip to content
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] split property and method selectors into more granular classXXX, objectLiteralXXX, typeXXX #2807

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Nov 24, 2020

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

…` 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`
@bradzacher bradzacher added the enhancement: plugin rule option New rule option for an existing eslint-plugin rule label Nov 24, 2020
@typescript-eslint
Copy link
Contributor

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
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #2807 (966730a) into master (a8227a6) will increase coverage by 0.01%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master    #2807      +/-   ##
==========================================
+ Coverage   92.76%   92.78%   +0.01%     
==========================================
  Files         301      301              
  Lines       10150    10159       +9     
  Branches     2870     2870              
==========================================
+ Hits         9416     9426      +10     
  Misses        345      345              
+ Partials      389      388       -1     
Flag Coverage Δ
unittest 92.78% <93.75%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 89.81% <93.75%> (+0.51%) ⬆️

@bradzacher bradzacher merged commit 665b6d4 into master Nov 24, 2020
@bradzacher bradzacher deleted the naming-convention-split-property-and-method branch November 24, 2020 19:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[naming-convention] method selector limits ability to control format of properties (vs memberLike)
1 participant