diff --git a/.eslintignore b/.eslintignore index 1fe9188b..3fe7c1ef 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,3 +8,7 @@ examples/ generated/ proto/ types/ + +# Type definitions are never written by hand in this repo. Even when checked-in +# as a source file, it is auto-generated stuff following other projects' rules. +*.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index d78f9590..773c0802 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,33 @@ module.exports = { "simple-import-sort/sort": "warn", "@typescript-eslint/array-type": ["warn", { default: "array-simple" }], "@typescript-eslint/await-thenable": "warn", + "@typescript-eslint/camelcase": "off", // deprecated in favour of @typescript-eslint/naming-convention, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md "@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }], + "@typescript-eslint/naming-convention": [ + "warn", + { + selector: "default", + format: ["strictCamelCase"], + }, + { + selector: "typeLike", + format: ["StrictPascalCase"], + }, + { + selector: "enumMember", + format: ["StrictPascalCase"], + }, + { + selector: "variable", + format: ["strictCamelCase"], + leadingUnderscore: "allow", + }, + { + selector: "parameter", + format: ["strictCamelCase"], + leadingUnderscore: "allow", + }, + ], "@typescript-eslint/no-dynamic-delete": "warn", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", @@ -59,11 +85,5 @@ module.exports = { "@typescript-eslint/no-non-null-assertion": "off", }, }, - { - files: "jasmine-testrunner.js", - rules: { - "@typescript-eslint/camelcase": ["error", { properties: "never" }], - }, - }, ], }; diff --git a/packages/cli/jasmine-testrunner.js b/packages/cli/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/cli/jasmine-testrunner.js +++ b/packages/cli/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/cosmwasm/jasmine-testrunner.js b/packages/cosmwasm/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/cosmwasm/jasmine-testrunner.js +++ b/packages/cosmwasm/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts b/packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts index 19979b42..dc131f78 100644 --- a/packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts +++ b/packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin, coins, @@ -91,9 +91,7 @@ describe("CosmWasmClient.searchTx", () => { const sendMsg: MsgSend = { type: "cosmos-sdk/MsgSend", value: { - // eslint-disable-next-line @typescript-eslint/camelcase from_address: alice.address0, - // eslint-disable-next-line @typescript-eslint/camelcase to_address: recipient, amount: transferAmount, }, diff --git a/packages/cosmwasm/src/cosmwasmclient.spec.ts b/packages/cosmwasm/src/cosmwasmclient.spec.ts index 555e113c..f41a1b40 100644 --- a/packages/cosmwasm/src/cosmwasmclient.spec.ts +++ b/packages/cosmwasm/src/cosmwasmclient.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { Sha256 } from "@cosmjs/crypto"; import { Bech32, fromHex, fromUtf8, toAscii, toBase64 } from "@cosmjs/encoding"; import { makeSignBytes, MsgSend, Secp256k1Wallet, StdFee } from "@cosmjs/sdk38"; diff --git a/packages/cosmwasm/src/lcdapi/wasm.spec.ts b/packages/cosmwasm/src/lcdapi/wasm.spec.ts index 0d3aa836..868010a1 100644 --- a/packages/cosmwasm/src/lcdapi/wasm.spec.ts +++ b/packages/cosmwasm/src/lcdapi/wasm.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { Sha256 } from "@cosmjs/crypto"; import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } from "@cosmjs/encoding"; import { diff --git a/packages/cosmwasm/src/lcdapi/wasm.ts b/packages/cosmwasm/src/lcdapi/wasm.ts index f0b70f65..060e99fd 100644 --- a/packages/cosmwasm/src/lcdapi/wasm.ts +++ b/packages/cosmwasm/src/lcdapi/wasm.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { fromBase64, fromUtf8, toHex, toUtf8 } from "@cosmjs/encoding"; import { LcdApiArray, LcdClient, normalizeLcdApiArray } from "@cosmjs/sdk38"; diff --git a/packages/cosmwasm/src/logs.spec.ts b/packages/cosmwasm/src/logs.spec.ts index 584d9ef2..37be68e8 100644 --- a/packages/cosmwasm/src/logs.spec.ts +++ b/packages/cosmwasm/src/logs.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { parseAttribute, parseEvent, parseLog, parseLogs } from "./logs"; describe("logs", () => { diff --git a/packages/cosmwasm/src/logs.ts b/packages/cosmwasm/src/logs.ts index f37ff56c..bd5798af 100644 --- a/packages/cosmwasm/src/logs.ts +++ b/packages/cosmwasm/src/logs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { isNonNullObject } from "@cosmjs/utils"; export interface Attribute { diff --git a/packages/cosmwasm/src/msgs.ts b/packages/cosmwasm/src/msgs.ts index 7aae1b6c..eef9bb0e 100644 --- a/packages/cosmwasm/src/msgs.ts +++ b/packages/cosmwasm/src/msgs.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin, Msg } from "@cosmjs/sdk38"; /** diff --git a/packages/cosmwasm/src/signingcosmwasmclient.spec.ts b/packages/cosmwasm/src/signingcosmwasmclient.spec.ts index 927458a7..6c249071 100644 --- a/packages/cosmwasm/src/signingcosmwasmclient.spec.ts +++ b/packages/cosmwasm/src/signingcosmwasmclient.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Sha256 } from "@cosmjs/crypto"; import { toHex } from "@cosmjs/encoding"; import { AuthExtension, coin, coins, LcdClient, Secp256k1Wallet, setupAuthExtension } from "@cosmjs/sdk38"; @@ -254,7 +255,6 @@ describe("SigningCosmWasmClient", () => { assert(state2); expect(state2).toEqual({ ...state1, - // eslint-disable-next-line @typescript-eslint/camelcase code_id: codeId2, }); }); diff --git a/packages/cosmwasm/src/signingcosmwasmclient.ts b/packages/cosmwasm/src/signingcosmwasmclient.ts index 4a4b1df9..35c0caea 100644 --- a/packages/cosmwasm/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm/src/signingcosmwasmclient.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Sha256 } from "@cosmjs/crypto"; import { toBase64, toHex } from "@cosmjs/encoding"; import { Uint53 } from "@cosmjs/math"; @@ -213,7 +214,6 @@ export class SigningCosmWasmClient extends CosmWasmClient { type: "wasm/store-code", value: { sender: this.senderAddress, - // eslint-disable-next-line @typescript-eslint/camelcase wasm_byte_code: toBase64(compressed), source: source, builder: builder, @@ -257,12 +257,9 @@ export class SigningCosmWasmClient extends CosmWasmClient { type: "wasm/instantiate", value: { sender: this.senderAddress, - // eslint-disable-next-line @typescript-eslint/camelcase code_id: new Uint53(codeId).toString(), label: label, - // eslint-disable-next-line @typescript-eslint/camelcase init_msg: initMsg, - // eslint-disable-next-line @typescript-eslint/camelcase init_funds: options.transferAmount || [], admin: options.admin, }, @@ -299,7 +296,6 @@ export class SigningCosmWasmClient extends CosmWasmClient { value: { sender: this.senderAddress, contract: contractAddress, - // eslint-disable-next-line @typescript-eslint/camelcase new_admin: newAdmin, }, }; @@ -366,7 +362,6 @@ export class SigningCosmWasmClient extends CosmWasmClient { value: { sender: this.senderAddress, contract: contractAddress, - // eslint-disable-next-line @typescript-eslint/camelcase code_id: new Uint53(codeId).toString(), msg: migrateMsg, }, @@ -405,7 +400,6 @@ export class SigningCosmWasmClient extends CosmWasmClient { sender: this.senderAddress, contract: contractAddress, msg: handleMsg, - // eslint-disable-next-line @typescript-eslint/camelcase sent_funds: transferAmount || [], }, }; @@ -439,9 +433,7 @@ export class SigningCosmWasmClient extends CosmWasmClient { const sendMsg: MsgSend = { type: "cosmos-sdk/MsgSend", value: { - // eslint-disable-next-line @typescript-eslint/camelcase from_address: this.senderAddress, - // eslint-disable-next-line @typescript-eslint/camelcase to_address: recipientAddress, amount: transferAmount, }, diff --git a/packages/crypto/jasmine-testrunner.js b/packages/crypto/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/crypto/jasmine-testrunner.js +++ b/packages/crypto/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/demo-staking/jasmine-testrunner.js b/packages/demo-staking/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/demo-staking/jasmine-testrunner.js +++ b/packages/demo-staking/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/demo-staking/src/index.spec.ts b/packages/demo-staking/src/index.spec.ts index 6c6fa869..08797548 100644 --- a/packages/demo-staking/src/index.spec.ts +++ b/packages/demo-staking/src/index.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { SigningCosmWasmClient } from "@cosmjs/cosmwasm"; import { Coin, coins, makeCosmoshubPath, Secp256k1Wallet } from "@cosmjs/sdk38"; diff --git a/packages/encoding/jasmine-testrunner.js b/packages/encoding/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/encoding/jasmine-testrunner.js +++ b/packages/encoding/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/encoding/src/utf8.ts b/packages/encoding/src/utf8.ts index 75b16d55..a23b0091 100644 --- a/packages/encoding/src/utf8.ts +++ b/packages/encoding/src/utf8.ts @@ -1,7 +1,9 @@ // Global symbols in some environments // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder // https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder +/* eslint-disable-next-line @typescript-eslint/naming-convention */ declare const TextEncoder: any | undefined; +/* eslint-disable-next-line @typescript-eslint/naming-convention */ declare const TextDecoder: any | undefined; function isValidUtf8(data: Uint8Array): boolean { diff --git a/packages/faucet/jasmine-testrunner.js b/packages/faucet/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/faucet/jasmine-testrunner.js +++ b/packages/faucet/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/json-rpc/jasmine-testrunner.js b/packages/json-rpc/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/json-rpc/jasmine-testrunner.js +++ b/packages/json-rpc/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/math/jasmine-testrunner.js b/packages/math/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/math/jasmine-testrunner.js +++ b/packages/math/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/proto-signing/jasmine-testrunner.js b/packages/proto-signing/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/proto-signing/jasmine-testrunner.js +++ b/packages/proto-signing/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/proto-signing/src/decorator.spec.ts b/packages/proto-signing/src/decorator.spec.ts index 6c68aaba..d644f77b 100644 --- a/packages/proto-signing/src/decorator.spec.ts +++ b/packages/proto-signing/src/decorator.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert } from "@cosmjs/utils"; import { Message } from "protobufjs"; diff --git a/packages/proto-signing/src/demo.spec.ts b/packages/proto-signing/src/demo.spec.ts index 32a0e51f..2e623bd2 100644 --- a/packages/proto-signing/src/demo.spec.ts +++ b/packages/proto-signing/src/demo.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert } from "@cosmjs/utils"; import protobuf from "protobufjs"; diff --git a/packages/proto-signing/src/demo.ts b/packages/proto-signing/src/demo.ts index 09baa378..b794b415 100644 --- a/packages/proto-signing/src/demo.ts +++ b/packages/proto-signing/src/demo.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Field, Root, Type } from "protobufjs"; export const MsgDemo = new Type("MsgDemo").add(new Field("example", 1, "string")); diff --git a/packages/proto-signing/src/magic.spec.ts b/packages/proto-signing/src/magic.spec.ts index 08842538..f5c095ee 100644 --- a/packages/proto-signing/src/magic.spec.ts +++ b/packages/proto-signing/src/magic.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { Message } from "protobufjs"; import { cosmosField, cosmosMessage } from "./decorator"; diff --git a/packages/proto-signing/src/msgs.spec.ts b/packages/proto-signing/src/msgs.spec.ts index e30c9799..bd7b8352 100644 --- a/packages/proto-signing/src/msgs.spec.ts +++ b/packages/proto-signing/src/msgs.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { fromHex } from "@cosmjs/encoding"; import { cosmos_sdk as cosmosSdk } from "./generated/codecimpl"; diff --git a/packages/proto-signing/src/msgs.ts b/packages/proto-signing/src/msgs.ts index d62c0a50..051f2a1c 100644 --- a/packages/proto-signing/src/msgs.ts +++ b/packages/proto-signing/src/msgs.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Message } from "protobufjs"; import { cosmosField, cosmosMessage } from "./decorator"; diff --git a/packages/proto-signing/src/registry.spec.ts b/packages/proto-signing/src/registry.spec.ts index df31df02..352c287d 100644 --- a/packages/proto-signing/src/registry.spec.ts +++ b/packages/proto-signing/src/registry.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert } from "@cosmjs/utils"; import { MsgDemo as MsgDemoType } from "./demo"; diff --git a/packages/proto-signing/src/registry.ts b/packages/proto-signing/src/registry.ts index 95c99e37..eb5d0e41 100644 --- a/packages/proto-signing/src/registry.ts +++ b/packages/proto-signing/src/registry.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import protobuf from "protobufjs"; import { cosmos_sdk as cosmosSdk, google } from "./generated/codecimpl"; diff --git a/packages/sdk38/jasmine-testrunner.js b/packages/sdk38/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/sdk38/jasmine-testrunner.js +++ b/packages/sdk38/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/sdk38/src/cosmosclient.searchtx.spec.ts b/packages/sdk38/src/cosmosclient.searchtx.spec.ts index 3f244466..82247d28 100644 --- a/packages/sdk38/src/cosmosclient.searchtx.spec.ts +++ b/packages/sdk38/src/cosmosclient.searchtx.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert, sleep } from "@cosmjs/utils"; import { coins } from "./coins"; @@ -44,9 +44,7 @@ describe("CosmosClient.searchTx", () => { const sendMsg: MsgSend = { type: "cosmos-sdk/MsgSend", value: { - // eslint-disable-next-line @typescript-eslint/camelcase from_address: faucet.address, - // eslint-disable-next-line @typescript-eslint/camelcase to_address: recipient, amount: transferAmount, }, diff --git a/packages/sdk38/src/cosmosclient.spec.ts b/packages/sdk38/src/cosmosclient.spec.ts index 29e2d991..198b39fe 100644 --- a/packages/sdk38/src/cosmosclient.spec.ts +++ b/packages/sdk38/src/cosmosclient.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert, sleep } from "@cosmjs/utils"; import { ReadonlyDate } from "readonly-date"; diff --git a/packages/sdk38/src/encoding.ts b/packages/sdk38/src/encoding.ts index c5cefc8d..70ef1f23 100644 --- a/packages/sdk38/src/encoding.ts +++ b/packages/sdk38/src/encoding.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { toUtf8 } from "@cosmjs/encoding"; import { Msg } from "./msgs"; @@ -44,9 +45,7 @@ export function makeSignBytes( sequence: number, ): Uint8Array { const signDoc: StdSignDoc = { - // eslint-disable-next-line @typescript-eslint/camelcase account_number: accountNumber.toString(), - // eslint-disable-next-line @typescript-eslint/camelcase chain_id: chainId, fee: fee, memo: memo, diff --git a/packages/sdk38/src/lcdapi/auth.spec.ts b/packages/sdk38/src/lcdapi/auth.spec.ts index 2cd2ed45..de87fef8 100644 --- a/packages/sdk38/src/lcdapi/auth.spec.ts +++ b/packages/sdk38/src/lcdapi/auth.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { encodeBech32Pubkey } from "../pubkey"; import { faucet, diff --git a/packages/sdk38/src/lcdapi/auth.ts b/packages/sdk38/src/lcdapi/auth.ts index d9066733..942d117b 100644 --- a/packages/sdk38/src/lcdapi/auth.ts +++ b/packages/sdk38/src/lcdapi/auth.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin } from "../coins"; import { LcdClient } from "./lcdclient"; diff --git a/packages/sdk38/src/lcdapi/base.ts b/packages/sdk38/src/lcdapi/base.ts index 9b13b20d..2b7bd112 100644 --- a/packages/sdk38/src/lcdapi/base.ts +++ b/packages/sdk38/src/lcdapi/base.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { CosmosSdkTx } from "../types"; /** diff --git a/packages/sdk38/src/lcdapi/lcdclient.spec.ts b/packages/sdk38/src/lcdapi/lcdclient.spec.ts index b928af0c..04fa2d41 100644 --- a/packages/sdk38/src/lcdapi/lcdclient.spec.ts +++ b/packages/sdk38/src/lcdapi/lcdclient.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { assert, sleep } from "@cosmjs/utils"; import { Coin } from "../coins"; @@ -247,9 +247,7 @@ describe("LcdClient", () => { const sendMsg: MsgSend = { type: "cosmos-sdk/MsgSend", value: { - // eslint-disable-next-line @typescript-eslint/camelcase from_address: faucet.address, - // eslint-disable-next-line @typescript-eslint/camelcase to_address: recipient, amount: transferAmount, }, diff --git a/packages/sdk38/src/lcdapi/lcdclient.ts b/packages/sdk38/src/lcdapi/lcdclient.ts index c2233651..3ea8d844 100644 --- a/packages/sdk38/src/lcdapi/lcdclient.ts +++ b/packages/sdk38/src/lcdapi/lcdclient.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-dupe-class-members */ +/* eslint-disable no-dupe-class-members, @typescript-eslint/naming-convention */ import { assert, isNonNullObject } from "@cosmjs/utils"; import axios, { AxiosError, AxiosInstance } from "axios"; diff --git a/packages/sdk38/src/lcdapi/mint.spec.ts b/packages/sdk38/src/lcdapi/mint.spec.ts index 201a461e..ff14941b 100644 --- a/packages/sdk38/src/lcdapi/mint.spec.ts +++ b/packages/sdk38/src/lcdapi/mint.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { bigDecimalMatcher, nonNegativeIntegerMatcher, diff --git a/packages/sdk38/src/lcdapi/mint.ts b/packages/sdk38/src/lcdapi/mint.ts index 7f8cde68..98fee42d 100644 --- a/packages/sdk38/src/lcdapi/mint.ts +++ b/packages/sdk38/src/lcdapi/mint.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { LcdClient } from "./lcdclient"; export interface MintParametersResponse { diff --git a/packages/sdk38/src/lcdapi/slashing.spec.ts b/packages/sdk38/src/lcdapi/slashing.spec.ts index 5e6db321..83c96ce4 100644 --- a/packages/sdk38/src/lcdapi/slashing.spec.ts +++ b/packages/sdk38/src/lcdapi/slashing.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { nonNegativeIntegerMatcher, pendingWithoutWasmd, wasmd } from "../testutils.spec"; import { LcdClient } from "./lcdclient"; import { setupSlashingExtension, SlashingExtension } from "./slashing"; diff --git a/packages/sdk38/src/lcdapi/slashing.ts b/packages/sdk38/src/lcdapi/slashing.ts index 3f023b30..5338cf52 100644 --- a/packages/sdk38/src/lcdapi/slashing.ts +++ b/packages/sdk38/src/lcdapi/slashing.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { LcdClient } from "./lcdclient"; interface SlashingSigningInfo { diff --git a/packages/sdk38/src/logs.spec.ts b/packages/sdk38/src/logs.spec.ts index 584d9ef2..37be68e8 100644 --- a/packages/sdk38/src/logs.spec.ts +++ b/packages/sdk38/src/logs.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { parseAttribute, parseEvent, parseLog, parseLogs } from "./logs"; describe("logs", () => { diff --git a/packages/sdk38/src/logs.ts b/packages/sdk38/src/logs.ts index f37ff56c..bd5798af 100644 --- a/packages/sdk38/src/logs.ts +++ b/packages/sdk38/src/logs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ import { isNonNullObject } from "@cosmjs/utils"; export interface Attribute { diff --git a/packages/sdk38/src/msgs.ts b/packages/sdk38/src/msgs.ts index 8644eb6a..02cae441 100644 --- a/packages/sdk38/src/msgs.ts +++ b/packages/sdk38/src/msgs.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin } from "./coins"; export interface Msg { diff --git a/packages/sdk38/src/signature.spec.ts b/packages/sdk38/src/signature.spec.ts index 6d29d18a..dd1d6a38 100644 --- a/packages/sdk38/src/signature.spec.ts +++ b/packages/sdk38/src/signature.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { fromBase64 } from "@cosmjs/encoding"; import { decodeSignature, encodeSecp256k1Signature } from "./signature"; @@ -11,7 +12,6 @@ describe("signature", () => { "1nUcIH0CLT0/nQ0mBTDrT6kMG20NY/PsH7P2gc4bpYNGLEYjBmdWevXUJouSE/9A/60QG9cYeqyTe5kFDeIPxQ==", ); expect(encodeSecp256k1Signature(pubkey, signature)).toEqual({ - // eslint-disable-next-line @typescript-eslint/camelcase pub_key: { type: "tendermint/PubKeySecp256k1", value: "AtQaCqFnshaZQp6rIkvAPyzThvCvXSDO+9AzbxVErqJP", @@ -49,7 +49,6 @@ describe("signature", () => { describe("decodeSignature", () => { it("works for secp256k1", () => { const signature: StdSignature = { - // eslint-disable-next-line @typescript-eslint/camelcase pub_key: { type: "tendermint/PubKeySecp256k1", value: "AtQaCqFnshaZQp6rIkvAPyzThvCvXSDO+9AzbxVErqJP", diff --git a/packages/sdk38/src/signature.ts b/packages/sdk38/src/signature.ts index bd38fde6..d94ad665 100644 --- a/packages/sdk38/src/signature.ts +++ b/packages/sdk38/src/signature.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { fromBase64, toBase64 } from "@cosmjs/encoding"; import { encodeSecp256k1Pubkey } from "./pubkey"; @@ -17,7 +18,6 @@ export function encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Arr } return { - // eslint-disable-next-line @typescript-eslint/camelcase pub_key: encodeSecp256k1Pubkey(pubkey), signature: toBase64(signature), }; diff --git a/packages/sdk38/src/signingcosmosclient.ts b/packages/sdk38/src/signingcosmosclient.ts index 63d7f89a..50cc3496 100644 --- a/packages/sdk38/src/signingcosmosclient.ts +++ b/packages/sdk38/src/signingcosmosclient.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin, coins } from "./coins"; import { Account, CosmosClient, GetNonceResult, PostTxResult } from "./cosmosclient"; import { makeSignBytes } from "./encoding"; @@ -81,9 +82,7 @@ export class SigningCosmosClient extends CosmosClient { const sendMsg: MsgSend = { type: "cosmos-sdk/MsgSend", value: { - // eslint-disable-next-line @typescript-eslint/camelcase from_address: this.senderAddress, - // eslint-disable-next-line @typescript-eslint/camelcase to_address: recipientAddress, amount: transferAmount, }, diff --git a/packages/sdk38/src/types.ts b/packages/sdk38/src/types.ts index ecfea0c7..e0de1e84 100644 --- a/packages/sdk38/src/types.ts +++ b/packages/sdk38/src/types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Coin } from "./coins"; import { Msg } from "./msgs"; diff --git a/packages/sdk40/jasmine-testrunner.js b/packages/sdk40/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/sdk40/jasmine-testrunner.js +++ b/packages/sdk40/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/socket/jasmine-testrunner.js b/packages/socket/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/socket/jasmine-testrunner.js +++ b/packages/socket/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/socket/src/reconnectingsocket.spec.ts b/packages/socket/src/reconnectingsocket.spec.ts index 4dbc6245..137fca62 100644 --- a/packages/socket/src/reconnectingsocket.spec.ts +++ b/packages/socket/src/reconnectingsocket.spec.ts @@ -92,7 +92,7 @@ describe("ReconnectingSocket", () => { describe("reconnection", () => { const dirPath = "../../scripts/socketserver"; - const PKILL_NO_PROCESSES_MATCHED = 1; + const codePkillNoProcessesMatched = 1; const startServerCmd = `${dirPath}/start.sh`; const stopServerCmd = `${dirPath}/stop.sh`; @@ -101,7 +101,7 @@ describe("ReconnectingSocket", () => { pendingWithoutSocketServer(); exec!(stopServerCmd, (stopError) => { - if (stopError && stopError.code !== PKILL_NO_PROCESSES_MATCHED) { + if (stopError && stopError.code !== codePkillNoProcessesMatched) { done.fail(stopError); } @@ -164,7 +164,7 @@ describe("ReconnectingSocket", () => { setTimeout( () => exec!(stopServerCmd, (stopError) => { - if (stopError && stopError.code !== PKILL_NO_PROCESSES_MATCHED) { + if (stopError && stopError.code !== codePkillNoProcessesMatched) { done.fail(stopError); } diff --git a/packages/stream/jasmine-testrunner.js b/packages/stream/jasmine-testrunner.js index a04dbed9..7a17962e 100644 --- a/packages/stream/jasmine-testrunner.js +++ b/packages/stream/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/tendermint-rpc/jasmine-testrunner.js b/packages/tendermint-rpc/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/tendermint-rpc/jasmine-testrunner.js +++ b/packages/tendermint-rpc/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/packages/tendermint-rpc/src/adaptorforversion.ts b/packages/tendermint-rpc/src/adaptorforversion.ts index 8688f134..eaecf1a8 100644 --- a/packages/tendermint-rpc/src/adaptorforversion.ts +++ b/packages/tendermint-rpc/src/adaptorforversion.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ // This module exposes translators for multiple tendermint versions // Pick a version that matches the server to properly encode the data types import { Adaptor } from "./adaptor"; diff --git a/packages/tendermint-rpc/src/client.spec.ts b/packages/tendermint-rpc/src/client.spec.ts index 62c8730a..ac8ee019 100644 --- a/packages/tendermint-rpc/src/client.spec.ts +++ b/packages/tendermint-rpc/src/client.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { toAscii } from "@cosmjs/encoding"; import { firstEvent, toListPromise } from "@cosmjs/stream"; import { sleep } from "@cosmjs/utils"; @@ -168,7 +169,6 @@ function defaultTestSuite(rpcFactory: () => RpcClient, adaptor: Adaptor): void { // tendermint, else you get empty results const query = buildQuery({ tags: [{ key: "app.key", value: find }] }); - // eslint-disable-next-line @typescript-eslint/camelcase const s = await client.txSearch({ query: query, page: 1, per_page: 30 }); // should find the tx expect(s.totalCount).toEqual(1); @@ -217,19 +217,16 @@ function defaultTestSuite(rpcFactory: () => RpcClient, adaptor: Adaptor): void { await tendermintSearchIndexUpdated(); // expect one page of results - // eslint-disable-next-line @typescript-eslint/camelcase const s1 = await client.txSearch({ query: query, page: 1, per_page: 2 }); expect(s1.totalCount).toEqual(3); expect(s1.txs.length).toEqual(2); // second page - // eslint-disable-next-line @typescript-eslint/camelcase const s2 = await client.txSearch({ query: query, page: 2, per_page: 2 }); expect(s2.totalCount).toEqual(3); expect(s2.txs.length).toEqual(1); // and all together now - // eslint-disable-next-line @typescript-eslint/camelcase const sall = await client.txSearchAll({ query: query, per_page: 2 }); expect(sall.totalCount).toEqual(3); expect(sall.txs.length).toEqual(3); diff --git a/packages/tendermint-rpc/src/index.ts b/packages/tendermint-rpc/src/index.ts index 19f23350..3044fd5d 100644 --- a/packages/tendermint-rpc/src/index.ts +++ b/packages/tendermint-rpc/src/index.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ // exported to access version-specific hashing export { v0_33 } from "./v0-33"; diff --git a/packages/tendermint-rpc/src/requests.ts b/packages/tendermint-rpc/src/requests.ts index 54a26cd2..21ba5648 100644 --- a/packages/tendermint-rpc/src/requests.ts +++ b/packages/tendermint-rpc/src/requests.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { As } from "type-tagger"; /** diff --git a/packages/tendermint-rpc/src/responses.ts b/packages/tendermint-rpc/src/responses.ts index 8c9f4443..edaff61e 100644 --- a/packages/tendermint-rpc/src/responses.ts +++ b/packages/tendermint-rpc/src/responses.ts @@ -220,8 +220,8 @@ export interface Commit { * raw values from https://github.com/tendermint/tendermint/blob/dfa9a9a30a666132425b29454e90a472aa579a48/types/vote.go#L44 */ export enum VoteType { - PREVOTE = 1, - PRECOMMIT = 2, + PreVote = 1, + PreCommit = 2, } export interface Vote { diff --git a/packages/tendermint-rpc/src/v0-33/index.ts b/packages/tendermint-rpc/src/v0-33/index.ts index bedc804c..af38b9cf 100644 --- a/packages/tendermint-rpc/src/v0-33/index.ts +++ b/packages/tendermint-rpc/src/v0-33/index.ts @@ -1,9 +1,9 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { Adaptor } from "../adaptor"; import { hashBlock, hashTx } from "./hasher"; import { Params } from "./requests"; import { Responses } from "./responses"; -// eslint-disable-next-line @typescript-eslint/camelcase export const v0_33: Adaptor = { params: Params, responses: Responses, diff --git a/packages/tendermint-rpc/src/v0-33/requests.ts b/packages/tendermint-rpc/src/v0-33/requests.ts index 3aa8333b..f3c1dc7a 100644 --- a/packages/tendermint-rpc/src/v0-33/requests.ts +++ b/packages/tendermint-rpc/src/v0-33/requests.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { toHex } from "@cosmjs/encoding"; import { JsonRpcRequest } from "@cosmjs/json-rpc"; @@ -75,7 +76,6 @@ function encodeTxSearchParams(params: requests.TxSearchParams): RpcTxSearchParam query: params.query, prove: params.prove, page: may(Integer.encode, params.page), - // eslint-disable-next-line @typescript-eslint/camelcase per_page: may(Integer.encode, params.per_page), }; } diff --git a/packages/tendermint-rpc/src/v0-33/responses.ts b/packages/tendermint-rpc/src/v0-33/responses.ts index 7059567a..d5462bca 100644 --- a/packages/tendermint-rpc/src/v0-33/responses.ts +++ b/packages/tendermint-rpc/src/v0-33/responses.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import { fromHex } from "@cosmjs/encoding"; import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; diff --git a/packages/tendermint-rpc/types/responses.d.ts b/packages/tendermint-rpc/types/responses.d.ts index 6565e6ba..fd5a8082 100644 --- a/packages/tendermint-rpc/types/responses.d.ts +++ b/packages/tendermint-rpc/types/responses.d.ts @@ -175,8 +175,8 @@ export interface Commit { * raw values from https://github.com/tendermint/tendermint/blob/dfa9a9a30a666132425b29454e90a472aa579a48/types/vote.go#L44 */ export declare enum VoteType { - PREVOTE = 1, - PRECOMMIT = 2, + PreVote = 1, + PreCommit = 2, } export interface Vote { readonly type: VoteType; diff --git a/packages/utils/jasmine-testrunner.js b/packages/utils/jasmine-testrunner.js index a04dbed9..7a17962e 100755 --- a/packages/utils/jasmine-testrunner.js +++ b/packages/utils/jasmine-testrunner.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/naming-convention */ require("source-map-support").install(); const defaultSpecReporterConfig = require("../../jasmine-spec-reporter.config.json"); diff --git a/scripts/wasmd/deploy_erc20.js b/scripts/wasmd/deploy_erc20.js index 6ce0f5c9..1170986d 100755 --- a/scripts/wasmd/deploy_erc20.js +++ b/scripts/wasmd/deploy_erc20.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); const { Secp256k1Wallet } = require("@cosmjs/sdk38"); const fs = require("fs"); diff --git a/scripts/wasmd/deploy_nameservice.js b/scripts/wasmd/deploy_nameservice.js index 1a20340e..e28b8d9b 100755 --- a/scripts/wasmd/deploy_nameservice.js +++ b/scripts/wasmd/deploy_nameservice.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); const { Secp256k1Wallet } = require("@cosmjs/sdk38"); const fs = require("fs"); diff --git a/scripts/wasmd/deploy_staking.js b/scripts/wasmd/deploy_staking.js index ce9b32bb..e9f57124 100755 --- a/scripts/wasmd/deploy_staking.js +++ b/scripts/wasmd/deploy_staking.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); const { coins, Secp256k1Wallet } = require("@cosmjs/sdk38"); const fs = require("fs");