1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

run type checking as part of linting

This commit is contained in:
Matthias Kretschmann 2020-08-19 13:15:48 +02:00
parent bbd465992b
commit bb04309f72
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 8 additions and 7 deletions

View File

@ -10,9 +10,10 @@
"build:tsc": "tsc --sourceMap", "build:tsc": "tsc --sourceMap",
"build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:metadata": "./scripts/get-metadata.js > src/metadata.json",
"clean": "rm -rf ./dist/ ./doc/ ./.nyc_output", "clean": "rm -rf ./dist/ ./doc/ ./.nyc_output",
"lint": "eslint --ignore-path .gitignore --ext .ts,.tsx .", "lint": "eslint --ignore-path .gitignore --ext .ts,.tsx . && npm run type-check",
"lint:fix": "eslint --ignore-path .gitignore --ext .ts,.tsx . --fix", "lint:fix": "eslint --ignore-path .gitignore --ext .ts,.tsx . --fix",
"format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'",
"type-check": "tsc --noEmit",
"doc:json": "./scripts/typedoc.js", "doc:json": "./scripts/typedoc.js",
"run": "ts-node", "run": "ts-node",
"release": "release-it --non-interactive", "release": "release-it --non-interactive",

View File

@ -29,7 +29,7 @@ export class OceanPool extends Pool {
* @param {String} token Data Token address * @param {String} token Data Token address
* @param {String} amount Data Token amount * @param {String} amount Data Token amount
* @param {String} weight Data Token weight * @param {String} weight Data Token weight
* @return {any} * @return {String}
*/ */
public async createDTPool( public async createDTPool(
account: string, account: string,
@ -38,7 +38,7 @@ export class OceanPool extends Pool {
weight: string, weight: string,
fee: string, fee: string,
finalize = true finalize = true
): Promise<any> { ): Promise<string> {
if (this.oceanAddress == null) { if (this.oceanAddress == null) {
console.error('oceanAddress is not defined') console.error('oceanAddress is not defined')
return null return null
@ -90,9 +90,9 @@ export class OceanPool extends Pool {
* Get Ocean Token balance of a pool * Get Ocean Token balance of a pool
* @param {String} account * @param {String} account
* @param {String} poolAddress * @param {String} poolAddress
* @return {any} * @return {String}
*/ */
public async getOceanReserve(account: string, poolAddress: string): Promise<any> { public async getOceanReserve(account: string, poolAddress: string): Promise<string> {
if (this.oceanAddress == null) { if (this.oceanAddress == null) {
console.error('oceanAddress is not defined') console.error('oceanAddress is not defined')
return null return null
@ -104,9 +104,9 @@ export class OceanPool extends Pool {
* Get Data Token balance of a pool * Get Data Token balance of a pool
* @param {String} account * @param {String} account
* @param {String} poolAddress * @param {String} poolAddress
* @return {any} * @return {String}
*/ */
public async getDTReserve(account: string, poolAddress: string): Promise<any> { public async getDTReserve(account: string, poolAddress: string): Promise<string> {
await this.getDTAddress(account, poolAddress) await this.getDTAddress(account, poolAddress)
return super.getReserve(account, poolAddress, this.dtAddress) return super.getReserve(account, poolAddress, this.dtAddress)
} }