Skip to content

Commit 0ba0c63

Browse files
committed
fix: verifyng action before update file
1 parent d34ca3f commit 0ba0c63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/conductor/organize-imports.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ export async function organizeImportsForFile(filePath: string): Promise<string>
4545
const { staged, autoAdd, dryRun } = getConfig();
4646
const fileWithOrganizedImports = await organizeImports(fileContent);
4747
const fileHasChanged = fileWithOrganizedImports !== fileContent;
48+
const isValidAction = [actions.none, actions.skipped].every(action => action !== fileWithOrganizedImports);
4849

49-
if (fileHasChanged) {
50+
if (fileHasChanged && isValidAction) {
5051
!dryRun && writeFileSync(filePath, fileWithOrganizedImports);
5152
let msg = 'imports reordered';
5253
if (staged && autoAdd) {

0 commit comments

Comments
 (0)