diff --git a/.pnp.cjs b/.pnp.cjs index af093215ea..c96afd92f5 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -277,10 +277,6 @@ const RAW_RUNTIME_STATE = "@eslint-community/regexpp",\ "npm:4.12.1"\ ],\ - [\ - "@eslint/compat",\ - "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:1.3.1"\ - ],\ [\ "@eslint/eslintrc",\ "npm:3.3.1"\ @@ -3106,7 +3102,6 @@ const RAW_RUNTIME_STATE = ["@cosmjs/encoding", "workspace:packages/encoding"],\ ["@cosmjs/proto-signing", "workspace:packages/proto-signing"],\ ["@cosmjs/stargate", "workspace:packages/stargate"],\ - ["@eslint/compat", "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:1.3.1"],\ ["@eslint/eslintrc", "npm:3.3.1"],\ ["@eslint/js", "npm:8.57.1"],\ ["@typescript-eslint/eslint-plugin", "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:8.39.0"],\ @@ -4020,28 +4015,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["@eslint/compat", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/@eslint-compat-npm-1.3.1-41a44c7960-8dfcea5ecb.zip/node_modules/@eslint/compat/",\ - "packageDependencies": [\ - ["@eslint/compat", "npm:1.3.1"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:1.3.1", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-compat-virtual-feb91cc737/0/cache/@eslint-compat-npm-1.3.1-41a44c7960-8dfcea5ecb.zip/node_modules/@eslint/compat/",\ - "packageDependencies": [\ - ["@eslint/compat", "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:1.3.1"],\ - ["@types/eslint", null],\ - ["eslint", "npm:8.57.1"]\ - ],\ - "packagePeers": [\ - "@types/eslint",\ - "eslint"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@eslint/eslintrc", [\ ["npm:2.1.4", {\ "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.4-1ff4b5f908-32f67052b8.zip/node_modules/@eslint/eslintrc/",\ @@ -7435,7 +7408,6 @@ const RAW_RUNTIME_STATE = ["@cosmjs/encoding", "workspace:packages/encoding"],\ ["@cosmjs/proto-signing", "workspace:packages/proto-signing"],\ ["@cosmjs/stargate", "workspace:packages/stargate"],\ - ["@eslint/compat", "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:1.3.1"],\ ["@eslint/eslintrc", "npm:3.3.1"],\ ["@eslint/js", "npm:8.57.1"],\ ["@typescript-eslint/eslint-plugin", "virtual:5e84e7553054e678344c9584f8c875c24d817f4c617606b54c4b4cc7ac3f929af81710850c40f70a573fe1c4c8107e4e9bf2f796bbaaed428c1211083577d86f#npm:8.39.0"],\ diff --git a/.yarn/cache/@eslint-compat-npm-1.3.1-41a44c7960-8dfcea5ecb.zip b/.yarn/cache/@eslint-compat-npm-1.3.1-41a44c7960-8dfcea5ecb.zip deleted file mode 100644 index f3d112174a..0000000000 --- a/.yarn/cache/@eslint-compat-npm-1.3.1-41a44c7960-8dfcea5ecb.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:930d1a99ed58d5b25a35e056cfa9be97272f675f2010a4119452a456ad953b0c -size 52281 diff --git a/eslint.config.mjs b/eslint.config.mjs index 7c94c2a3e3..484d418ca5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,5 @@ -import { fixupPluginRules } from "@eslint/compat"; import js from "@eslint/js"; import typescriptEslint from "@typescript-eslint/eslint-plugin"; -import tsParser from "@typescript-eslint/parser"; import importt from "eslint-plugin-import"; import prettier from "eslint-plugin-prettier/recommended"; import simpleImportSort from "eslint-plugin-simple-import-sort"; @@ -13,11 +11,10 @@ export default [ }, js.configs.recommended, prettier, - // importt.flatConfigs.recommended, + importt.flatConfigs.recommended, { plugins: { "simple-import-sort": simpleImportSort, - import: fixupPluginRules(importt), }, languageOptions: { @@ -30,6 +27,12 @@ export default [ ecmaVersion: 2022, }, + settings: { + "import/resolver": { + typescript: {}, + }, + }, + rules: { curly: ["warn", "multi-line", "consistent"], "no-bitwise": "warn", @@ -55,20 +58,16 @@ export default [ }, ], - "import/no-cycle": "off", "simple-import-sort/imports": "warn", "simple-import-sort/exports": "warn", }, }, + { files: ["**/*.ts"], ...importt.flatConfigs.typescript }, + ...typescriptEslint.configs["flat/strict-type-checked"].map((c) => ({ files: ["**/*.ts"], ...c })), { files: ["**/*.ts"], - plugins: { - "@typescript-eslint": fixupPluginRules(typescriptEslint), - }, - languageOptions: { - parser: tsParser, ecmaVersion: 2022, parserOptions: { @@ -76,20 +75,9 @@ export default [ }, }, - settings: { - "import/resolver": { - typescript: {}, - }, - }, - rules: { "no-shadow": "off", "no-unused-vars": "off", - ...typescriptEslint.configs["flat/strict-type-checked"].reduce( - (obj, c) => Object.assign(obj, c.rules), - {}, - ), - ...importt.flatConfigs.typescript.rules, // lints from 'strict-type-checked' config "@typescript-eslint/no-deprecated": "off", diff --git a/package.json b/package.json index ac94e49c6e..4ba0ddc650 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "@cosmjs/encoding": "workspace:^", "@cosmjs/proto-signing": "workspace:^", "@cosmjs/stargate": "workspace:^", - "@eslint/compat": "^1.3.1", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^8.57.1", "@typescript-eslint/eslint-plugin": "^8.39.0", diff --git a/packages/ledger-amino/src/ledgerconnector.ts b/packages/ledger-amino/src/ledgerconnector.ts index e4a12670c6..89640d773a 100644 --- a/packages/ledger-amino/src/ledgerconnector.ts +++ b/packages/ledger-amino/src/ledgerconnector.ts @@ -6,7 +6,7 @@ import { assert } from "@cosmjs/utils"; import Transport from "@ledgerhq/hw-transport"; // eslint-disable-next-line @typescript-eslint/naming-convention import CosmosApp from "@zondax/ledger-cosmos-js"; -import semver from "semver"; +import semverGte from "semver/functions/gte.js"; const cosmosHdPath = makeCosmoshubPath(0); const cosmosBech32Prefix = "cosmos"; @@ -125,7 +125,7 @@ export class LedgerConnector { private async verifyAppVersion(): Promise { const version = await this.getCosmosAppVersion(); - if (!semver.gte(version, this.minLedgerAppVersion)) { + if (!semverGte(version, this.minLedgerAppVersion)) { throw new Error( `Outdated version: Please update ${this.ledgerAppName} Ledger App to the latest version.`, ); diff --git a/yarn.lock b/yarn.lock index 2f52356b26..6213179229 100644 --- a/yarn.lock +++ b/yarn.lock @@ -811,18 +811,6 @@ __metadata: languageName: node linkType: hard -"@eslint/compat@npm:^1.3.1": - version: 1.3.1 - resolution: "@eslint/compat@npm:1.3.1" - peerDependencies: - eslint: ^8.40 || 9 - peerDependenciesMeta: - eslint: - optional: true - checksum: 10c0/8dfcea5ecb854111f9c0acc23a469e0a25cdaddceb5fb40c47988c247d6e32ec199bcd00f1b8ba9ed779228526552703c4b74948169e78b78b5fd814e04b042b - languageName: node - linkType: hard - "@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" @@ -3039,7 +3027,6 @@ __metadata: "@cosmjs/encoding": "workspace:^" "@cosmjs/proto-signing": "workspace:^" "@cosmjs/stargate": "workspace:^" - "@eslint/compat": "npm:^1.3.1" "@eslint/eslintrc": "npm:^3.3.1" "@eslint/js": "npm:^8.57.1" "@typescript-eslint/eslint-plugin": "npm:^8.39.0"