Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 73 additions & 70 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ module.exports = {
node: true,
worker: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
project: true,
},
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:import/typescript",
],
parser: "espree",
parserOptions: { ecmaVersion: 2022 },
plugins: ["prettier", "simple-import-sort", "import"],
extends: ["eslint:recommended", "prettier", "plugin:prettier/recommended", "plugin:import/recommended"],
rules: {
curly: ["warn", "multi-line", "consistent"],
"no-bitwise": "warn",
Expand All @@ -36,73 +27,85 @@ module.exports = {
"import/no-cycle": "warn",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
"@typescript-eslint/explicit-member-accessibility": "warn",
"@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",
},
{
// For object literal keys we want to allow things like numbers (e.g. 35),
// type URLs (e.g. "/cosmos.feegrant.v1beta1.MsgGrantAllowance") or test data (e.g. "0.14ucoin2")
selector: "objectLiteralProperty",
format: null,
},
],
"@typescript-eslint/no-dynamic-delete": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/parameter-properties": "warn",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/prefer-readonly": "warn",
},
overrides: [
{
files: "**/*.cjs",
parser: "espree",
parserOptions: { ecmaVersion: 2022 },
files: "**/*.ts",
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
project: true,
},
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended-type-checked", "plugin:import/typescript"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/consistent-type-exports": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/prefer-readonly": "off",
"import/no-unresolved": "off",
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
"@typescript-eslint/consistent-type-exports": "warn",
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
"@typescript-eslint/explicit-member-accessibility": "warn",
"@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",
},
{
// For object literal keys we want to allow things like numbers (e.g. 35),
// type URLs (e.g. "/cosmos.feegrant.v1beta1.MsgGrantAllowance") or test data (e.g. "0.14ucoin2")
selector: "objectLiteralProperty",
format: null,
},
],
"@typescript-eslint/no-dynamic-delete": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/parameter-properties": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/unbound-method": "off",
},
},
{
files: "**/*.spec.ts",
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/require-await": "off",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ignoring them in-place? How many of those do we have?

Copy link
Contributor Author

@dynst dynst Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For unit tests, there's a lot of boilerplate, and part of the boilerplate is passing async () => ... to the test framework, and it honestly seems very harmless to keep all that boilerplate the same even for tests that don't have an await call in them?

Outside of unit tests... yeah, there's a lot there too. A lot of asynchronous APIs. 15 warnings, but there will be more if you merge #1722

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sounds good. Yeah no problem having a relaxed linter for test code.

},
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/stargate/src/modules/slashing/queries.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {
QueryClientImpl,
QueryParamsResponse,
QuerySigningInfoResponse,
QuerySigningInfosResponse,
} from "cosmjs-types/cosmos/slashing/v1beta1/query";
import { QueryClientImpl } from "cosmjs-types/cosmos/slashing/v1beta1/query";

import { createPagination, createProtobufRpcClient, QueryClient } from "../../queryclient";

Expand Down
3 changes: 1 addition & 2 deletions packages/stargate/src/multisignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { fromBech32 } from "@cosmjs/encoding";
import { encodePubkey } from "@cosmjs/proto-signing";
import { CompactBitArray, MultiSignature } from "cosmjs-types/cosmos/crypto/multisig/v1beta1/multisig";
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
import { AuthInfo, SignerInfo } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { AuthInfo, SignerInfo, TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";

export function makeCompactBitArray(bits: readonly boolean[]): CompactBitArray {
const byteCount = Math.ceil(bits.length / 8);
Expand Down
18 changes: 8 additions & 10 deletions packages/stargate/src/signingstargateclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ import { calculateFee, GasPrice } from "./fee";
import {
authzTypes,
bankTypes,
createAuthzAminoConverters,
createBankAminoConverters,
createDistributionAminoConverters,
createFeegrantAminoConverters,
createGovAminoConverters,
createIbcAminoConverters,
createStakingAminoConverters,
createVestingAminoConverters,
distributionTypes,
feegrantTypes,
govTypes,
Expand All @@ -40,16 +48,6 @@ import {
stakingTypes,
vestingTypes,
} from "./modules";
import {
createAuthzAminoConverters,
createBankAminoConverters,
createDistributionAminoConverters,
createFeegrantAminoConverters,
createGovAminoConverters,
createIbcAminoConverters,
createStakingAminoConverters,
createVestingAminoConverters,
} from "./modules";
import { DeliverTxResponse, StargateClient, StargateClientOptions } from "./stargateclient";

export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [
Expand Down
7 changes: 1 addition & 6 deletions scripts/wasmd/deploy_hackatom.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ async function main() {

const wasm = fs.readFileSync(__dirname + "/contracts/hackatom.wasm");
const uploadFee = calculateFee(1_500_000, gasPrice);
const uploadReceipt = await client.upload(
alice.address0,
wasm,
uploadFee,
"Upload hackatom contract",
);
const uploadReceipt = await client.upload(alice.address0, wasm, uploadFee, "Upload hackatom contract");
console.info(`Upload succeeded. Receipt:`, uploadReceipt);

const instantiateFee = calculateFee(500_000, gasPrice);
Expand Down
7 changes: 1 addition & 6 deletions scripts/wasmd/deploy_ibc_reflect.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ async function main() {

const wasm = fs.readFileSync(__dirname + "/contracts/ibc_reflect.wasm");
const uploadFee = calculateFee(2_500_000, gasPrice);
const uploadReceipt = await client.upload(
alice.address0,
wasm,
uploadFee,
"Upload IBC reflect contract",
);
const uploadReceipt = await client.upload(alice.address0, wasm, uploadFee, "Upload IBC reflect contract");
console.info(`Upload succeeded. Receipt:`, uploadReceipt);

const instantiateFee = calculateFee(900_000, gasPrice);
Expand Down
6 changes: 1 addition & 5 deletions scripts/wasmd/send_first.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ const { coins } = require("@cosmjs/amino");
const { Random } = require("@cosmjs/crypto");
const { toBech32 } = require("@cosmjs/encoding");
const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing");
const {
assertIsDeliverTxSuccess,
SigningStargateClient,
calculateFee,
} = require("@cosmjs/stargate");
const { assertIsDeliverTxSuccess, SigningStargateClient, calculateFee } = require("@cosmjs/stargate");

const rpcUrl = "http://localhost:26659";
const prefix = "wasm";
Expand Down
Loading