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

feat(rule-tester): port checkDuplicateTestCases from ESLint #9026

Merged

Conversation

abrahamguo
Copy link
Contributor

PR Checklist

Overview

Ports checkDuplicateTestCases from ESLint's RuleTester.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @abrahamguo!

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 Apr 29, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 3cf2411
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6655cdde2bd57b0008b3ed67
😎 Deploy Preview https://deploy-preview-9026--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 (no change 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 added this to the 8.0.0 milestone Apr 29, 2024
@abrahamguo
Copy link
Contributor Author

@JoshuaKGoldberg should this be going into main or v8?
I wasn't sure since in #8211 @bradzacher mentioned this could be merged in ahead of v8.

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.

LGTM, thanks for the port! 🙌

Just one suggestion on refactoring to a new file. If you don't like it I don't mind, and can merge as-is. Just let me know. 🙂

packages/rule-tester/src/RuleTester.ts Show resolved Hide resolved
packages/rule-tester/src/RuleTester.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg should this be going into main or v8? I wasn't sure since in #8211 @bradzacher mentioned this could be merged in ahead of v8.

👍 Let's do main, as you have it. I had that wonder too. 😄

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 2024
@abrahamguo
Copy link
Contributor Author

abrahamguo commented Apr 29, 2024

@JoshuaKGoldberg one curiosity question — how is this port of RuleTester unit-tested? I was surprised to not see a copy of all ESLint's unit tests against this class, and that I didn't need to add any new tests for the port of this feature.

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 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.

D'oh! Sorry, brain fart this morning - there should be tests. See packages/rule-tester/tests/eslint-base/eslint-base.test.js.

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 2024
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team April 30, 2024 20:13
@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Apr 30, 2024
@abrahamguo
Copy link
Contributor Author

There are about 10-20 rules in eslint-plugin which have duplicate tests. Most of them seem to be merging multiple combinations of auto-generated tests together. I'm working on fixing them, but let me know if you have any thoughts on that.

@bradzacher bradzacher added the enhancement New feature or request label May 28, 2024
bradzacher
bradzacher previously approved these changes May 28, 2024
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party 1 approval One team member has approved this PR; a second should be enough to merge it labels May 28, 2024
@bradzacher
Copy link
Member

@abrahamguo just needs a rebase on main to resolve conflicts and we can merge this!

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label May 29, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit 5ca7f6e into typescript-eslint:main Jun 1, 2024
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 approval One team member has approved this PR; a second should be enough to merge it enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement(rule-tester): detect duplicate test cases
3 participants