Skip to content

chore: finish enabling no-unnecessary-condition internally#8004

Merged
JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfrom
JoshuaKGoldberg:lint-enable-no-unnecessary-condition
Nov 29, 2023
Merged

chore: finish enabling no-unnecessary-condition internally#8004
JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfrom
JoshuaKGoldberg:lint-enable-no-unnecessary-condition

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

PR Checklist

Overview

Follows #7837 et al. in fixing up existing @typescript-eslint/no-unnecessary-condition violations. Also enables the lint rule overall.

@typescript-eslint
Copy link
Copy Markdown
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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 29, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 4ecd40f
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6567285b6e0f660008865dfe
😎 Deploy Preview https://deploy-preview-8004--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: 94 (🟢 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:36
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
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah :/

Comment thread packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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',
      );
    }

Comment thread packages/website/src/components/Playground.tsx
Comment thread packages/website/src/components/typeDetails/TypesDetails.tsx
@JoshuaKGoldberg JoshuaKGoldberg merged commit 96abf18 into typescript-eslint:main Nov 29, 2023
@JoshuaKGoldberg JoshuaKGoldberg deleted the lint-enable-no-unnecessary-condition branch November 29, 2023 23:14
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants