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

Add ability to specify a custom message for the ts-ignore plugin #171

Merged
merged 7 commits into from
Jun 15, 2022

Conversation

NickHeiner
Copy link

@NickHeiner NickHeiner commented Jun 10, 2022

Related: #168.

This PR is likely easier to review commit-by-commit.

I moved the ts-ignore tests to be snapshot tests, since that makes it much easier to tweak the inserted message. I did the snapshot conversion as a separate commit, so you can verify the conversion itself didn't introduce any changes.

In addition to adding the ability to specify a custom message, I changed ts-migrate(${code}) to TS(${code}). This is more compact, and makes it more obvious that it's a TS-xxxx type error code.

@Rudeg Rudeg merged commit fc1bedb into airbnb:master Jun 15, 2022
@devinrhode2
Copy link

@NickHeiner how do I actually pass in this custom message?
I tried this but didn't seem to work:

yarn ts-migrate migrate . --plugin ts-ignore -p L1
yarn ts-migrate migrate . --plugin ts-ignore --p L1

@devinrhode2
Copy link

This seems to add a message prefix:

yarn ts-migrate reignore . --messagePrefix "level0" --stripIgnores true --eslintFixChanged=false

I wasn't exactly sure hot to specify the boolean flags though. I couldn't get the eslint-fix plugin to NOT run.

@NickHeiner
Copy link
Author

I tried this but didn't seem to work:

Right – you were using the migrate command, but the p flag is defined on the reignore command.

I don't see eslintFixChanged as a flag in the CLI setup, which explains why that flag doesn't do anything when you pass it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants