Skip to content

Commit

Permalink
chore: add ts-unused-exports check (#699)
Browse files Browse the repository at this point in the history
* chore: add ts-unused-exports library

Signed-off-by: clegirar <[email protected]>

* chore: add github job in js workflow to check typescript unused exports

Signed-off-by: clegirar <[email protected]>

---------

Signed-off-by: clegirar <[email protected]>
  • Loading branch information
clegirar authored Sep 12, 2023
1 parent 6def855 commit ce0d7ea
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ jobs:

- name: Check that there is no diff
run: git diff --exit-code

- name: Check typescript unused exports
run: make unused-exports
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,8 @@ validate-networks: node_modules
.PHONY: networks.json
networks.json: node_modules validate-networks
npx ts-node packages/scripts/generateJSONNetworks.ts > $@

.PHONY: unused-exports
unused-exports: node_modules
## TODO unexclude all paths except packages/api;packages/contracts-clients;packages/evm-contracts-clients
npx ts-unused-exports ./tsconfig.json --excludePathsFromReport="packages/api;packages/contracts-clients;packages/evm-contracts-clients;packages/components;packages/hooks;packages/context;packages/screens;packages/utils;packages/store;packages/networks;./App.tsx" --ignoreTestFiles
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"react-native-svg-transformer": "^1.0.0",
"ts-node": "^10.9.1",
"ts-proto": "^1.120.0",
"ts-unused-exports": "^10.0.1",
"typescript": "~4.3.5",
"webpack": "^4.46.0",
"webpack-bundle-analyzer": "^4.8.0",
Expand Down
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19931,6 +19931,17 @@ __metadata:
languageName: node
linkType: hard

"json5@npm:^1.0.2":
version: 1.0.2
resolution: "json5@npm:1.0.2"
dependencies:
minimist: ^1.2.0
bin:
json5: lib/cli.js
checksum: 866458a8c58a95a49bef3adba929c625e82532bcff1fe93f01d29cb02cac7c3fe1f4b79951b7792c2da9de0b32871a8401a6e3c5b36778ad852bf5b8a61165d7
languageName: node
linkType: hard

"json5@npm:^2.1.0, json5@npm:^2.2.2":
version: 2.2.3
resolution: "json5@npm:2.2.3"
Expand Down Expand Up @@ -27762,6 +27773,7 @@ __metadata:
redux-persist: ^6.0.0
ts-node: ^10.9.1
ts-proto: ^1.120.0
ts-unused-exports: ^10.0.1
typescript: ~4.3.5
uuid: ^9.0.0
victory-native: ^36.6.8
Expand Down Expand Up @@ -28244,6 +28256,23 @@ __metadata:
languageName: node
linkType: hard

"ts-unused-exports@npm:^10.0.1":
version: 10.0.1
resolution: "ts-unused-exports@npm:10.0.1"
dependencies:
chalk: ^4.0.0
tsconfig-paths: ^3.9.0
peerDependencies:
typescript: ">=3.8.3"
peerDependenciesMeta:
typescript:
optional: false
bin:
ts-unused-exports: bin/ts-unused-exports
checksum: d5248b4c1c3b970b594db4955582dbdc1c56852a61f69fd18e680e87bad4df879a052c84c0ca6e1d1ea4f63eab39c1a9beff23e8e38e4fcdefc5c03e83487256
languageName: node
linkType: hard

"tsconfig-paths@npm:^3.14.1":
version: 3.14.1
resolution: "tsconfig-paths@npm:3.14.1"
Expand All @@ -28256,6 +28285,18 @@ __metadata:
languageName: node
linkType: hard

"tsconfig-paths@npm:^3.9.0":
version: 3.14.2
resolution: "tsconfig-paths@npm:3.14.2"
dependencies:
"@types/json5": ^0.0.29
json5: ^1.0.2
minimist: ^1.2.6
strip-bom: ^3.0.0
checksum: a6162eaa1aed680537f93621b82399c7856afd10ec299867b13a0675e981acac4e0ec00896860480efc59fc10fd0b16fdc928c0b885865b52be62cadac692447
languageName: node
linkType: hard

"tslib@npm:1.14.1, tslib@npm:^1.10.0, tslib@npm:^1.11.1, tslib@npm:^1.8.1, tslib@npm:^1.9.0":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
Expand Down

0 comments on commit ce0d7ea

Please sign in to comment.