From 96820a03a523c28cfef1f1e9e1058bbbc2458403 Mon Sep 17 00:00:00 2001 From: Nodari Chkuaselidze Date: Tue, 28 Nov 2023 15:18:14 +0400 Subject: [PATCH] lint: update to es2020. Use latest bslint --- .eslintrc.json | 15 ++------------- lib/dns/resource.js | 2 +- lib/primitives/airdropkey.js | 2 +- lib/primitives/claim.js | 2 +- lib/wallet/wallet.js | 2 +- test/interactive-swap-test.js | 2 +- test/util/memwallet.js | 2 +- test/wallet-test.js | 2 +- 8 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3de38b429..c1a6b0ea8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,19 +1,9 @@ { "env": { - "es6": true, + "es2020": true, "node": true }, "extends": "eslint:recommended", - "globals": { - "Atomics": "readable", - "BigInt": "readable", - "BigInt64Array": "readable", - "BigUint64Array": "readable", - "queueMicrotask": "readable", - "SharedArrayBuffer": "readable", - "TextEncoder": "readable", - "TextDecoder": "readable" - }, "overrides": [ { "files": ["*.mjs"], @@ -44,9 +34,8 @@ } } ], - "parser": "babel-eslint", "parserOptions": { - "ecmaVersion": 10, + "ecmaVersion": 11, "ecmaFeatures": { "globalReturn": true }, diff --git a/lib/dns/resource.js b/lib/dns/resource.js index a4d7869f1..1478d0466 100644 --- a/lib/dns/resource.js +++ b/lib/dns/resource.js @@ -877,7 +877,7 @@ function typeToClass(type) { function stringToClass(type) { assert(typeof type === 'string'); - if (!hsTypes.hasOwnProperty(type)) + if (!Object.prototype.hasOwnProperty.call(hsTypes, type)) return null; return typeToClass(hsTypes[type]); diff --git a/lib/primitives/airdropkey.js b/lib/primitives/airdropkey.js index 3f4427632..1cc167aa7 100644 --- a/lib/primitives/airdropkey.js +++ b/lib/primitives/airdropkey.js @@ -363,7 +363,7 @@ class AirdropKey extends bio.Struct { fromJSON(json) { assert(json && typeof json === 'object'); assert(typeof json.type === 'string'); - assert(keyTypes.hasOwnProperty(json.type)); + assert(Object.prototype.hasOwnProperty.call(keyTypes, json.type)); this.type = keyTypes[json.type]; diff --git a/lib/primitives/claim.js b/lib/primitives/claim.js index c18a84da6..32b6b8858 100644 --- a/lib/primitives/claim.js +++ b/lib/primitives/claim.js @@ -175,7 +175,7 @@ class Claim extends bio.Struct { Buffer.from(data.name, 'binary'), flags, data.commitHash, - data.commitHeight, + data.commitHeight ); tx.inputs.push(input); diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index d10926271..5b4f23806 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -3268,7 +3268,7 @@ class Wallet extends EventEmitter { flags, ns.claimed, ns.renewals, - await this.wdb.getRenewalBlock(), + await this.wdb.getRenewalBlock() ); if (!mtx) diff --git a/test/interactive-swap-test.js b/test/interactive-swap-test.js index 305ea6047..705418186 100644 --- a/test/interactive-swap-test.js +++ b/test/interactive-swap-test.js @@ -170,7 +170,7 @@ describe('Interactive name swap', function() { 0, // flags, may be required if name was CLAIMed ns.claimed, ns.renewals, - await wdb.getRenewalBlock(), + await wdb.getRenewalBlock() ); const output1 = new Output(); diff --git a/test/util/memwallet.js b/test/util/memwallet.js index 57d47c15c..20e18b4c5 100644 --- a/test/util/memwallet.js +++ b/test/util/memwallet.js @@ -1538,7 +1538,7 @@ class MemWallet { flags, ns.claimed, ns.renewals, - this.getRenewalBlock(), + this.getRenewalBlock() ); const mtx = new MTX(); diff --git a/test/wallet-test.js b/test/wallet-test.js index 6dc2b00b6..8a17be5d1 100644 --- a/test/wallet-test.js +++ b/test/wallet-test.js @@ -2723,7 +2723,7 @@ describe('Wallet', function() { output.covenant.setReveal( nameHash, start, - Buffer.alloc(32), + Buffer.alloc(32) ); const mtx = new MTX();