jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Xyaren opened this issue ยท comments

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!

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. ๐Ÿค”

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

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.

@jeffijoe We proposed a PR for the --dry=fail approach. ๐Ÿ‘

Released in 0.9 ๐Ÿ‘

Thank you @jeffijoe ๐Ÿ‘