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

Feature Request: Exit Code should reflect if changes are required on a new paramter like --check #72

Closed
Xyaren opened this issue May 22, 2021 · 6 comments · Fixed by #83

Comments

@Xyaren
Copy link

Xyaren commented May 22, 2021

As the title says.
I would like to add this to a ci "linting" pipeline, therefore setting the rturn code to something other than 0 if there should be new typings added or removed would be nice.

I would suggest something like typesync --check which behaves like --dry but alters the return code.
or you paramerize the dry parameter like typesync --dry=fail

Thank you!

@jeffijoe
Copy link
Owner

Curious, what is the value proposition for enforcing this in CI?

I'd accept a PR for this though, not sure whether --check or --dry=fail is preferable; the former makes more sense from an API perspective but it also results in an implicit --dry. 🤔

@Xyaren Xyaren changed the title Feature Request: Return Code should reflect if changes are required on a new paramter like --check Feature Request: Exit Code should reflect if changes are required on a new paramter like --check May 22, 2021
@Xyaren
Copy link
Author

Xyaren commented May 22, 2021

This basically enforces the type definitions to be present at all times within the package.json.

Scenario: One developer forgets to "typesync" after adding a new dependency, pushes.
The next developer pulls the changes, and then executes npm install & typesync.
The expectation would be, that he does not have any outstanding files, that he has to commit.

Adding a step to the CI, could enforce a typesynced-package.json at all times

@jlarmstrongiv
Copy link
Contributor

Great idea! The npm-check-updates package has a similar feature called -e, --errorLevel <n>. Being able to run typesync in a CI environment is very useful.

@chelkyl
Copy link
Contributor

chelkyl commented Mar 20, 2022

@jeffijoe We proposed a PR for the --dry=fail approach. 👍

@jeffijoe
Copy link
Owner

Released in 0.9 👍

@jlarmstrongiv
Copy link
Contributor

Thank you @jeffijoe 👍

This issue was closed.
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 a pull request may close this issue.

4 participants