Not picking up files to migrate
See original GitHub issueHi there, I think this is an operator error situation but I’m going to explain what I’m trying to do and hopefully someone can call out where I’m going wrong.
Currently have a very large codebase and I’m trying to migrate each folder in the codebase one at a time to sanely manage the migration.
So I have a folder called lib/src/constants/
that contains the following files:
lib/src/constants
├── __mocks__
│ └── helpers.ts
├── apps.ts
├── helpers.ts
└── types.ts
Commands I’m running:
Step 1
yarn run ts-migrate init:extended lib/src/constants
This generates a boilerplate tsconfig.json within lib/src/constants
. 👍🏽
Step 2
Replace tsconfig.json
contents to point to the tsconfig.json
that lives at the root of all the folders.
{
"extends": "../../../tsconfig.json",
"include": ["."]
}
Step 3
yarn run ts-migrate migrate lib/src/constants
Run the command above and get the output below.
TypeScript version: 4.1.2
Initialized tsserver project in 1649.462ms.
Start...
[strip-ts-ignore] Plugin 1 of 14. Start...
[strip-ts-ignore] Finished in 19.194ms.
[hoist-class-statics] Plugin 2 of 14. Start...
[hoist-class-statics] Finished in 1.508ms.
[react-props] Plugin 3 of 14. Start...
[react-props] Finished in 0.287ms.
[react-class-state] Plugin 4 of 14. Start...
[react-class-state] Finished in 0.265ms.
[react-class-lifecycle-methods] Plugin 5 of 14. Start...
[react-class-lifecycle-methods] Finished in 0.216ms.
[react-default-props] Plugin 6 of 14. Start...
[react-default-props] Finished in 0.618ms.
[react-shape] Plugin 7 of 14. Start...
[react-shape] Finished in 0.490ms.
[declare-missing-class-properties] Plugin 8 of 14. Start...
[declare-missing-class-properties] Finished in 647.272ms.
[member-accessibility] Plugin 9 of 14. Start...
[member-accessibility] Finished in 1.314ms.
[explicit-any] Plugin 10 of 14. Start...
[explicit-any] Finished in 28.786ms.
[add-conversions] Plugin 11 of 14. Start...
[add-conversions] Finished in 2.923ms.
[eslint-fix] Plugin 12 of 14. Start...
[eslint-fix] Finished in 2680.290ms.
[ts-ignore] Plugin 13 of 14. Start...
[ts-ignore] Finished in 0.755ms.
[eslint-fix] Plugin 14 of 14. Start...
[eslint-fix] Finished in 105.843ms.
Finished in 3490.653ms, for 14 plugin(s).
Writing 0 updated file(s)...
Wrote 0 updated file(s) in 0.041ms.
Says it wrote 0 updated files. 😿
Then I opened up one of the files to see if it removed the // @ts-ignore
that was at the top but nothing has changed.
I’m currently trying to understand what files it’s picking up and how to tell it what files to include. I thought tsconfig.json was doing that but appears to not be the case.
Any help here would be greatly appreciated. Otherwise I’ll keep digging in the source code trying to figure what I’m doing wrong.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top GitHub Comments
I ran into this as well but it was because I was running the plugins on .js files before they were renamed to .ts files.
Okay, turns out this was operator error. As I suspected. I forgot to remove the
// @ts-nocheck
from the top of the files. 🤦🏽Sorry about this. I’ll close this.