8000 docs: [no-unsafe-enum-comparison] clarify motivation and applicability by kirkwaiblinger · Pull Request #10029 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

docs: [no-unsafe-enum-comparison] clarify motivation and applicability #10029

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

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

kirkwaiblinger
Copy link
Member
@kirkwaiblinger kirkwaiblinger commented Sep 20, 2024

PR Checklist

Overview

Updates doc page according to discussion in #8557. In short - clarifies that the rule is about preventing logical errors arising from comparisons between enums and non-enums, not just enums and literals (which is no longer unsafe, just a vector for logical errors).

Co-authored-by: @JoshuaKGoldberg

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @kirkwaiblinger!

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 Sep 20, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 03d76de
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66fa31c2885a76000897053e
😎 Deploy Preview https://deploy-preview-10029--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: 98 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (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.

Copy link
nx-cloud bot commented Sep 20, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 03d76de. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@kirkwaiblinger kirkwaiblinger marked this pull request as ready for review September 20, 2024 19:27
@kirkwaiblinger kirkwaiblinger added the documentation Documentation ("docs") that needs adding/updating label Sep 20, 2024
Copy link
Member
@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

I really like the examples! But there's a lot of text here, maybe we can trim down in this specific page?

break;
}
}
```
Copy link
Member

Choose a reason for hiding this comment

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

These examples are really good at explaining what's going on... but they're pretty tall vertically. You have to scroll down pretty far to see the second one.

Proposal: how about...

  1. Moving simplified versions of those examples into the Examples settings
  2. Filing a followup issue to write a longer blog post on all the dangers of enums that can be caught by this & other lint rules?

I think we have enough enum rules to justify a full blog post:

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is good feedback. Made changes!

Copy link
Member Author

Choose a reason for hiding this comment

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

filed #10075

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Sep 23, 2024
@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Sep 29, 2024
Copy link
codecov bot commented Sep 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.99%. Comparing base (a916ff2) to head (03d76de).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10029   +/-   ##
=======================================
  Coverage   85.99%   85.99%           
=======================================
  Files         428      428           
  Lines       14912    14912           
  Branches     4332     4332           
=======================================
  Hits        12823    12823           
  Misses       1744     1744           
  Partials      345      345           
Flag Coverage Δ
unittest 85.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member
@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

✍️

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 30, 2024
@bradzacher bradzacher merged commit 9028d9d into typescript-eslint:main Sep 30, 2024
64 checks passed
@kirkwaiblinger kirkwaiblinger deleted the no-unsafe-enum-docs branch September 30, 2024 14:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge documentation Documentation ("docs") that needs adding/updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: [no-unsafe-enum-comparison] docs improvements around inapplicability for enums (mis)used as namespace
3 participants
0