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

chore: enable prefer-nullish-coalescing internally #7955

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Fixes up most of the last few violations of @typescript-eslint/prefer-nullish-coalescing. Ignores primitives because we tend to do "fun" things with strings.

@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.

Copy link

netlify bot commented Nov 19, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 3c7f9b9
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/65b1153e317e0f00080ef992
😎 Deploy Preview https://deploy-preview-7955--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: 96 (🟢 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 your Netlify site configuration.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review November 29, 2023 00:40
@bradzacher bradzacher changed the title chore: enable prefer-nullish-calescing internally chore: enable prefer-nullish-coalescing internally Jan 13, 2024
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.

Can we turn it on with ignoreConditionalTests?
I think that using ?? in conditional tests is less clear.

Consider the downlevelled output:

if (x || y) { }

// vs

if (x ?? y) { } 
// downlevelled to
if (x != null ? x : y) { }

I think it's a whole lot less clear.
Actually I'm going to go as far as advocating for flipping the default in v7 - #8243

@bradzacher bradzacher added repo maintenance things to do with maintenance of the repo, and not with code/docs awaiting response Issues waiting for a reply from the OP or another party labels Jan 13, 2024
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Jan 27, 2024
@bradzacher bradzacher added the 1 approval One team member has approved this PR; a second should be enough to merge it label Jan 28, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit d0137c8 into typescript-eslint:main Jan 28, 2024
55 of 57 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the lint-enable-prefer-nullish-coalescing branch January 28, 2024 07:40
danvk pushed a commit to danvk/typescript-eslint that referenced this pull request Feb 4, 2024
…#7955)

* chore: enable prefer-nullish-calescing internally

* A couple complaints

* One last complaint

* Enable ignoreConditionalTests
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval One team member has approved this PR; a second should be enough to merge it repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants