4 ms·
I tried it on https://github.com/renovatebot/renovate https://github.com/renovatebot/renovate It deleted 100s of files, most of which were Jest test files, and
by rarkins 2y ago
I tried it on https://github.com/renovatebot/renovate https://github.com/renovatebot/renovate
It deleted 100s of files, most of which were Jest test files, and potentially all of which were a mistake. I restored them all with `git restore $(git ls-files -d)`.
I then ran `tsc` on the remaining _modified_ files and `Found 3920 errors in 511 files.`
Obviously at that point I had no choice but to discard all changes and unfortunately I would not recommend this for others to even try.
- _jayhack_ 2y agoThis is simple and configurable with Codegen - see the results on `renovate` here: https://www.codegen.sh/codemod/4553/public/diff https://www.codegen.sh/codemod/4553/public/diff Most transformations like this are not possible with pure static analysis and require some domain knowledge (or repo-specific knowledge) in order to pull off correctly. This is because some code gets "used" in ways that are not apparent i the code. Enjoy!
- fkyoureadthedoc 2y agoyeah the `--check` option should be the default mode imo
- kazushisan 2y agoYou need a valid tsconfig that defines the scope of the project and it seems renovate’s tsconfig doesn’t meet this requirement. You can always --skip manually as an alternative option.
- rarkins 2y agoRenovate's TS tooling seems to work fine otherwise, and for ts-remove-unused as a new tool wanting to get adoption then you should be aiming to work the way your users already work, and not fail + tell them that they are the ones which need to change. BTW the VSCode extension which someone else linked to discovered everything perfectly, which is another hint that your tool needs to improve, not your users. Even if tsconfig.json was very important, and the users are all wrong and you're right, the only thing your readme says is: "The CLI will respect the tsconfig.json for loading source files." which is insufficient.