From 2fd333ec3ab1cfde561a1b6abc483690d17cda64 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 15 Aug 2019 14:13:21 +0200 Subject: [PATCH] eslint updates --- .eslintrc | 13 ++++++++----- integration/ocean/AuthenticationToken.test.ts | 8 ++++---- integration/ocean/Signature.test.ts | 1 - src/Instantiable.abstract.ts | 4 ---- src/brizo/Brizo.ts | 1 - src/keeper/ContractEvent.ts | 2 -- .../templates/AgreementTemplate.abstract.ts | 1 - test/ddo/DDO.test.ts | 1 - test/keeper/ContractHandler.test.ts | 3 +-- test/keeper/conditions/EscrowReward.test.ts | 2 +- 10 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.eslintrc b/.eslintrc index b1d59a9..c7660c2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,11 @@ "ecmaFeatures": { "jsx": false }, - "project": "./tsconfig.json" + "project": [ + "./tsconfig.json", + "./test/tsconfig.json", + "./integration/tsconfig.json" + ] }, "extends": [ "oceanprotocol", @@ -20,8 +24,10 @@ "error", { "multiline": { "delimiter": "none" } } ], + "@typescript-eslint/ban-ts-ignore": "off", "@typescript-eslint/indent": "off", "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-member-accessibility": "off", @@ -29,10 +35,7 @@ "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-object-literal-type-assertion": "off", "@typescript-eslint/no-parameter-properties": "off", - "no-empty": [ - "error", - { "allowEmptyCatch": true } - ], + "no-empty": ["error", { "allowEmptyCatch": true }], "prefer-destructuring": ["warn"], "no-dupe-class-members": ["warn"], "no-useless-constructor": ["warn"] diff --git a/integration/ocean/AuthenticationToken.test.ts b/integration/ocean/AuthenticationToken.test.ts index a2c22ff..c93d8ea 100644 --- a/integration/ocean/AuthenticationToken.test.ts +++ b/integration/ocean/AuthenticationToken.test.ts @@ -1,7 +1,5 @@ import { assert } from 'chai' - import { config } from '../config' - import { Ocean, Account } from '../../src' // @oceanprotocol/squid describe('Authentication Token', () => { @@ -56,8 +54,10 @@ describe('Authentication Token', () => { }) it('should know if the token is stored', async () => { - let acc1Stored - let acc2Stored + let acc1Stored: boolean + let acc2Stored: boolean + + // eslint-disable-next-line acc1Stored = await ocean.auth.isStored(account1) acc2Stored = await ocean.auth.isStored(account2) diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index 2d51fb6..a8632a6 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -86,7 +86,6 @@ describe('Signature', () => { assert.equal( signature, - // tslint:disable-next-line '0x3aa8a1c48b8e582d694bbd4ba3a29fde573b78da9720dc48baeb831b2163e1fa6e10e983882ebf8a00f4124de2505136354fd146934053f0d58bba4eced5f8d000', 'The signatuere is not correct.' ) diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index fbf9ec4..4e04861 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -82,13 +82,9 @@ export abstract class Instantiable { instance._logger = logger } - // tslint:disable-next-line private _ocean: Ocean - // tslint:disable-next-line private _web3: Web3 - // tslint:disable-next-line private _config: Config - // tslint:disable-next-line private _logger: Logger protected setInstanceConfig(config: InstantiableConfig) { diff --git a/src/brizo/Brizo.ts b/src/brizo/Brizo.ts index 94b060d..62628d7 100644 --- a/src/brizo/Brizo.ts +++ b/src/brizo/Brizo.ts @@ -41,7 +41,6 @@ export class Brizo extends Instantiable { _notUsed: string, container: string ) { - // tslint:disable-next-line return `${this.url}${apiPath}/compute` } diff --git a/src/keeper/ContractEvent.ts b/src/keeper/ContractEvent.ts index 2385fc2..7220ec3 100644 --- a/src/keeper/ContractEvent.ts +++ b/src/keeper/ContractEvent.ts @@ -1,9 +1,7 @@ import ContractBase from './contracts/ContractBase' interface EventEmitter { - // tslint:disable-next-line subscribe: Function - // tslint:disable-next-line unsubscribe: Function } diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 467df66..963928a 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -36,7 +36,6 @@ export abstract class AgreementTemplate extends ContractBase { super(contractName) } - // tslint:disable-next-line public createAgreement( agreementId: string, did: string, diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 63efd21..5cf055c 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -83,7 +83,6 @@ describe('DDO', () => { }, { type: 'Compute', - // tslint:disable-next-line serviceEndpoint: 'http://mybrizo.org/api/v1/brizo/services/compute?pubKey={pubKey}&serviceId={serviceId}&algo={algo}&container={container}' }, diff --git a/test/keeper/ContractHandler.test.ts b/test/keeper/ContractHandler.test.ts index 802903d..7564fa2 100644 --- a/test/keeper/ContractHandler.test.ts +++ b/test/keeper/ContractHandler.test.ts @@ -7,8 +7,7 @@ describe('ContractHandler', () => { let contractHandler: ContractHandler before(async () => { - const instanceConfig = ((await Ocean.getInstance(config)) as any) - .instanceConfig + const { instanceConfig } = (await Ocean.getInstance(config)) as any contractHandler = new ContractHandler(instanceConfig) }) diff --git a/test/keeper/conditions/EscrowReward.test.ts b/test/keeper/conditions/EscrowReward.test.ts index 57bcac1..361b59c 100644 --- a/test/keeper/conditions/EscrowReward.test.ts +++ b/test/keeper/conditions/EscrowReward.test.ts @@ -16,7 +16,7 @@ describe('EscrowReward', () => { let releaseCondition before(async () => { - const keeper = (await Ocean.getInstance(config)).keeper + const { keeper } = await Ocean.getInstance(config) await TestContractHandler.prepareContracts() condition = keeper.conditions.escrowReward