Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Migrating] Mention ts-fix among useful tools #769

Open
pjonsson opened this issue Dec 28, 2024 · 0 comments
Open

[Migrating] Mention ts-fix among useful tools #769

pjonsson opened this issue Dec 28, 2024 · 0 comments
Labels
MIGRATING Migrating Cheatsheet

Comments

@pjonsson
Copy link

pjonsson commented Dec 28, 2024

What cheatsheet is this about? (if applicable)

Migrating cheatsheet

What's your issue or idea?

Ts-fix is a CLI for applying TypeScript codefixes, and I feel that should be mentioned among the useful tools.

Source repository here: https://github.com/microsoft/ts-fix

To automatically fix an issue, enable some more warnings in tsconfig.json and run like this:

ts-fix -t ./tsconfig-with-more-warnings.json -e 7006 --write --ignoreGitStatus --file src/**/*.ts

The 7006 code is to apply the fix that adds type annotations on parameters with an implicit any type. There might be a better way to find the code for the fix, I just look here and search for some part of the error message from the compiler: https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json.

@pjonsson pjonsson added the MIGRATING Migrating Cheatsheet label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MIGRATING Migrating Cheatsheet
Projects
None yet
Development

No branches or pull requests

1 participant