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

fix(eslint-plugin): use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array #1728

Merged
merged 3 commits into from Apr 13, 2020
Merged

fix(eslint-plugin): use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array #1728

merged 3 commits into from Apr 13, 2020

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Mar 13, 2020

Based on discussion here, which was broken out into #1721.

I've not yet checked the rest of the rules for possible refactoring.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @G-Rath!

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.

@bradzacher bradzacher added the refactor PRs that refactor code only label Mar 13, 2020
@G-Rath G-Rath changed the title require-array-sort-compare: use utility for is array check use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array Mar 14, 2020
@bradzacher bradzacher changed the title use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array chore(eslint-plugin): use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array Mar 14, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #1728 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1728      +/-   ##
==========================================
- Coverage   94.48%   94.48%   -0.01%     
==========================================
  Files         162      162              
  Lines        7494     7484      -10     
  Branches     2151     2146       -5     
==========================================
- Hits         7081     7071      -10     
  Misses        178      178              
  Partials      235      235              
Flag Coverage Δ
#unittest 94.48% <100.00%> (-0.01%) ⬇️
Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/no-for-in-array.ts 100.00% <100.00%> (ø)
packages/eslint-plugin/src/rules/no-unsafe-call.ts 100.00% <100.00%> (ø)
...ckages/eslint-plugin/src/rules/no-unsafe-return.ts 95.00% <100.00%> (ø)
...int-plugin/src/rules/require-array-sort-compare.ts 100.00% <100.00%> (ø)
.../eslint-plugin/src/rules/restrict-plus-operands.ts 100.00% <100.00%> (ø)
...-plugin/src/rules/restrict-template-expressions.ts 100.00% <100.00%> (ø)
packages/eslint-plugin/src/util/types.ts 81.59% <100.00%> (+0.58%) ⬆️

bradzacher
bradzacher previously approved these changes Apr 12, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

I should probably build a lint rule to suggest against:

  • getTypeAtLocation in favour of getConstrainedTypeAtLocation, and
  • isArrayType in favour of isTypeArrayTypeOrUnionOfArrayTypes

@bradzacher
Copy link
Member

Linting again 😅

@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Apr 12, 2020
@G-Rath G-Rath requested a review from bradzacher April 13, 2020 00:51
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Apr 13, 2020
@bradzacher bradzacher changed the title chore(eslint-plugin): use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array fix(eslint-plugin): use isTypeArrayTypeOrUnionOfArrayTypes util for checking if type is array Apr 13, 2020
@bradzacher bradzacher added the bug Something isn't working label Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working refactor PRs that refactor code only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants