jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.
MIT License
1.51k stars 21 forks source link

Removing (unused) types ? #46

Closed iangregsondev closed 3 years ago

iangregsondev commented 4 years ago

Hi,

I am getting types being removed, stating they are unused, this is not my case.

for example

my-api — package.json (2 new typings added, 1 unused typings removed)
├─ + @types/redlock
├─ + @types/ioredis
└─ - @types/express (unused)

I installed @types/express manually and my code is using it for the Request Interface.

I am not required to install express as its another library that is exposing it and it has express in its own deps.

Could we avoid removing types or put it under a argument... so maybe something like this

my-api — package.json (2 new typings added, 1 unused typings **found**)
├─ + @types/redlock
├─ + @types/ioredis
└─ - @types/express (unused)

**To remove unused typings please run typesync passing -u**

So we would need to run

npx typesync -u

to remove unused types.

What do you think ?

jeffijoe commented 4 years ago

I think that makes sense.

septs commented 4 years ago

my solution: #47

jeffijoe commented 3 years ago

The --ignorepackages option from #58 should solve this issue.