Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): [prefer-optional-chain] suggests optional chaining during strict null equality check#8717

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

jsfm01
Copy link
Contributor

@jsfm01jsfm01 commentedMar 18, 2024
edited
Loading

PR Checklist

Overview

The rule suggests replacing logical AND operators (&&) with optional chaining (?.) for checking both object reference and property existence.

However, this substitution can unintentionally alter code logic, especially when separate checks for object existence and property values are needed.
The solution provided skips cases involving strict null equality for these particular cases preventing unintended changes to code logic.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@jsfm01!

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 onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedMar 18, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit27f7269
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/66282f5cc767350008154c24
😎 Deploy Previewhttps://deploy-preview-8717--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@jsfm01jsfm01 marked this pull request as draftMarch 18, 2024 21:59
@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedMar 18, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit27f7269. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@jsfm01jsfm01 marked this pull request as ready for reviewMarch 22, 2024 15:54
@up201304504up201304504force-pushed thefix/7654-prefer-optional-chain branch fromceab321 to6fb2f03CompareMarch 31, 2024 17:23
@bradzacherbradzacher added the bugSomething isn't working labelApr 4, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesApr 8, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg 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! 🎉

Leaving open for a bit since these nullability rules can get tricky. See also:#8559.

@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelApr 8, 2024
@codecovCodecov
Copy link

codecovbot commentedApr 22, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.37%. Comparing base(b0f7aa4) to head(ef31674).

❗ Current headef31674 differs from pull request most recent head27f7269. Consider uploading reports for the commit27f7269 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@##             main    #8717      +/-   ##==========================================- Coverage   87.38%   87.37%   -0.02%==========================================  Files         259      255       -4       Lines       12581    12503      -78       Branches     3930     3925       -5     ==========================================- Hits        10994    10924      -70+ Misses       1313     1304       -9- Partials      274      275       +1
FlagCoverage Δ
unittest87.37% <100.00%> (-0.02%)⬇️

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

FilesCoverage Δ
.../rules/prefer-optional-chain-utils/analyzeChain.ts100.00% <100.00%> (ø)
...s/eslint-plugin/src/rules/prefer-optional-chain.ts97.56% <ø> (-0.06%)⬇️

... and30 files with indirect coverage changes

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesApr 23, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Swell, thanks!

up201304504 reacted with rocket emoji
@JoshuaKGoldbergJoshuaKGoldberg merged commit4bed24d intotypescript-eslint:mainApr 24, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMay 2, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@up201304504up201304504up201304504 left review comments

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we mergebugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: prefer-optional-chain suggests optional chaining during strict null equality check
4 participants
@jsfm01@JoshuaKGoldberg@up201304504@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp