-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: finish enabling no-unnecessary-condition internally #8004
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: finish enabling no-unnecessary-condition internally #8004
Conversation
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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -109,6 +109,7 @@ export default createRule<Options, MessageIds>({ | |||
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void { | |||
// Coerce the source into a string for use as a lookup entry. | |||
const source = getSourceFromExport(node) ?? 'undefined'; | |||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition |
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.
This is the old issue we've got filed right where TS is giving the wrong type for logical assignment operators?
If yes - Oof we should prioritise this #6762
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.
Yeah :/
@@ -1,3 +1,4 @@ | |||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */ |
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.
was there a bunch of errors here?
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.
Yeah, 9 of them. Mostly around type safety checks on user-provided parameters. E.g. config == null
:
if (typeof config !== 'object' || config == null) {
throw new TypeError(
'RuleTester.setDefaultConfig: config must be an object',
);
}
PR Checklist
Overview
Follows #7837 et al. in fixing up existing @typescript-eslint/no-unnecessary-condition violations. Also enables the lint rule overall.