diff --git a/.cursor/commands/create-pr.md b/.cursor/commands/create-pr.md index a0838cb37f..49622711f8 100644 --- a/.cursor/commands/create-pr.md +++ b/.cursor/commands/create-pr.md @@ -21,7 +21,7 @@ _Note_ in the command output, format all URLs as clickable Markdown links: `[Lin - If found, fetch the issue details using `gh issue view [issue_number]` - Include "Resolves #[issue_number]" at the very beginning of the description (in the "Description and Related Issue(s)" section) - Summarize the changes clearly and concisely, using no more than two paragraphs. If necessary, use bullet points to highlight the main changes in the codebase. Be precise, this description should not be very long. - - List any changes in the enviroment variables (look at the `./docs/ENVS.md` file) in a separate section, describe purpose of each variable change + - List any changes in the environment variables (look at the `./docs/ENVS.md` file) in a separate section, describe purpose of each variable change - Bad example: "Added `NEXT_PUBLIC_VIEWS_TX_GROUPED_FEES` environment variable to the documentation" - Good example: "Added `NEXT_PUBLIC_VIEWS_TX_GROUPED_FEES` to group transaction fees into one section on the transaction page" - Good example: "Extended possible values for `NEXT_PUBLIC_VIEWS_TX_ADDITIONAL_FIELDS` with set_max_gas_limit to display the maximum gas price set by the transaction sender" diff --git a/.cursor/rules/typescript.mdc b/.cursor/rules/typescript.mdc index a59850ac0a..632369e7e6 100644 --- a/.cursor/rules/typescript.mdc +++ b/.cursor/rules/typescript.mdc @@ -183,7 +183,7 @@ type FetchingState = Do not introduce new enums into the codebase. Retain existing enums. -If you require enum-like behaviour, use an `as const` object: +If you require enum-like behavior, use an `as const` object: ```ts const backendToFrontendEnum = { @@ -267,7 +267,7 @@ interface C extends A, B { Use JSDoc comments to annotate functions and types. -Be concise in JSDoc comments, and only provide JSDoc comments if the function's behaviour is not self-evident. +Be concise in JSDoc comments, and only provide JSDoc comments if the function's behavior is not self-evident. Use the JSDoc inline `@link` tag to link to other functions and types within the same file. diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f28aad995b..71023aef84 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -62,6 +62,9 @@ jobs: - name: Check licenses run: yarn lint:license:check + - name: Check spelling + run: yarn lint:cspell --no-progress + toolkit_build_check: name: Toolkit build check needs: [ code_quality ] diff --git a/.github/workflows/project-management.yml b/.github/workflows/project-management.yml index 278261e067..042242be13 100644 --- a/.github/workflows/project-management.yml +++ b/.github/workflows/project-management.yml @@ -26,7 +26,7 @@ jobs: with: project_name: ${{ vars.PROJECT_NAME }} field_name: Status - field_value: Ready For Realease + field_value: Ready For Release issues: "[${{ github.event.issue.number }}]" secrets: inherit permissions: diff --git a/.husky/pre-commit b/.husky/pre-commit index 51b33fd9a1..8b98b7a4c4 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,6 +5,9 @@ echo 🧿 Running file linter... npx lint-staged +echo 🧿 Running spelling checker... +git diff --diff-filter=ACMRT --cached --name-only | npx cspell --config cspell.jsonc --file-list stdin + # format svg echo 🧿 Running svg formatter... for file in `git diff --diff-filter=ACMRT --cached --name-only | grep ".svg\$"` diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1e06422ff3..9a0638f95f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -30,7 +30,7 @@ "command": "yarn dev:preset:sync --name=${input:dev_config_preset}", "problemMatcher": [], "label": "dev preset sync", - "detail": "syncronize dev preset", + "detail": "synchronize dev preset", "presentation": { "reveal": "always", "panel": "shared", diff --git a/cspell.jsonc b/cspell.jsonc new file mode 100644 index 0000000000..026a36dbd1 --- /dev/null +++ b/cspell.jsonc @@ -0,0 +1,285 @@ +{ + // Version of the setting file. Always 0.2 + "version": "0.2", + // language - current active spelling language + "language": "en", + "useGitignore": true, + "ignorePaths": [ + "**/*.svg", + "**/*.sfd", + ".git", + "mocks/zetaChain/zetaChainCCTX.ts", + "mocks/metadata/address.ts", + "playwright/mocks/file_mock_with_very_long_name.json", + "playwright/fixtures/rewards.ts", + "public/static/capybara/index.js", + "ui/showcases/utils.ts", + "ui/tx/TxExternalTxs.pw.tsx" + ], + "enableGlobDot": true, + "ignoreRandomStrings": true, + "allowCompoundWords": true, + "ignoreRegExpList": [ + // Ignore filecoin f410f-like native addresses + "f410f[a-z2-7]{39}", + // Specify publisher key + "spk_\\w+", + // Posthog project key + "phc_\\w+" + ], + // words - list of words to be always considered correct + "words": [ + "aatx", + "abfnrtv", + "abitype", + "abkw", + "ACMRT", + "adbutler", + "addrs", + "adsbyslise", + "aeiou", + "Ahrefs", + "airtable", + "Alexa", + "alfajores", + "andb", + "anyblock", + "anytrust", + "apng", + "apos", + "appkit", + "Applebot", + "Arianee", + "ARTIS", + "astar", + "asymp", + "autoscout", + "Baiduspider", + "barooumba", + "basehead", + "bech", + "bedag", + "bingbot", + "bitquery", + "blackfort", + "blockie", + "blockies", + "blockscout", + "buildx", + "callvalue", + "campnetwork", + "CCIP", + "cctx", + "cctxs", + "celenium", + "celestia", + "CERC", + "cfasync", + "chainid", + "chainscout", + "chakra", + "clstr", + "coinzilla", + "coinzillatag", + "Computor", + "contentscript", + "contractname", + "convictional", + "Couldn", + "crios", + "dappscout", + "dbaeumer", + "deepdao", + "defi", + "devnet", + "didn", + "doesn", + "dotenv", + "DRPC", + "DTEND", + "duckduckgo", + "eamodio", + "Eigenda", + "Emelyanov", + "Enkrypt", + "explorable", + "facebookexternalhit", + "favicons", + "fedoseev", + "filecoin", + "flashblock", + "flashblocks", + "foos", + "fxios", + "geas", + "giga", + "gitpoap", + "Googlebot", + "goriunov", + "gotmpl", + "grecaptcha", + "growthbook", + "gstatic", + "hairsp", + "healthz", + "helia", + "hyfi", + "identicons", + "IERC", + "Ihnatsyeu", + "Inde", + "inpage", + "internaltx", + "ipfs", + "isstuev", + "iszero", + "jazzicon", + "jfif", + "jumpdest", + "jumpi", + "keccak", + "Kiryl", + "labelable", + "laquo", + "libc", + "libp", + "Liquality", + "llms", + "lokijs", + "LUKSO", + "mainnets", + "megaeth", + "merkle", + "metasuites", + "mgas", + "mload", + "mmss", + "msize", + "mulmod", + "multiarch", + "multicall", + "multichain", + "multisend", + "nbdash", + "NCAABB", + "ndash", + "negb", + "nextjs", + "noopener", + "noreferrer", + "noves", + "nums", + "okex", + "okhttp", + "opblock", + "opengraph", + "paych", + "peekers", + "pino", + "pjpeg", + "posthog", + "PWDEBUG", + "pwstory", + "pyftsubset", + "qrcode", + "rabby", + "raleway", + "randao", + "raquo", + "rari", + "Rarible", + "RBTC", + "rdns", + "rdparty", + "regcred", + "remasc", + "reown", + "resizer", + "rgba", + "RIPEMD", + "rlespinasse", + "rogerbot", + "rollbar", + "ROLLUP", + "rollups", + "rubic", + "Sastana", + "schnorr", + "screencasts", + "scure", + "sdiv", + "SEMRESATTRS", + "Semrush", + "servedbyadbutler", + "Shavuha", + "Shavukha", + "shibarium", + "shibariumscan", + "SHVKH", + "sidechain", + "Signatur", + "simonsiefke", + "siwe", + "slise", + "sload", + "smartmuv", + "smod", + "smol", + "sokol", + "solidityscan", + "Sourcify", + "Succ", + "superchain", + "tabler", + "TBXN", + "testnetv", + "thinsp", + "Tokenary", + "tokenpocket", + "tokentxns", + "tonumber", + "trustwallet", + "Twitterbot", + "txns", + "typegen", + "uidotdev", + "unfinalized", + "UNKN", + "unparse", + "unstaked", + "usehooks", + "utia", + "utka", + "utko", + "UUPS", + "vbaranov", + "VCALENDAR", + "vercel", + "verifreg", + "VEVENT", + "viem", + "vitalik", + "vitest", + "wagmi", + "warpcast", + "watchlist", + "webacy", + "Winky", + "WOWG", + "WPOA", + "xdai", + "XDEFI", + "xname", + "xstar", + "yatki", + "zerion", + "zerossl", + "zetachain", + "zetavaloper", + "zilliqa", + "zkevm", + "zksolc", + "zksync", + "zora" + ] +} diff --git a/deploy/tools/affected-tests/package.json b/deploy/tools/affected-tests/package.json index bfba5734fa..7d4da6762b 100644 --- a/deploy/tools/affected-tests/package.json +++ b/deploy/tools/affected-tests/package.json @@ -2,7 +2,6 @@ "name": "affected-tests", "version": "1.0.0", "main": "index.js", - "author": "Vasilii (tom) Goriunov ", "license": "MIT", "dependencies": { "dependency-tree": "10.0.9" diff --git a/docs/ENVS.md b/docs/ENVS.md index 43c4a8dd83..7fb5fe6121 100644 --- a/docs/ENVS.md +++ b/docs/ENVS.md @@ -112,7 +112,7 @@ Also, be aware that if you customize the name of the currency or any of its deno | NEXT_PUBLIC_NETWORK_RPC_URL | `string \| Array` | Chain public RPC server url, see [https://chainlist.org](https://chainlist.org) for the reference. Can contain a single string value, or an array of urls. | - | - | `https://core.poa.network` | v1.0.x+ | | NEXT_PUBLIC_NETWORK_CURRENCY_NAME | `string` | Network currency name | - | - | `Ether` | v1.0.x+ | | NEXT_PUBLIC_NETWORK_CURRENCY_WEI_NAME | `string` | Name of the smallest unit of the native currency (e.g., 'wei' for Ethereum, where 1 ETH = 10^18 wei). Used for displaying gas prices and transaction fees in the smallest denomination. | - | `wei` | `duck` | v1.23.0+ | -| NEXT_PUBLIC_NETWORK_CURRENCY_GWEI_NAME | `string` | Name of the giga-unit of the native currency (e.g., 'gwei' for Ethereum, where 1 gwei = 10^9 of the smallest unit). Used for displaying gas prices in a more readable format throughout the UI. | - | `gwei` | `gduck` | v2.5.0+ | +| NEXT_PUBLIC_NETWORK_CURRENCY_GWEI_NAME | `string` | Name of the giga-unit of the native currency (e.g., 'gwei' for Ethereum, where 1 gwei = 10^9 of the smallest unit). Used for displaying gas prices in a more readable format throughout the UI. | - | `gwei` | `gDuck` | v2.5.0+ | | NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL | `string` | Network currency symbol | - | - | `ETH` | v1.0.x+ | | NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS | `string` | Network currency decimals | - | `18` | `6` | v1.0.x+ | | NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL | `string` | Network secondary coin symbol. | - | - | `GNO` | v1.29.0+ | @@ -537,7 +537,7 @@ Ads are enabled by default on all self-hosted instances. If you would like to di | NEXT_PUBLIC_ROLLUP_HOMEPAGE_SHOW_LATEST_BLOCKS | `boolean` | Set to `true` to display "Latest blocks" widget instead of "Latest batches" on the home page | - | - | `true` | v1.36.0+ | | NEXT_PUBLIC_ROLLUP_OUTPUT_ROOTS_ENABLED | `boolean` | Enables "Output roots" page (Optimistic stack only) | - | `false` | `true` | v1.37.0+ | | NEXT_PUBLIC_ROLLUP_PARENT_CHAIN | `ParentChain`, see details [below](#parent-chain-configuration-properties) | Configuration parameters for the parent chain. | - | - | `{'baseUrl':'https://explorer.duckchain.io'}` | v1.38.0+ | -| NEXT_PUBLIC_ROLLUP_DA_CELESTIA_NAMESPACE | `string` | Hex-string for creating a link to the transaction batch on the Seleneium explorer. "0x"-format and 60 symbol length. Available only for Arbitrum roll-ups. | - | - | `0x00000000000000000000000000000000000000ca1de12a9905be97beaf` | v1.38.0+ | +| NEXT_PUBLIC_ROLLUP_DA_CELESTIA_NAMESPACE | `string` | Hex-string for creating a link to the transaction batch on the [Celenium explorer](https://celenium.io). "0x"-format and 60 symbol length. Available only for Arbitrum roll-ups. | - | - | `0x00000000000000000000000000000000000000ca1de12a9905be97beaf` | v1.38.0+ | | NEXT_PUBLIC_ROLLUP_DA_CELESTIA_CELENIUM_URL | `string` | URL for the Selenium explorer. It is used to create links to the Data Availability Blobs page. The URL should contain the full path without any search parameters related to the blob, as these will be constructed at runtime for each blob separately. Available only for Optimistic or Arbitrum roll-ups. | - | - | `https://mocha.celenium.io/blob` | v2.0.2+ | #### Parent chain configuration properties diff --git a/eslint.config.mjs b/eslint.config.mjs index af61f1e7d5..826f49b7a1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,7 +7,6 @@ import consistentDefaultExportNamePlugin from 'eslint-plugin-consistent-default- import importPlugin from 'eslint-plugin-import'; import importHelpersPlugin from 'eslint-plugin-import-helpers'; import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; -import noCyrillicStringPlugin from 'eslint-plugin-no-cyrillic-string'; import playwrightPlugin from 'eslint-plugin-playwright'; import reactPlugin from 'eslint-plugin-react'; import reactHooksPlugin from 'eslint-plugin-react-hooks'; @@ -325,15 +324,6 @@ export default tseslint.config( }, }, - { - plugins: { - 'no-cyrillic-string': noCyrillicStringPlugin, - }, - rules: { - 'no-cyrillic-string/no-cyrillic-string': 'error', - }, - }, - { plugins: { 'jsx-a11y': jsxA11yPlugin, diff --git a/lib/mixpanel/useInit.tsx b/lib/mixpanel/useInit.tsx index da2f849b48..03ecd7b6dd 100644 --- a/lib/mixpanel/useInit.tsx +++ b/lib/mixpanel/useInit.tsx @@ -15,7 +15,7 @@ import * as userProfile from './userProfile'; const opSuperchainFeature = config.features.opSuperchain; export default function useMixpanelInit() { - const [ isInited, setIsInited ] = React.useState(false); + const [ isInitialized, setIsInitialized ] = React.useState(false); const router = useRouter(); const debugFlagQuery = React.useRef(getQueryParamString(router.query._mixpanel_debug)); @@ -57,11 +57,11 @@ export default function useMixpanelInit() { 'First Time Join': dayjs().toISOString(), }); - setIsInited(true); + setIsInitialized(true); if (debugFlagQuery.current && !debugFlagCookie) { cookies.set(cookies.NAMES.MIXPANEL_DEBUG, 'true'); } }, [ ]); - return isInited; + return isInitialized; } diff --git a/lib/mixpanel/useLogPageView.tsx b/lib/mixpanel/useLogPageView.tsx index e8c09854de..fc142e837e 100644 --- a/lib/mixpanel/useLogPageView.tsx +++ b/lib/mixpanel/useLogPageView.tsx @@ -15,7 +15,7 @@ import getTabName from './getTabName'; import logEvent from './logEvent'; import { EventTypes } from './utils'; -export default function useLogPageView(isInited: boolean) { +export default function useLogPageView(isInitialized: boolean) { const router = useRouter(); const pathname = usePathname(); @@ -25,7 +25,7 @@ export default function useLogPageView(isInited: boolean) { const { colorMode } = useColorMode(); React.useEffect(() => { - if (!config.features.mixpanel.isEnabled || !isInited) { + if (!config.features.mixpanel.isEnabled || !isInitialized) { return; } @@ -44,5 +44,5 @@ export default function useLogPageView(isInited: boolean) { // but we still want to log page view // so we use pathname from 'next/navigation' instead of router.pathname from 'next/router' as deps // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ isInited, page, pathname, tab, colorMode ]); + }, [ isInitialized, page, pathname, tab, colorMode ]); } diff --git a/nextjs/PageNextJs.tsx b/nextjs/PageNextJs.tsx index 6eebc0ab2f..40e4bee47d 100644 --- a/nextjs/PageNextJs.tsx +++ b/nextjs/PageNextJs.tsx @@ -24,8 +24,8 @@ const PageNextJs = (props: Props) useAdblockDetect(); useNotifyOnNavigation(); - const isMixpanelInited = mixpanel.useInit(); - mixpanel.useLogPageView(isMixpanelInited); + const isMixPanelInitialized = mixpanel.useInit(); + mixpanel.useLogPageView(isMixPanelInitialized); return ( <> diff --git a/package.json b/package.json index bb35bf190a..04925fd8ac 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "lint:eslint": "eslint .", "lint:eslint:fix": "eslint . --fix", "lint:tsc": "tsc -p ./tsconfig.json", + "lint:cspell": "cspell .", "lint:license:check": "license-report > ./license.json && license-report-check --source=./license.json --output=table --forbidden=n/a", "lint:envs-validator:test": "cd ./deploy/tools/envs-validator && ./test.sh", "prepare": "husky install", @@ -86,6 +87,7 @@ "blo": "^1.1.1", "brotli-compress": "1.3.3", "crypto-js": "^4.2.0", + "cspell": "9.6.4", "d3": "^7.6.1", "dappscout-iframe": "0.4.0", "dayjs": "^1.11.5", @@ -167,7 +169,6 @@ "eslint-plugin-import": "2.31.0", "eslint-plugin-import-helpers": "2.0.1", "eslint-plugin-jsx-a11y": "6.10.2", - "eslint-plugin-no-cyrillic-string": "^1.0.5", "eslint-plugin-playwright": "2.0.1", "eslint-plugin-react": "7.37.5", "eslint-plugin-react-hooks": "5.0.0", diff --git a/public/static/capibara/capybaraSprite.png b/public/static/capybara/capybaraSprite.png similarity index 100% rename from public/static/capibara/capybaraSprite.png rename to public/static/capybara/capybaraSprite.png diff --git a/public/static/capibara/capybaraSpriteX2.png b/public/static/capybara/capybaraSpriteX2.png similarity index 100% rename from public/static/capibara/capybaraSpriteX2.png rename to public/static/capybara/capybaraSpriteX2.png diff --git a/public/static/capibara/index.js b/public/static/capybara/index.js similarity index 100% rename from public/static/capibara/index.js rename to public/static/capybara/index.js diff --git a/stubs/optimismSuperchain.ts b/stubs/optimismSuperchain.ts index a307c12e3d..5dad34a924 100644 --- a/stubs/optimismSuperchain.ts +++ b/stubs/optimismSuperchain.ts @@ -68,6 +68,6 @@ export const HOMEPAGE_STATS: stats.MainPageMultichainStats = { value: '1026175', title: 'Yesterday txns', units: undefined, - description: 'Number of transactions yesterday (0:00 - 23:59 UTC) across all chains in the cluste', + description: 'Number of transactions yesterday (0:00 - 23:59 UTC) across all chains in the cluster', }, }; diff --git a/ui/address/utils/useFetchTokens.ts b/ui/address/utils/useFetchTokens.ts index a8af284832..050a65d310 100644 --- a/ui/address/utils/useFetchTokens.ts +++ b/ui/address/utils/useFetchTokens.ts @@ -110,7 +110,7 @@ export default function useFetchTokens({ hash, enabled }: Props) { const handleTokenBalancesErc20Message: SocketMessage.AddressTokenBalancesErc20['handler'] = React.useCallback((payload) => { updateTokensData('ERC-20', payload); - // udpate ERC-20 & additional token types query, that is used on the address tokens list + // update ERC-20 & additional token types query, that is used on the address tokens list updateTokensData([ 'ERC-20', ...additionalTokenTypesIds ], payload); }, [ updateTokensData, additionalTokenTypesIds ]); diff --git a/ui/apiDocs/GraphQL.tsx b/ui/apiDocs/GraphQL.tsx index 86602eff50..ea079410d0 100644 --- a/ui/apiDocs/GraphQL.tsx +++ b/ui/apiDocs/GraphQL.tsx @@ -32,7 +32,7 @@ const GraphQL = () => { const graphqlTheme = window.localStorage.getItem('graphiql:theme'); - // colorModeState used as a key to re-render GraphiQL conponent after color mode change + // colorModeState used as a key to re-render GraphiQL component after color mode change const [ colorModeState, setColorModeState ] = React.useState(graphqlTheme); React.useEffect(() => { diff --git a/ui/games/CapybaraRunner.tsx b/ui/games/CapybaraRunner.tsx index 7963de585e..49c4fca05d 100644 --- a/ui/games/CapybaraRunner.tsx +++ b/ui/games/CapybaraRunner.tsx @@ -39,13 +39,13 @@ const CapybaraRunner = () => { <> Score 1000 to win a special prize! { isMobile ? 'Tap below to start' : 'Press space to start' } -