Content-Length: 257314 | pFad | http://github.com/OlivierZal/typescript-eslint/pull/2

5B suggestion for prefer-nullish-coalescing PR by kirkwaiblinger · Pull Request #2 · OlivierZal/typescript-eslint · GitHub
Skip to content

suggestion for prefer-nullish-coalescing PR #2

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

Conversation

kirkwaiblinger
Copy link

@kirkwaiblinger kirkwaiblinger commented Jan 21, 2025

Suggestion for typescript-eslint#10517

The main thing this suggestion does is to remove the isIdentifierOrMemberExpressionType() workaround from the isConditionalTest() and isBooleanContext() functions, and move the logic to distinguish between ternary's test and the ternary overall earlier in the call stack (by taking it as a parameter to isTruthinessCheckEligibleForPreferNullish()/isEligibleForPreferNullish())

Otherwise it's just a bit of renaming, inverting the sign and naming of a few things, and adding some jsdoc since this is complicated stuff.

Feel free to merge/cherry-pick this diff to your PR branch 🙂

@OlivierZal OlivierZal merged commit dce2427 into OlivierZal:prefer-nullish-coalescing-10470 Jan 21, 2025
1 of 2 checks passed
@kirkwaiblinger kirkwaiblinger deleted the pnc-suggestion branch January 21, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/OlivierZal/typescript-eslint/pull/2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy