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): [prefer-optional-chain] handling first member expression #2156

Merged
merged 5 commits into from Jun 2, 2020
Merged

fix(eslint-plugin): [prefer-optional-chain] handling first member expression #2156

merged 5 commits into from Jun 2, 2020

Conversation

yeonjuan
Copy link
Contributor

@yeonjuan yeonjuan commented Jun 2, 2020

There is a false negative when member expression comes first.

foo.bar && foo.bar.baz;  // no error

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @yeonjuan!

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 Jun 2, 2020

Codecov Report

Merging #2156 into master will decrease coverage by 0.05%.
The diff coverage is 41.66%.

@@            Coverage Diff             @@
##           master    #2156      +/-   ##
==========================================
- Coverage   93.56%   93.50%   -0.06%     
==========================================
  Files         171      171              
  Lines        7811     7809       -2     
  Branches     2229     2229              
==========================================
- Hits         7308     7302       -6     
+ Misses        244      243       -1     
- Partials      259      264       +5     
Flag Coverage Δ
#unittest 93.50% <41.66%> (-0.06%) ⬇️
Impacted Files Coverage Δ
packages/eslint-plugin-tslint/src/rules/config.ts 97.36% <0.00%> (-2.64%) ⬇️
...nt-plugin/src/rules/indent-new-do-not-use/index.ts 98.13% <0.00%> (-0.27%) ⬇️
...es/eslint-plugin/src/rules/no-use-before-define.ts 97.14% <0.00%> (-1.43%) ⬇️
...s/eslint-plugin/src/rules/prefer-optional-chain.ts 95.09% <ø> (ø)
.../experimental-utils/src/eslint-utils/RuleTester.ts 9.09% <0.00%> (+0.20%) ⬆️
packages/parser/src/analyze-scope.ts 95.13% <0.00%> (-0.38%) ⬇️
...pt-estree/src/create-program/createWatchProgram.ts 78.60% <0.00%> (ø)
...kages/eslint-plugin/src/rules/no-empty-function.ts 84.00% <50.00%> (-4.47%) ⬇️
...t-plugin/src/rules/adjacent-overload-signatures.ts 93.02% <100.00%> (ø)
packages/eslint-plugin/src/rules/array-type.ts 94.28% <100.00%> (ø)
... and 1 more

@yeonjuan yeonjuan closed this Jun 2, 2020
@yeonjuan yeonjuan deleted the prefer-oc-memfirst branch June 2, 2020 12:49
@yeonjuan yeonjuan restored the prefer-oc-memfirst branch June 2, 2020 12:59
@yeonjuan yeonjuan reopened this Jun 2, 2020
@yeonjuan
Copy link
Contributor Author

yeonjuan commented Jun 2, 2020

It seems to affect the current code.
I'm not sure the ignoring first member expression is bug or not. If it's a bug I'll change them base on this PR.

@yeonjuan yeonjuan changed the title fix(eslint-plugin): [prefer-optional-chain] handling first member exp fix(eslint-plugin): [prefer-optional-chain] handling first member expression Jun 2, 2020
@bradzacher bradzacher added the bug Something isn't working label Jun 2, 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 - thanks!

@bradzacher bradzacher merged commit de18660 into typescript-eslint:master Jun 2, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants