Skip to content

Conversation

@mhheise
Copy link

@mhheise mhheise commented May 7, 2025

This rule implementation is almost entirely based on the Jest rule of the same name. I'm happy to extract the common code from each if there's a good place to house it.

It's my first contribution to this repository, so let me know if I'm missing any steps!

@graphite-app
Copy link
Contributor

graphite-app bot commented May 7, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-enhancement Category - New feature or request labels May 7, 2025
@mhheise mhheise force-pushed the feat/mhh/vitest-valid-title branch from 33bd875 to f2d7a20 Compare May 7, 2025 02:24
@Boshen Boshen requested a review from camc314 May 7, 2025 04:31
@codspeed-hq
Copy link

codspeed-hq bot commented May 7, 2025

CodSpeed Instrumentation Performance Report

Merging #10841 will not alter performance

Comparing mhheise:feat/mhh/vitest-valid-title (f2d7a20) with main (3d47159)

Summary

✅ 36 untouched benchmarks

Copy link
Member

@Sysix Sysix left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. ❤️

We are not separating the jest/vitest rules which are identical,
instead, we are implementing them in jest and remapping them for vitest:

/// List of Jest rules that have Vitest equivalents.
const VITEST_COMPATIBLE_JEST_RULES: [&str; 34] = [
"consistent-test-it",
"expect-expect",
"max-expects",
"max-nested-describe",
"no-alias-methods",
"no-commented-out-tests",
"no-conditional-expect",
"no-conditional-in-test",
"no-disabled-tests",
"no-duplicate-hooks",
"no-focused-tests",
"no-hooks",
"no-identical-title",
"no-interpolation-in-snapshots",
"no-restricted-jest-methods",
"no-restricted-matchers",
"no-standalone-expect",
"no-test-prefixes",
"no-test-return-statement",
"prefer-comparison-matcher",
"prefer-each",
"prefer-equality-matcher",
"prefer-expect-resolves",
"prefer-hooks-in-order",
"prefer-hooks-on-top",
"prefer-lowercase-title",
"prefer-mock-promise-shorthand",
"prefer-strict-equal",
"prefer-to-have-length",
"prefer-todo",
"require-to-throw-message",
"require-top-level-describe",
"valid-describe-callback",
"valid-expect",
];

Could you please update the jest rule to include all vitest rules test + options?
And add the rule in the linked mod.rs file :)

@camc314 camc314 closed this May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants