pzavolinsky / ts-unused-exports

ts-unused-exports finds unused exported symbols in your Typescript project
MIT License
749 stars 49 forks source link

Have an `allowUnusedEnums` option #165

Closed sbason closed 4 years ago

sbason commented 4 years ago

It would be good to have an allowUnusedEnums option or for allowUnusedTypes to also include enums (although I don't think enums are technically types).

The use case for us is we have enums shared across tests and prod files and we have the following scripts meaning that we can get false positives on enums being exported in the first script because they are in fact used in the tests (which is fine).

{
 "unused-exports:src": "ts-unused-exports ./tsconfig.json --showLineNumber --ignoreTestFiles --allowUnusedTypes",
 "unused-exports:test": "ts-unused-exports ./tsconfig.json --showLineNumber --ignoreProductionFiles --allowUnusedTypes",
 "unused-exports:types": "ts-unused-exports ./tsconfig.json --showLineNumber"
}
mrseanryan commented 4 years ago

Sounds good!

dev note = somewhat similar to --allowUnusedTypes