Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(typescript-estree): add missing type guards to node utils #3102

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

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

armano2
Copy link
Collaborator

@armano2 armano2 commented Feb 24, 2021

This PR adds few missing typeguards to node utility functions

@armano2 armano2 added the package: typescript-estree Issues related to @typescript-eslint/typescript-estree label Feb 24, 2021
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @armano2!

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 Feb 24, 2021

Codecov Report

Merging #3102 (6f075a0) into master (66dc285) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3102      +/-   ##
==========================================
- Coverage   92.87%   92.87%   -0.01%     
==========================================
  Files         314      314              
  Lines       10672    10670       -2     
  Branches     3027     3026       -1     
==========================================
- Hits         9912     9910       -2     
  Misses        344      344              
  Partials      416      416              
Flag Coverage Δ
unittest 92.87% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
packages/typescript-estree/src/node-utils.ts 97.75% <100.00%> (-0.03%) ⬇️

Comment on lines +478 to +482
return (
isChainExpression(child) &&
// (x?.y).z is semantically different, and as such .z is no longer optional
node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression
) {
return true;
}

return false;
);
Copy link
Collaborator Author

@armano2 armano2 Feb 24, 2021

Choose a reason for hiding this comment

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

coverage changed, this change reduces cyclomatic complexity of this function

@armano2 armano2 merged commit 0c0ca4a into master Feb 24, 2021
@armano2 armano2 deleted the refactor/typescript-estree-node-utils branch February 24, 2021 02:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants