any and minimizes the amount of rework that is usually inherent in converting large codebases.
Rank all files in the
npx deprank ./src
.jsx files in the
npx deprank --ext=".js,.jsx" ./src ./test
npx deprank ./fixtures
| Filename | Lines | Dependents | PageRank | ---------------------------------------------------------- | fixtures/core.js | 3 | 1 | 0.284098 | | fixtures/utils.js | 4 | 3 | 0.268437 | | fixtures/user/user.js | 4 | 1 | 0.132253 | | fixtures/todo.js | 6 | 1 | 0.089796 | | fixtures/user/index.js | 1 | 1 | 0.089796 | | fixtures/concepts.js | 4 | 1 | 0.079694 | | fixtures/index.js | 4 | 0 | 0.055926 |
- Clone this repository:
git clone email@example.com:codemix/deprank.git
- Get yarn.
- Navigate into the project folder:
To help convert your codebase to TypeScript whilst minimizing the amount of effort required, we suggest converting files in
deprank --deps-first order. This option lifts the files that are depended upon by the most important files in the codebase to the top of the list. By tackling each file in order we help ensure that type errors are solved at their origin, rather than their point of use. This can reduce the number of type errors much more quickly than the more typical, ad-hoc order that such conversions usually take, and it helps TypeScript use inference which reduces the amount of manual typing required. It's not uncommon to see hundreds or thousands of type errors disappear just by fixing a few key files.
The following command will find all
.jsx files in a
src folder, and sort them in dependency-first order.
npx deprank --ext=".js,.jsx" --deps-first ./src