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): [prefer-optional-chain] use type checking for strict falsiness #6240

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Dec 17, 2022

BREAKING CHANGE:
Adds type checking to prefer-optional-chain

PR Checklist

Overview

Uses the type checker to skip reporting a complaint when the original expression includes a falsy value that isn't undefined.

Also adds a looseFalsiness flag to allow the old, faster behavior.

Streamlines the test file because autogenerated tests are giving me headaches.

@nx-cloud
Copy link

nx-cloud bot commented Dec 17, 2022

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

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.

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 8d847e3
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64185a1f257dd80008580a56
😎 Deploy Preview https://deploy-preview-6240--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft December 17, 2022 23:21
@codecov
Copy link

codecov bot commented Dec 18, 2022

Codecov Report

Merging #6240 (8d847e3) into v6 (28a64b5) will decrease coverage by 0.03%.
The diff coverage is 80.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #6240      +/-   ##
==========================================
- Coverage   85.23%   85.21%   -0.03%     
==========================================
  Files         372      373       +1     
  Lines       12729    12738       +9     
  Branches     3783     3785       +2     
==========================================
+ Hits        10850    10855       +5     
- Misses       1499     1502       +3     
- Partials      380      381       +1     
Flag Coverage Δ
unittest 85.21% <80.95%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
packages/type-utils/src/isTypeIntrinsic.ts 0.00% <0.00%> (ø)
...s/eslint-plugin/src/rules/prefer-optional-chain.ts 95.80% <85.00%> (-1.68%) ⬇️

... and 1 file with indirect coverage changes

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review December 18, 2022 02:46
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Dec 24, 2022
@bradzacher bradzacher added the breaking change This change will require a new major version to be released label Jan 30, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the base branch from main to v6 February 25, 2023 05:32
@JoshuaKGoldberg
Copy link
Member Author

Lots of merge conflicts here, will need to fix up... eventually.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft February 25, 2023 05:39
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the prefer-optional-chain-falsy-types branch from 1f5c44e to 8d847e3 Compare March 20, 2023 13:05
@nx-cloud
Copy link

nx-cloud bot commented Mar 20, 2023

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 30 targets

Sent with 💌 from NxCloud.

@JoshuaKGoldberg
Copy link
Member Author

Closing in favor of #6397. Woop!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[eslint-plugin] Breaking: enable type information for prefer-optional-chain
4 participants