File tree Expand file tree Collapse file tree
crates/vite_migration/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,6 +225,15 @@ mod tests {
225225 rewrite_prettier_script( "prettier --check --list-different ." ) ,
226226 "vp fmt --check ."
227227 ) ;
228+
229+ // --list-different + --check (the other order) → still a single --check
230+ assert_eq ! (
231+ rewrite_prettier_script( "prettier --list-different --check ." ) ,
232+ "vp fmt --check ."
233+ ) ;
234+
235+ // two literal --check → still a single --check
236+ assert_eq ! ( rewrite_prettier_script( "prettier --check --check ." ) , "vp fmt --check ." ) ;
228237 }
229238
230239 #[ test]
Original file line number Diff line number Diff line change @@ -497,7 +497,14 @@ fn strip_flags_from_suffix(
497497 break ;
498498 }
499499 if val == conv. dedup_flag {
500- conversion_emitted[ ci] = true ;
500+ // Drop a duplicate if the target flag was already emitted;
501+ // otherwise keep this one and mark it emitted.
502+ if conversion_emitted[ ci] {
503+ converted = true ;
504+ } else {
505+ conversion_emitted[ ci] = true ;
506+ }
507+ break ;
501508 }
502509 }
503510 if converted {
You can’t perform that action at this time.
0 commit comments