polkadot-js / extension

Simple browser extension for managing Polkadot and Substrate network accounts in a browser. Allows the signing of extrinsics using these accounts. Also provides a simple interface for compliant extensions for dapps.
Apache License 2.0
974 stars 417 forks source link

About syntax detection, jslint and tsc build config #1194

Closed qqqzhch closed 1 year ago

qqqzhch commented 1 year ago

About syntax check, jslint and tsc build config Recently, I made some changes to my wallet. After modifying the error message of jslint prompt, I started to build. I found that there was also syntax information that caused the package to fail, I checked that it was caused by the configuration during the build of typesript

tsc --build tsconfig.build.json

I think such syntax check should be same in development and build,Or include it in jslint instead of finding a lot of syntax errors when preparing to build

> tsc --build tsconfig.build.json&&polkadot-dev-run-lint

packages/extension-base/src/background/handlers/State.ts:15:1 - error TS6133: 'accountsObservable' is declared but its value is never read.

15 import { accounts as accountsObservable } from '@polkadot/ui-keyring/observable/accounts';
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/extension-base/src/background/handlers/State.ts:156:10 - error TS2564: Property 'API' has no initializer and is not definitely assigned in the constructor.

156   public API: ApiPromise;