Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDW-773] standalone node script for migration @ts-ignore annotations
- Loading branch information
Showing
2 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import path from 'path'; | ||
import { tsIgnorePlugin, eslintFixPlugin } from 'ts-migrate-plugins'; | ||
import { migrate, MigrateConfig } from 'ts-migrate-server'; | ||
|
||
// get input files folder | ||
const inputDir = path.resolve(__dirname); | ||
|
||
// create new migration config and add ts-ignore plugin with options | ||
const config = new MigrateConfig() | ||
.addPlugin(eslintFixPlugin, {}) | ||
.addPlugin(tsIgnorePlugin, { | ||
useTsIgnore: true, | ||
}); | ||
// run migration | ||
(async () => { | ||
const exitCode = await migrate({ | ||
rootDir: inputDir, | ||
tsConfigDir: path.resolve(__dirname), | ||
config, | ||
sources: [ | ||
'./scripts/**/*.ts{,x}', | ||
'./source/**/*.ts{,x}', | ||
'./storybook/**/*.ts{,x}', | ||
'./tests/**/*.ts{,x}', | ||
'./translations/**/*.ts{,x}', | ||
'./utils/**/*.ts{,x}', | ||
'./declarations.d.ts', | ||
], | ||
}); | ||
process.exit(exitCode); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters