Skip to content

Commit daea57d

Browse files
committed
feat(linter/eslint-plugin-vitest): reuse the jest linter rule
1 parent d6d2bcd commit daea57d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/oxc_linter/src/rules/jest/no_mocks_import.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,6 @@ fn test() {
118118

119119
Tester::new(NoMocksImport::NAME, NoMocksImport::PLUGIN, pass, fail)
120120
.with_jest_plugin(true)
121+
.with_vitest_plugin(true)
121122
.test_and_snapshot();
122123
}

crates/oxc_linter/src/utils/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use self::{
3333
/// List of Jest rules that have Vitest equivalents.
3434
// When adding a new rule to this list, please ensure oxlint-migrate is also updated.
3535
// See https://github.com/oxc-project/oxlint-migrate/blob/2c336c67d75adb09a402ae66fb3099f1dedbe516/scripts/constants.ts
36-
const VITEST_COMPATIBLE_JEST_RULES: [&str; 35] = [
36+
const VITEST_COMPATIBLE_JEST_RULES: [&str; 36] = [
3737
"consistent-test-it",
3838
"expect-expect",
3939
"max-expects",
@@ -48,6 +48,7 @@ const VITEST_COMPATIBLE_JEST_RULES: [&str; 35] = [
4848
"no-hooks",
4949
"no-identical-title",
5050
"no-interpolation-in-snapshots",
51+
"no-mocks-import",
5152
"no-restricted-jest-methods",
5253
"no-restricted-matchers",
5354
"no-standalone-expect",

0 commit comments

Comments
 (0)