From 59290c08aaff6aaaedf63e2df62a8b0dc3e30ace Mon Sep 17 00:00:00 2001 From: Andrey Frolov <30667180+frolovdev@users.noreply.github.com> Date: Wed, 23 Mar 2022 22:58:42 +0300 Subject: [PATCH] fix: add type-check script to web3.js package (#23109) --- web3.js/.travis/script.sh | 3 +-- web3.js/package.json | 3 ++- web3.js/src/connection.ts | 1 - web3.js/tsconfig.json | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web3.js/.travis/script.sh b/web3.js/.travis/script.sh index a510b6c634..fcc4fdec91 100644 --- a/web3.js/.travis/script.sh +++ b/web3.js/.travis/script.sh @@ -9,7 +9,6 @@ ls -l lib test -r lib/index.iife.js test -r lib/index.cjs.js test -r lib/index.esm.js -npm run doc -npm run lint +npm run ok npm run codecov npm run test:live-with-test-validator diff --git a/web3.js/package.json b/web3.js/package.json index 1e09ee2de6..8ca9fa0faa 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -48,7 +48,8 @@ "type:gen": "./scripts/typegen.sh", "lint": "set -ex; npm run pretty; eslint . --ext .js,.ts", "lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts", - "ok": "run-s lint test doc", + "type:check": "tsc -p tsconfig.json --noEmit", + "ok": "run-s lint test doc type:check", "pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'", "pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'", "re": "semantic-release --repository-url git@github.com:solana-labs/solana-web3.js.git", diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 9212203c28..f9ed8fb4d5 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -1,7 +1,6 @@ import bs58 from 'bs58'; import {Buffer} from 'buffer'; import fetch from 'cross-fetch'; -import type {Response} from 'cross-fetch'; import { type as pick, number, diff --git a/web3.js/tsconfig.json b/web3.js/tsconfig.json index 8564dad9dd..f588ae8846 100644 --- a/web3.js/tsconfig.json +++ b/web3.js/tsconfig.json @@ -14,7 +14,9 @@ "isolatedModules": true, "baseUrl": "src", "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true + "noImplicitReturns": true, + "noUnusedParameters": true, + "noUnusedLocals": true }, "include": ["src"] }