Skip to content

Commit

Permalink
add ability to skip the eslint fix step
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Heiner committed Apr 28, 2022
1 parent 35c1688 commit 551f1a1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/ts-migrate/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ yargs
describe:
'A message to add to the ts-expect-error or ts-ignore comments that are inserted.',
})
.option('f', {
alias: 'eslintFixChanged',
default: true,
type: 'boolean',
describe:
'A message to add to the ts-expect-error or ts-ignore comments that are inserted.',

This comment has been minimized.

Copy link
@NickHeiner

NickHeiner May 9, 2022

lol, this is not the right help text

})
.positional('folder', { type: 'string' })
.require(['folder']),
async (args) => {
Expand Down Expand Up @@ -226,12 +233,15 @@ yargs
},
};

const config = new MigrateConfig()
const configWithoutEslint = new MigrateConfig()
.addPlugin(withChangeTracking(stripTSIgnorePlugin), {})
.addPlugin(withChangeTracking(tsIgnorePlugin), {
messagePrefix: args.messagePrefix,
})
.addPlugin(eslintFixChangedPlugin, {});
});

const config = args.eslintFixChanged
? configWithoutEslint.addPlugin(eslintFixChangedPlugin, {})
: configWithoutEslint;

const exitCode = await migrate({ rootDir, config });

Expand Down

0 comments on commit 551f1a1

Please sign in to comment.