Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(eslint-plugin): [prefer-nullish-coalescing] fix detection ofignoreConditionalTests
involving boolean!
operator#10299
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@developer-bandi! 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. |
netlifybot commentedNov 7, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
nx-cloudbot commentedNov 7, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit8bd626d. 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 2 targetsSent with 💌 fromNxCloud. |
codecovbot commentedNov 7, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #10299 +/- ##==========================================+ Coverage 86.57% 86.60% +0.02%========================================== Files 431 432 +1 Lines 15198 15166 -32 Branches 4421 4428 +7 ==========================================- Hits 13158 13134 -24+ Misses 1683 1675 -8 Partials 357 357
Flags with carried forward coverage won't be shown.Click here to find out more.
|
Hey! merging from main for ya to fix the build errors |
Uh oh!
There was an error while loading.Please reload this page.
…ttps://github.com/developer-bandi/typescript-eslint into feature/prefer-nullish-coalescing-unaryexpression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
thanks!
Yeah, probably a good idea to do this tbh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What you have looks good, but I think it would be good to implement your suggestion in#10299 (comment)
ignoreConditionalTests
involving boolean!
operatorThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
let a: string | undefined; | ||
let b: string | undefined; | ||
Boolean(!(a || b)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
oh, hmm. I hate to do this. But actually, now that I'm thinking harder about this, I don't think we want this. This would be unambiguously better to write as!Boolean(a || b)
, so the!
really is the sort of implicit coercion thatignoreBooleanCoercion
constructor is trying to force you to useBoolean
on instead.
So sorry to change request changes one way and then request they be undone, but would you mind reverting theignoreBooleanCoercion
changes?
kirkwaiblinger left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Changed my mind about#10299 (review), sorry! 🫣
…ttps://github.com/developer-bandi/typescript-eslint into feature/prefer-nullish-coalescing-unaryexpression
Thank you. I have reflected this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great! And sorry again for my previous mistaken review!
a7746fb
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
##### [v8.15.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8150-2024-11-18)##### 🚀 Features- **eslint-plugin:** \[prefer-nullish-coalescing] fix detection of `ignoreConditionalTests` involving boolean `!` operator ([#10299](typescript-eslint/typescript-eslint#10299))- **eslint-plugin:** new rule `no-unsafe-type-assertion` ([#10051](typescript-eslint/typescript-eslint#10051))- **eslint-plugin:** added related-getter-setter-pairs rule ([#10192](typescript-eslint/typescript-eslint#10192))##### 🩹 Fixes- **utils:** add defaultOptions to meta in rule ([#10339](typescript-eslint/typescript-eslint#10339))- **eslint-plugin:** report deprecations used in default export ([#10330](typescript-eslint/typescript-eslint#10330))- **eslint-plugin:** \[explicit-module-boundary-types] and \[explicit-function-return-type] don't report on `as const satisfies` ([#10315](typescript-eslint/typescript-eslint#10315))- **eslint-plugin:** \[await-thenable, return-await] don't flag awaiting unconstrained type parameter as unnecessary ([#10314](typescript-eslint/typescript-eslint#10314))- **eslint-plugin:** \[consistent-indexed-object-style] handle circular mapped types ([#10301](typescript-eslint/typescript-eslint#10301))##### ❤️ Thank You- Josh Goldberg ✨- Kim Sang Du [@developer-bandi](https://github.com/developer-bandi)- Luis Sebastian Urrutia Fuentes [@LuisUrrutia](https://github.com/LuisUrrutia)- Phillip Huang- Ronen Amiel- Szydlak [@wszydlak](https://github.com/wszydlak)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
| datasource | package | from | to || ---------- | -------------------------------- | ------ | ------ || npm | @typescript-eslint/eslint-plugin | 8.14.0 | 8.15.0 || npm | @typescript-eslint/parser | 8.14.0 | 8.15.0 |## [v8.15.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8150-2024-11-18)##### 🚀 Features- **eslint-plugin:** \[prefer-nullish-coalescing] fix detection of `ignoreConditionalTests` involving boolean `!` operator ([#10299](typescript-eslint/typescript-eslint#10299))- **eslint-plugin:** new rule `no-unsafe-type-assertion` ([#10051](typescript-eslint/typescript-eslint#10051))- **eslint-plugin:** added related-getter-setter-pairs rule ([#10192](typescript-eslint/typescript-eslint#10192))##### 🩹 Fixes- **utils:** add defaultOptions to meta in rule ([#10339](typescript-eslint/typescript-eslint#10339))- **eslint-plugin:** report deprecations used in default export ([#10330](typescript-eslint/typescript-eslint#10330))- **eslint-plugin:** \[explicit-module-boundary-types] and \[explicit-function-return-type] don't report on `as const satisfies` ([#10315](typescript-eslint/typescript-eslint#10315))- **eslint-plugin:** \[await-thenable, return-await] don't flag awaiting unconstrained type parameter as unnecessary ([#10314](typescript-eslint/typescript-eslint#10314))- **eslint-plugin:** \[consistent-indexed-object-style] handle circular mapped types ([#10301](typescript-eslint/typescript-eslint#10301))##### ❤️ Thank You- Josh Goldberg ✨- Kim Sang Du [@developer-bandi](https://github.com/developer-bandi)- Luis Sebastian Urrutia Fuentes [@LuisUrrutia](https://github.com/LuisUrrutia)- Phillip Huang- Ronen Amiel- Szydlak [@wszydlak](https://github.com/wszydlak)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
ignoreConditionalTests
doesn't ignore the boolean!
operator in a condition #10284Overview
Since we maintain the same logic as the ignoreBooleanCoercion option, should we add the same logic to this option as well?