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

Enhancement: [prefer-nullish-coalescing] Add runtime check for strictNullChecks being enabled #5995

Closed
4 tasks done
JoshuaKGoldberg opened this issue Nov 16, 2022 · 2 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JoshuaKGoldberg
Copy link
Member

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/prefer-nullish-coalescing

Description

Following up from #5748 (comment):

We should give [prefer-nullish-coalescing] the same treatment as rules like strict-boolean-expressions where the rule will explicitly error if you don't have the option turned on.

https://typescript-eslint.io/rules/strict-boolean-expressions/#allowruletorunwithoutstrictnullchecksiknowwhatiamdoing

I would say we can do that change without a breaking change because the rule is LITERALLY useless without the option.

Fail

n/a

Pass

n/a

Additional Info

#5988 added docs; now let's add a runtime check. 🚀

@JoshuaKGoldberg JoshuaKGoldberg added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look enhancement: plugin rule option New rule option for an existing eslint-plugin rule good first issue Good for newcomers accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Nov 16, 2022
@JoshuaKGoldberg
Copy link
Member Author

@cparros mentioned interest in tackling this soon. 😁

@JoshuaKGoldberg
Copy link
Member Author

Fixed by #6174.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

1 participant