diff --git a/.eslintrc.js b/.eslintrc.js index 6a8df6c681..d4798d36b9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,18 +27,6 @@ module.exports = { // needs to be switched on at some point '@typescript-eslint/no-explicit-any': 'off', // this seems very broken atm, false positives - '@typescript-eslint/unbound-method': 'off', - 'simple-import-sort/imports': [ - 'error', - { - groups: [ - ['^\u0000'], - ['^[^/\\.].*\u0000$', '^@polkadot.*\u0000$', '^\\..*\u0000$'], - ['^[^/\\.]'], - ['^@polkadot'], - ['^\\.'] - ], - }, - ] + '@typescript-eslint/unbound-method': 'off' } }; diff --git a/package.json b/package.json index 9df9560055..ac10d870fe 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@babel/register": "^7.12.1", "@babel/runtime": "^7.12.5", "@pinata/sdk": "^1.1.11", - "@polkadot/dev": "^0.60.8", + "@polkadot/dev": "^0.60.11", "@polkadot/ts": "^0.3.57", "@types/bn.js": "^4.11.6", "@types/chart.js": "^2.9.28", @@ -84,7 +84,6 @@ "electron": "^10.1.6", "electron-builder": "^22.9.1", "electron-builder-notarize": "^1.2.0", - "eslint-plugin-simple-import-sort": "7.0.0-beta.1", "i18next-scanner": "^2.11.0", "react": "^17.0.1", "react-dom": "^17.0.1", diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index d347d39a2a..e31d6e6f6a 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -12,8 +12,6 @@ import chainRococo from './chains/rococo.svg'; import chainRococoTick from './chains/rococo-tick.svg'; import chainRococoTrack from './chains/rococo-track.svg'; import chainRococoTrick from './chains/rococo-trick.svg'; -// last-resort fallback, just something empty -import emptyLogo from './empty.svg'; // extensions // alphabetical import extensionPolkadotJs from './extensions/polkadot-js.svg'; @@ -54,6 +52,8 @@ import nodeSora from './nodes/sora-substrate.svg'; import nodeStafi from './nodes/stafi.png'; import nodeSubsocial from './nodes/subsocial.svg'; import nodeSubstrate from './nodes/substrate-hexagon.svg'; +// last-resort fallback, just something empty +import emptyLogo from './empty.svg'; // Alphabetical overrides based on the actual matched chain name // NOTE: This is as retrieved via system.chain RPC diff --git a/packages/apps-electron/package.json b/packages/apps-electron/package.json index 5f1e989ca8..387c5d85ab 100644 --- a/packages/apps-electron/package.json +++ b/packages/apps-electron/package.json @@ -6,7 +6,7 @@ "dependencies": { "@babel/core": "^7.12.9", "@babel/polyfill": "^7.12.1", - "@polkadot/dev": "^0.60.8", + "@polkadot/dev": "^0.60.11", "@polkadot/react-components": "^0.70.2-1", "electron-log": "^4.3.0", "electron-updater": "^4.3.5" diff --git a/packages/apps/package.json b/packages/apps/package.json index eccc8d74c4..4041c64815 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -16,7 +16,7 @@ "@babel/runtime": "^7.12.5", "@polkadot/apps-config": "^0.70.2-1", "@polkadot/apps-routing": "^0.70.2-1", - "@polkadot/dev": "^0.60.8", + "@polkadot/dev": "^0.60.11", "@polkadot/react-api": "^0.70.2-1", "@polkadot/react-components": "^0.70.2-1", "@polkadot/react-hooks": "^0.70.2-1", diff --git a/packages/apps/src/Apps.tsx b/packages/apps/src/Apps.tsx index ac7025397f..5fabddf651 100644 --- a/packages/apps/src/Apps.tsx +++ b/packages/apps/src/Apps.tsx @@ -12,9 +12,9 @@ import GlobalStyle from '@polkadot/react-components/styles'; import { useApi } from '@polkadot/react-hooks'; import Signer from '@polkadot/react-signer'; +import ConnectingOverlay from './overlays/Connecting'; import Content from './Content'; import Menu from './Menu'; -import ConnectingOverlay from './overlays/Connecting'; import WarmUp from './WarmUp'; export const PORTAL_ID = 'portals'; diff --git a/packages/apps/src/Menu/index.tsx b/packages/apps/src/Menu/index.tsx index 514447628f..e28d548b49 100644 --- a/packages/apps/src/Menu/index.tsx +++ b/packages/apps/src/Menu/index.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TFunction } from 'i18next'; import type { Route, Routes } from '@polkadot/apps-routing/types'; import type { ApiProps } from '@polkadot/react-api/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { TFunction } from 'i18next'; import type { Group, Groups, ItemRoute } from './types'; import React, { useMemo, useRef } from 'react'; diff --git a/packages/page-accounts/src/index.tsx b/packages/page-accounts/src/index.tsx index c2b190a976..b46c38635a 100644 --- a/packages/page-accounts/src/index.tsx +++ b/packages/page-accounts/src/index.tsx @@ -9,8 +9,8 @@ import { Route, Switch } from 'react-router'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useAccounts, useIpfs } from '@polkadot/react-hooks'; -import Accounts from './Accounts'; import basicMd from './md/basic.md'; +import Accounts from './Accounts'; import { useTranslation } from './translate'; import useCounter from './useCounter'; import Vanity from './Vanity'; diff --git a/packages/page-contracts/src/index.tsx b/packages/page-contracts/src/index.tsx index 29d78b087e..0b24eef077 100644 --- a/packages/page-contracts/src/index.tsx +++ b/packages/page-contracts/src/index.tsx @@ -9,14 +9,14 @@ import styled from 'styled-components'; import { Button, HelpOverlay, Tabs } from '@polkadot/react-components'; import { useContracts, useToggle } from '@polkadot/react-hooks'; -import Banner from './Banner'; -import Codes from './Codes'; import CodeAdd from './Codes/Add'; import CodeUpload from './Codes/Upload'; -import Contracts from './Contracts'; import ContractAdd from './Contracts/Add'; -import Deploy from './Deploy'; import introMd from './md/intro.md'; +import Banner from './Banner'; +import Codes from './Codes'; +import Contracts from './Contracts'; +import Deploy from './Deploy'; import store from './store'; import Summary from './Summary'; import { useTranslation } from './translate'; diff --git a/packages/page-democracy/src/index.tsx b/packages/page-democracy/src/index.tsx index 5261e0473f..b844d3d08a 100644 --- a/packages/page-democracy/src/index.tsx +++ b/packages/page-democracy/src/index.tsx @@ -6,9 +6,9 @@ import { Route, Switch } from 'react-router'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; -import Execute from './Execute'; import useDispatchCounter from './Execute/useCounter'; import basicMd from './md/basic.md'; +import Execute from './Execute'; import Overview from './Overview'; import { useTranslation } from './translate'; diff --git a/packages/page-generic-asset/src/Assets.tsx b/packages/page-generic-asset/src/Assets.tsx index 558ca7e26e..feadf2d9d5 100644 --- a/packages/page-generic-asset/src/Assets.tsx +++ b/packages/page-generic-asset/src/Assets.tsx @@ -9,9 +9,9 @@ import React, { useState } from 'react'; import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import { Button, CardGrid } from '@polkadot/react-components'; +import CreateModal from './modals/Create'; import AssetCard from './AssetCard'; import assetRegistry, { AssetsSubjectInfo } from './assetsRegistry'; -import CreateModal from './modals/Create'; import translate from './translate'; interface Props extends I18nProps { diff --git a/packages/page-js/src/Playground.tsx b/packages/page-js/src/Playground.tsx index d949811f91..4fb9020555 100644 --- a/packages/page-js/src/Playground.tsx +++ b/packages/page-js/src/Playground.tsx @@ -17,11 +17,11 @@ import uiKeyring from '@polkadot/ui-keyring'; import * as util from '@polkadot/util'; import * as hashing from '@polkadot/util-crypto'; +import makeWrapper from './snippets/wrapping'; import ActionButtons from './ActionButtons'; import { CUSTOM_LABEL, STORE_EXAMPLES, STORE_SELECTED } from './constants'; import Output from './Output'; import allSnippets from './snippets'; -import makeWrapper from './snippets/wrapping'; import { useTranslation } from './translate'; interface Injected { diff --git a/packages/page-parachains/src/util.ts b/packages/page-parachains/src/util.ts index cae3b54241..289d5f1b5b 100644 --- a/packages/page-parachains/src/util.ts +++ b/packages/page-parachains/src/util.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import type { TFunction } from 'i18next'; +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; export function parachainName (t: TFunction, info: DeriveParachainInfo | null): string { return info?.name || t('Unknown Chain'); diff --git a/packages/page-settings/src/index.tsx b/packages/page-settings/src/index.tsx index 48a344a62e..bc225e8e88 100644 --- a/packages/page-settings/src/index.tsx +++ b/packages/page-settings/src/index.tsx @@ -9,10 +9,10 @@ import { Route, Switch } from 'react-router'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; +import md from './md/basics.md'; import Developer from './Developer'; import General from './General'; import I18n from './I18n'; -import md from './md/basics.md'; import Metadata from './Metadata'; import { useTranslation } from './translate'; import useCounter from './useCounter'; diff --git a/packages/page-staking/src/Payouts/index.tsx b/packages/page-staking/src/Payouts/index.tsx index b4f72ccd20..d2f22bd4e7 100644 --- a/packages/page-staking/src/Payouts/index.tsx +++ b/packages/page-staking/src/Payouts/index.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TFunction } from 'i18next'; import type { DeriveStakerReward } from '@polkadot/api-derive/types'; import type { StakerState } from '@polkadot/react-hooks/types'; -import type { TFunction } from 'i18next'; import type { PayoutStash, PayoutValidator } from './types'; import BN from 'bn.js'; diff --git a/packages/page-staking/src/index.tsx b/packages/page-staking/src/index.tsx index 2c6b9424f9..39fbeecf4e 100644 --- a/packages/page-staking/src/index.tsx +++ b/packages/page-staking/src/index.tsx @@ -15,11 +15,11 @@ import Tabs from '@polkadot/react-components/Tabs'; import { useAccounts, useApi, useAvailableSlashes, useCall, useFavorites, useOwnStashInfos } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; +import basicMd from './md/basic.md'; +import Summary from './Overview/Summary'; import Actions from './Actions'; import { STORE_FAVS_BASE } from './constants'; -import basicMd from './md/basic.md'; import Overview from './Overview'; -import Summary from './Overview/Summary'; import Payouts from './Payouts'; import Query from './Query'; import Slashes from './Slashes'; diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 812ddb3eec..bf211a824f 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TFunction } from 'i18next'; import type { DeriveBalancesAll, DeriveDemocracyLock, DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { BlockNumber, LockIdentifier, ValidatorPrefsTo145 } from '@polkadot/types/interfaces'; -import type { TFunction } from 'i18next'; import BN from 'bn.js'; import React from 'react'; diff --git a/packages/react-components/src/CopyButton.tsx b/packages/react-components/src/CopyButton.tsx index 519c4fe15c..c60740beff 100644 --- a/packages/react-components/src/CopyButton.tsx +++ b/packages/react-components/src/CopyButton.tsx @@ -7,8 +7,8 @@ import React, { useCallback, useContext } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import styled from 'styled-components'; -import Button from './Button'; import StatusContext from './Status/Context'; +import Button from './Button'; import { useTranslation } from './translate'; interface Props { diff --git a/packages/react-components/src/DemocracyLocks.tsx b/packages/react-components/src/DemocracyLocks.tsx index 830ee966e0..f9e944a85f 100644 --- a/packages/react-components/src/DemocracyLocks.tsx +++ b/packages/react-components/src/DemocracyLocks.tsx @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; import type { TFunction } from 'i18next'; +import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; diff --git a/packages/react-components/src/EditButton.tsx b/packages/react-components/src/EditButton.tsx index 7d85c6986d..f128e1773f 100644 --- a/packages/react-components/src/EditButton.tsx +++ b/packages/react-components/src/EditButton.tsx @@ -7,8 +7,8 @@ import type { VoidFn } from './types'; import React from 'react'; import styled from 'styled-components'; -import Icon from './Icon'; import { colorLink } from './styles/theme'; +import Icon from './Icon'; interface Props { children?: React.ReactNode; diff --git a/packages/react-components/src/InputAddressSimple.tsx b/packages/react-components/src/InputAddressSimple.tsx index c657af071f..d032071ef4 100644 --- a/packages/react-components/src/InputAddressSimple.tsx +++ b/packages/react-components/src/InputAddressSimple.tsx @@ -4,9 +4,9 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; +import addressToAddress from './util/toAddress'; import IdentityIcon from './IdentityIcon'; import Input from './Input'; -import addressToAddress from './util/toAddress'; interface Props { autoFocus?: boolean; diff --git a/packages/react-components/src/InputExtrinsic/index.tsx b/packages/react-components/src/InputExtrinsic/index.tsx index 5619826d95..b89f9e8810 100644 --- a/packages/react-components/src/InputExtrinsic/index.tsx +++ b/packages/react-components/src/InputExtrinsic/index.tsx @@ -8,9 +8,9 @@ import React, { useCallback, useState } from 'react'; import { useApi } from '@polkadot/react-hooks'; -import LinkedWrapper from './LinkedWrapper'; import methodOptions from './options/method'; import sectionOptions from './options/section'; +import LinkedWrapper from './LinkedWrapper'; import SelectMethod from './SelectMethod'; import SelectSection from './SelectSection'; diff --git a/packages/react-components/src/types.ts b/packages/react-components/src/types.ts index 1e6769eedf..9d0eb134d6 100644 --- a/packages/react-components/src/types.ts +++ b/packages/react-components/src/types.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { WithTranslation } from 'react-i18next'; import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { Abi } from '@polkadot/api-contract'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { TxState } from '@polkadot/react-hooks/types'; import type { AccountId, Index } from '@polkadot/types/interfaces'; -import type { WithTranslation } from 'react-i18next'; import type { ButtonProps } from './Button/types'; import type { InputAddressProps } from './InputAddress/types'; import type { TxCallback, TxFailedCallback } from './Status/types'; diff --git a/packages/react-params/src/Param/Vector.tsx b/packages/react-params/src/Param/Vector.tsx index d4b919dcf6..6668eea0fb 100644 --- a/packages/react-params/src/Param/Vector.tsx +++ b/packages/react-params/src/Param/Vector.tsx @@ -8,9 +8,9 @@ import React, { useCallback, useEffect, useState } from 'react'; import { Button } from '@polkadot/react-components'; import { isUndefined } from '@polkadot/util'; -import Params from '../'; import getInitValue from '../initValue'; import { useTranslation } from '../translate'; +import Params from '../'; import Base from './Base'; import useParamDefs from './useParamDefs'; diff --git a/packages/react-params/src/Param/VectorFixed.tsx b/packages/react-params/src/Param/VectorFixed.tsx index 3bc17299ff..8daad20b90 100644 --- a/packages/react-params/src/Param/VectorFixed.tsx +++ b/packages/react-params/src/Param/VectorFixed.tsx @@ -7,8 +7,8 @@ import React, { useEffect, useState } from 'react'; import { isUndefined } from '@polkadot/util'; -import Params from '../'; import getInitValue from '../initValue'; +import Params from '../'; import Base from './Base'; import useParamDefs from './useParamDefs'; diff --git a/yarn.lock b/yarn.lock index c2c98d554f..299301c72c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2273,7 +2273,7 @@ __metadata: dependencies: "@babel/core": ^7.12.9 "@babel/polyfill": ^7.12.1 - "@polkadot/dev": ^0.60.8 + "@polkadot/dev": ^0.60.11 "@polkadot/react-components": ^0.70.2-1 "@types/react-dom": ^17.0.0 "@types/tmp": ^0.2.0 @@ -2307,7 +2307,7 @@ __metadata: "@babel/runtime": ^7.12.5 "@polkadot/apps-config": ^0.70.2-1 "@polkadot/apps-routing": ^0.70.2-1 - "@polkadot/dev": ^0.60.8 + "@polkadot/dev": ^0.60.11 "@polkadot/react-api": ^0.70.2-1 "@polkadot/react-components": ^0.70.2-1 "@polkadot/react-hooks": ^0.70.2-1 @@ -2334,9 +2334,9 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev@npm:^0.60.8": - version: 0.60.8 - resolution: "@polkadot/dev@npm:0.60.8" +"@polkadot/dev@npm:^0.60.11": + version: 0.60.11 + resolution: "@polkadot/dev@npm:0.60.11" dependencies: "@babel/cli": ^7.12.8 "@babel/core": ^7.12.9 @@ -2378,6 +2378,7 @@ __metadata: eslint-plugin-promise: ^4.2.1 eslint-plugin-react: ^7.21.5 eslint-plugin-react-hooks: ^4.2.0 + eslint-plugin-simple-import-sort: ^7.0.0-beta.1 eslint-plugin-sort-destructure-keys: ^1.3.5 fs-extra: ^9.0.1 gh-pages: ^3.1.0 @@ -2398,7 +2399,7 @@ __metadata: typedoc-plugin-markdown: ^3.0.11 typedoc-plugin-no-inherit: ^1.2.0 typescript: ^4.1.2 - yargs: ^16.1.1 + yargs: ^16.2.0 bin: polkadot-ci-ghact-build: scripts/polkadot-ci-ghact-build.cjs polkadot-ci-ghact-docs: scripts/polkadot-ci-ghact-docs.cjs @@ -2422,7 +2423,7 @@ __metadata: polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.cjs polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.cjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs - checksum: e9b4dd08aa90de176f719fdfa4b2b810e9219fb554b7c1137dc6ae28f6ea7aa608447ce0050c16a739a98bbae979f4fd09e41a77ad08c7ada04784dcbf61fcc0 + checksum: d583afb3162f8e806d1226ae71cf2860a276fb9e3b2a89c91596d6fec4dd3638555cdfa7568a2f09371bb1a77db485a61d82354aa3867458d8dea60212a99664 languageName: node linkType: hard @@ -8001,7 +8002,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-simple-import-sort@npm:7.0.0-beta.1": +"eslint-plugin-simple-import-sort@npm:^7.0.0-beta.1": version: 7.0.0-beta.1 resolution: "eslint-plugin-simple-import-sort@npm:7.0.0-beta.1" peerDependencies: @@ -14219,7 +14220,7 @@ fsevents@~2.1.2: "@babel/register": ^7.12.1 "@babel/runtime": ^7.12.5 "@pinata/sdk": ^1.1.11 - "@polkadot/dev": ^0.60.8 + "@polkadot/dev": ^0.60.11 "@polkadot/ts": ^0.3.57 "@types/bn.js": ^4.11.6 "@types/chart.js": ^2.9.28 @@ -14238,7 +14239,6 @@ fsevents@~2.1.2: electron: ^10.1.6 electron-builder: ^22.9.1 electron-builder-notarize: ^1.2.0 - eslint-plugin-simple-import-sort: 7.0.0-beta.1 i18next-scanner: ^2.11.0 react: ^17.0.1 react-dom: ^17.0.1