Skip to content

Commit 7da2ece

Browse files
committed
style(migrate): apply rustfmt to the #2004 import_rewriter tests
cargo fmt --check failed in CI: the new config-scoping tests were not rustfmt-formatted (vp check formats TS/JS, not Rust). Claude-Session: https://claude.ai/code/session_01DQhS6o1fyQd1yjiee6W8jR
1 parent c006a76 commit 7da2ece

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

crates/vite_migration/src/import_rewriter.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,10 +2001,8 @@ fn find_nearest_package_json(file_path: &Path, root: &Path) -> Option<PathBuf> {
20012001
/// `defineConfig` from `vite`. Matched by basename, so it covers configs at any
20022002
/// monorepo depth.
20032003
static VITE_CONFIG_FILE_NAMES: LazyLock<Vec<String>> = LazyLock::new(|| {
2004-
serde_json::from_str(include_str!(
2005-
"../../../packages/cli/src/vite-config-entry-basenames.json"
2006-
))
2007-
.expect("invalid vite-config-entry-basenames.json")
2004+
serde_json::from_str(include_str!("../../../packages/cli/src/vite-config-entry-basenames.json"))
2005+
.expect("invalid vite-config-entry-basenames.json")
20082006
});
20092007

20102008
/// Whether a file is a Vite/Vitest config entry file, where rewriting `vite`
@@ -2995,11 +2993,8 @@ describe('test', () => {});"#,
29952993
)
29962994
.unwrap();
29972995
// Only `vite` is scoped: a non-config `vitest` import still rewrites.
2998-
fs::write(
2999-
temp.path().join("src/app.spec.ts"),
3000-
"import { describe } from 'vitest';\n",
3001-
)
3002-
.unwrap();
2996+
fs::write(temp.path().join("src/app.spec.ts"), "import { describe } from 'vitest';\n")
2997+
.unwrap();
30032998

30042999
rewrite_imports_in_directory(temp.path()).unwrap();
30053000

0 commit comments

Comments
 (0)