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. |
| 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.
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
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @typescript-eslint/no-unnecessary-condition */ | |||
There was a problem hiding this comment.
was there a bunch of errors here?
There was a problem hiding this comment.
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.