From 1dc14b58207505ca1680a5b17f51408b677821e9 Mon Sep 17 00:00:00 2001 From: MarcelBitfly Date: Tue, 6 Aug 2024 15:19:29 +0200 Subject: [PATCH 1/4] chore(vscode): add recommendations for `workspace frontend` Add recommendations for - extensions - rulers - conventional commits `scopes` See: BIDS-128 --- frontend/.gitignore | 3 +++ frontend/.vscode/extensions.json | 10 ++++++++++ frontend/.vscode/settings.json | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100644 frontend/.vscode/extensions.json create mode 100644 frontend/.vscode/settings.json diff --git a/frontend/.gitignore b/frontend/.gitignore index de93b161e..1e90cbeff 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,3 +1,6 @@ +# Dev Environment +!.vscode/ + # Nuxt dev/build outputs .output .data diff --git a/frontend/.vscode/extensions.json b/frontend/.vscode/extensions.json new file mode 100644 index 000000000..fcb6deda8 --- /dev/null +++ b/frontend/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "vivaxy.vscode-conventional-commits", + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "usernamehw.errorlens", + "nuxtr.nuxt-vscode-extentions", + "vue.volar" + ] +} \ No newline at end of file diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json new file mode 100644 index 000000000..3a1595671 --- /dev/null +++ b/frontend/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "conventionalCommits.scopes": [ + "i18n", + "vscode" + ], + "editor.rulers": [ + 80, + 120 +], + +} \ No newline at end of file From 905ed98efdac4b4d2bb6560913c2936ed551165c Mon Sep 17 00:00:00 2001 From: MarcelBitfly Date: Tue, 6 Aug 2024 16:46:01 +0200 Subject: [PATCH 2/4] chore(eslint): refactor configuration to align with `documentation` See: https://eslint.nuxt.com/packages/module#config-customizations See: BIDS-128 --- frontend/.vscode/settings.json | 3 ++- frontend/eslint.config.mjs | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json index 3a1595671..620085a67 100644 --- a/frontend/.vscode/settings.json +++ b/frontend/.vscode/settings.json @@ -1,7 +1,8 @@ { "conventionalCommits.scopes": [ "i18n", - "vscode" + "vscode", + "eslint" ], "editor.rulers": [ 80, diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 3de60bb04..7123547dc 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -1,16 +1,17 @@ // @ts-check import withNuxt from './.nuxt/eslint.config.mjs' -export default withNuxt( +export default withNuxt() +.prepend( { ignores: [ "types/api", "public", ], - }, - { - rules: { - "@typescript-eslint/no-explicit-any": "off", // should be removed eventually - }, - }, + } ) +.override('nuxt/typescript/rules', { + rules: { + '@typescript-eslint/no-explicit-any': 'off', // TODO: remove this rule + } +}) From fea1e8f0ad600f0049c86b197219fe51a99183c0 Mon Sep 17 00:00:00 2001 From: MarcelBitfly Date: Wed, 7 Aug 2024 12:44:21 +0200 Subject: [PATCH 3/4] style(eslint): apply `stylistic` rules See: https://eslint.style/rules See: BIDS-128 --- frontend/app.vue | 6 +- frontend/app/router.options.ts | 4 +- frontend/components/bc/BcBlurOverlay.vue | 1 + frontend/components/bc/BcButton.vue | 22 +- frontend/components/bc/BcContentFilter.vue | 16 +- .../components/bc/BcCurrencySelection.vue | 11 +- frontend/components/bc/BcDialog.vue | 6 +- frontend/components/bc/BcDropdown.vue | 18 +- frontend/components/bc/BcFaq.vue | 36 +- frontend/components/bc/BcIconToggle.vue | 22 +- frontend/components/bc/BcLink.vue | 1 + .../components/bc/BcMaintenanceBanner.vue | 13 +- frontend/components/bc/BcToggle.vue | 22 +- frontend/components/bc/BcTooltip.vue | 53 +- frontend/components/bc/BcTranslation.vue | 23 +- frontend/components/bc/CookieModal.vue | 11 +- frontend/components/bc/CopyLabel.vue | 19 +- frontend/components/bc/CopyToClipboard.vue | 24 +- frontend/components/bc/FeatureCheck.vue | 14 +- frontend/components/bc/FractionBar.vue | 12 +- frontend/components/bc/InputNumber.vue | 9 +- frontend/components/bc/LoadingSpinner.vue | 16 +- frontend/components/bc/NetworkSelector.vue | 24 +- frontend/components/bc/PageWrapper.vue | 7 +- frontend/components/bc/SearchbarGeneral.vue | 11 +- frontend/components/bc/ad/AdComponent.vue | 18 +- frontend/components/bc/ad/AdControl.vue | 14 +- .../components/bc/dialog/BcDialogConfirm.vue | 31 +- frontend/components/bc/footer/LinkList.vue | 38 +- frontend/components/bc/form/BcForm.vue | 4 +- frontend/components/bc/form/BcFormRow.vue | 8 +- .../components/bc/format/FormatGraffiti.vue | 16 +- frontend/components/bc/format/FormatHash.vue | 79 ++- .../components/bc/format/FormatNumber.vue | 18 +- .../components/bc/format/FormatPercent.vue | 38 +- .../components/bc/format/FormatTimePassed.vue | 16 +- frontend/components/bc/format/FormatValue.vue | 30 +- frontend/components/bc/header/HeaderLogo.vue | 9 +- frontend/components/bc/header/MainHeader.vue | 100 +++- frontend/components/bc/header/MegaMenu.vue | 483 ++++++++++-------- .../components/bc/input/BcInputCheckbox.vue | 75 ++- frontend/components/bc/input/BcInputError.vue | 18 +- frontend/components/bc/input/BcInputLabel.vue | 45 +- frontend/components/bc/input/BcInputText.vue | 42 +- frontend/components/bc/menu/BcMenuBar.vue | 44 +- .../components/bc/premium/BcPremiumGem.vue | 13 +- .../components/bc/premium/BcPremiumModal.vue | 14 +- .../bc/searchbar/CategorySelectors.vue | 14 +- .../components/bc/searchbar/FilterButton.vue | 23 +- .../bc/searchbar/MiddleEllipsis.vue | 238 +++++---- .../bc/searchbar/NetworkSelector.vue | 64 ++- .../bc/searchbar/SearchbarButton.vue | 17 +- .../components/bc/searchbar/SearchbarMain.vue | 280 ++++++---- .../components/bc/searchbar/SuggestionRow.vue | 121 +++-- .../components/bc/searchbar/TypeIcons.vue | 1 - frontend/components/bc/tab/TabHeader.vue | 8 +- frontend/components/bc/table/AgeHeader.vue | 6 +- frontend/components/bc/table/BcTable.vue | 72 ++- .../components/bc/table/BcTableControl.vue | 52 +- .../components/bc/table/BcTablePopoutEdit.vue | 30 +- frontend/components/bc/table/BcTableTag.vue | 20 +- .../components/bc/table/BcTableValidTag.vue | 12 +- frontend/components/bc/table/TablePager.vue | 74 ++- frontend/components/bc/toggle/MultiBar.vue | 27 +- .../components/bc/toggle/MultiBarButton.vue | 33 +- frontend/components/bc/toggle/SingleBar.vue | 39 +- .../components/bc/toggle/SingleBarButton.vue | 50 +- .../block/table/BlockTableRewardItem.vue | 35 +- .../block/table/BlockTableStatus.vue | 13 +- .../dashboard/DashboardControls.vue | 75 +-- .../components/dashboard/DashboardHeader.vue | 24 +- .../dashboard/DashboardRenameModal.vue | 18 +- .../dashboard/DashboardShareCodeModal.vue | 46 +- .../dashboard/DashboardShareModal.vue | 33 +- .../dashboard/GroupManagementModal.vue | 64 ++- frontend/components/dashboard/OverviewBox.vue | 44 +- .../dashboard/SharedDashboardModal.vue | 10 +- .../dashboard/ValidatorEpochDutiesModal.vue | 46 +- .../dashboard/ValidatorManagementModal.vue | 117 +++-- .../dashboard/ValidatorOverview.vue | 25 +- .../components/dashboard/ValidatorSlotViz.vue | 10 +- .../DashboardChartSummaryChartFilter.vue | 46 +- .../dashboard/chart/RewardsChart.vue | 69 +-- .../dashboard/chart/RewardsChartTooltip.vue | 49 +- .../dashboard/chart/SummaryChart.vue | 129 +++-- .../dashboard/chart/SummaryChartTooltip.vue | 32 +- .../dashboard/chart/TooltipHeader.vue | 10 +- .../creation/DashboardCreationController.vue | 32 +- .../creation/DashboardCreationNetworkMask.vue | 15 +- .../creation/DashboardCreationTypeMask.vue | 31 +- .../components/dashboard/group/GroupLabel.vue | 5 +- .../dashboard/group/GroupSelection.vue | 12 +- .../dashboard/group/GroupSelectionDialog.vue | 10 +- .../table/DashboardTableAddValidator.vue | 7 +- .../dashboard/table/DashboardTableBlocks.vue | 113 +++- .../table/DashboardTableClDeposits.vue | 36 +- .../table/DashboardTableEfficiency.vue | 34 +- .../table/DashboardTableElDeposits.vue | 83 ++- .../dashboard/table/DashboardTableRewards.vue | 34 +- .../table/DashboardTableRewardsDetails.vue | 111 ++-- .../dashboard/table/DashboardTableSummary.vue | 18 +- .../table/DashboardTableValidators.vue | 33 +- .../table/DashboardTableValueDuty.vue | 55 +- .../table/DashboardTableWithdrawals.vue | 75 ++- .../dashboard/table/SummaryDetails.vue | 30 +- .../dashboard/table/SummaryMissedRewards.vue | 40 +- .../dashboard/table/SummaryReward.vue | 29 +- .../dashboard/table/SummaryStatus.vue | 20 +- .../dashboard/table/SummaryValidators.vue | 38 +- .../table/SummaryValidatorsIconRow.vue | 22 +- .../dashboard/table/SummaryValue.vue | 178 ++++--- .../validator/subset/ValidatorSubsetList.vue | 61 ++- .../subset/ValidatorSubsetListHeader.vue | 21 +- .../validator/subset/ValidatorSubsetModal.vue | 70 ++- .../subset/ValidatorSubsetSubHeader.vue | 26 +- frontend/components/icon/BeaconchainLogo.vue | 13 +- frontend/components/icon/ColorToggleMoon.vue | 6 +- frontend/components/icon/ColorToggleSun.vue | 6 +- frontend/components/icon/ErrorFace.vue | 14 +- frontend/components/icon/IconAccount.vue | 13 +- frontend/components/icon/IconChevron.vue | 4 +- frontend/components/icon/IconCrypto.vue | 16 +- frontend/components/icon/IconCurrency.vue | 18 +- frontend/components/icon/IconFiat.vue | 1 + frontend/components/icon/IconNetwork.vue | 33 +- frontend/components/icon/IconPlus.vue | 20 +- frontend/components/icon/IconRocketpool.vue | 18 +- frontend/components/icon/IconValidator.vue | 13 +- frontend/components/icon/RocketPool.vue | 18 +- .../components/icon/datatype/AccountIcon.vue | 11 +- .../components/icon/datatype/BatchIcon.vue | 11 +- .../components/icon/datatype/BlockIcon.vue | 11 +- .../components/icon/datatype/ContractIcon.vue | 17 +- .../components/icon/datatype/EpochIcon.vue | 11 +- .../components/icon/datatype/GraffitiIcon.vue | 11 +- frontend/components/icon/datatype/NftIcon.vue | 47 +- .../components/icon/datatype/TokenIcon.vue | 11 +- .../icon/datatype/TransactionIcon.vue | 11 +- .../icon/datatype/ValidatorIcon.vue | 11 +- .../components/icon/megaMenu/EthStore.vue | 43 +- .../icon/megaMenu/EthermineStaking.vue | 28 +- .../components/icon/megaMenu/EverSteel.vue | 8 +- frontend/components/icon/megaMenu/WebHook.vue | 8 +- .../icon/network/NetworkArbitrum.vue | 38 +- .../components/icon/network/NetworkBase.vue | 11 +- .../icon/network/NetworkEthereum.vue | 36 +- .../components/icon/network/NetworkGnosis.vue | 32 +- .../icon/network/NetworkOptimism.vue | 23 +- .../components/icon/slot/SlotAttestation.vue | 13 +- .../icon/slot/SlotBlockProposal.vue | 13 +- .../icon/slot/SlotHeadAttestation.vue | 28 +- .../components/icon/slot/SlotSlashing.vue | 13 +- .../icon/slot/SlotSourceAttestation.vue | 28 +- frontend/components/icon/slot/SlotSync.vue | 13 +- .../icon/slot/SlotTargetAttestation.vue | 28 +- .../notifications/DashboardsTable.vue | 27 +- .../notifications/DashboardsTableEmpty.vue | 19 +- .../DashboardsTableItemDashboard.vue | 6 +- .../NotificationsManagementDashboards.vue | 85 +-- .../NotificationsManagementGeneralTab.vue | 44 +- .../NotificationsManagementModal.vue | 74 ++- ...ionsManagementPairedDeviceModalContent.vue | 8 +- ...ificationsManagementPairedDevicesModal.vue | 12 +- .../management/SubscriptionDialog.vue | 84 +-- .../management/SubscriptionRow.vue | 81 ++- .../NotificationsManagementModalWebhook.vue | 157 +++--- .../DashboardValidatorManageValidators.vue | 47 +- .../playground/MiddleEllipsisTests.vue | 117 ++++- .../components/playground/PlaygroundAds.vue | 25 +- .../playground/PlaygroundComposable.vue | 2 - .../playground/PlaygroundConversion.vue | 166 ++++-- .../playground/PlaygroundDialog.vue | 16 +- .../playground/PlaygroundDutyStatus.vue | 45 +- .../playground/PlaygroundEncryption.vue | 2 - .../playground/PlaygroundHashes.vue | 113 +++- .../components/playground/PlaygroundIcons.vue | 65 ++- .../components/playground/PlaygroundInput.vue | 24 +- .../playground/PlaygroundStyling.vue | 117 ++++- .../playground/PlaygroundSubsetList.vue | 12 +- .../components/playground/PlaygroundTable.vue | 35 +- .../components/playground/PlaygroundTags.vue | 73 ++- frontend/components/pricing/PeriodToggle.vue | 7 +- .../components/pricing/PremiumAddonBox.vue | 80 ++- .../components/pricing/PremiumCompare.vue | 66 ++- .../components/pricing/PremiumFeature.vue | 32 +- .../components/pricing/PremiumProductBox.vue | 87 ++-- .../components/pricing/PremiumProducts.vue | 5 +- .../pricing/PremiumViaAppBanner.vue | 5 +- frontend/components/pricing/TypeToggle.vue | 5 +- .../rocketpool/RocketpoolToggle.vue | 33 +- frontend/components/slot/viz/SlotVizIcon.vue | 2 +- frontend/components/slot/viz/SlotVizTile.vue | 66 ++- .../components/slot/viz/SlotVizTooltip.vue | 129 +++-- .../components/slot/viz/SlotVizViewer.vue | 54 +- .../settings/UserSettingsDeleteAccount.vue | 13 +- .../user/settings/UserSettingsEmail.vue | 27 +- .../user/settings/UserSettingsPassword.vue | 27 +- .../settings/UserSettingsSubscriptions.vue | 9 +- .../table/ValidatorTableDutyRewards.vue | 23 +- .../table/ValidatorTableDutyStatus.vue | 71 ++- .../validator/table/ValidatorTableStatus.vue | 23 +- .../useNotificationsManagementDashboards.ts | 4 +- .../useNotificationsManagementSettings.ts | 2 +- ...NotificationsManagementSettingsProvider.ts | 11 +- frontend/composables/useBcDialog.ts | 11 +- frontend/composables/useBcSeo.ts | 7 +- frontend/composables/useBcToast.ts | 2 +- frontend/composables/useBcToastProvider.ts | 9 +- frontend/composables/useCurrency.ts | 10 +- frontend/composables/useCurrentAds.ts | 2 +- frontend/composables/useCustomFetch.ts | 14 +- frontend/composables/useDashboardKey.ts | 2 +- .../composables/useDashboardKeyProvider.ts | 12 +- frontend/composables/useDate.ts | 2 +- frontend/composables/useDateProvider.ts | 4 +- frontend/composables/useDebounceValue.ts | 2 +- frontend/composables/useFormat.ts | 10 +- frontend/composables/useGlobalSetting.ts | 2 +- frontend/composables/useHashTabs.ts | 2 +- frontend/composables/useInterval.ts | 2 +- frontend/composables/useRefBridge.ts | 30 +- frontend/composables/useStripe.ts | 2 +- frontend/composables/useStripeProvider.ts | 9 +- frontend/composables/useSwipe.ts | 19 +- frontend/composables/useTableQuery.ts | 2 +- frontend/composables/useTranslation.ts | 8 +- .../useValidatorDashboardGroups.ts | 4 +- frontend/composables/useValue.ts | 16 +- frontend/composables/useWindowSize.ts | 2 +- frontend/composables/useWindowSizeProvider.ts | 2 +- frontend/eslint.config.mjs | 30 +- frontend/globals.d.ts | 2 +- frontend/i18n.config.ts | 4 +- frontend/middleware/redirect.global.ts | 14 +- frontend/nuxt.config.ts | 53 +- frontend/package.json | 3 +- frontend/pages/[...slug].vue | 1 + .../pages/account-dashboard/[[id]]/index.vue | 11 +- frontend/pages/dashboard/[[id]]/index.vue | 72 ++- frontend/pages/login.vue | 37 +- frontend/pages/notifications.vue | 57 ++- frontend/pages/playground.vue | 13 +- frontend/pages/pricing.vue | 15 +- frontend/pages/register.vue | 52 +- frontend/plugins/bcLogger.ts | 8 +- frontend/plugins/fontawesome.js | 4 +- .../stores/dashboard/useUserDashboardStore.ts | 53 +- .../useValidatorDashboardBlocksStore.ts | 4 +- .../useValidatorDashboardClDepositsStore.ts | 28 +- .../useValidatorDashboardElDepositsStore.ts | 28 +- .../useValidatorDashboardOverviewStore.ts | 9 +- ...seValidatorDashboardRewardsDetailsStore.ts | 6 +- .../useValidatorDashboardRewardsStore.ts | 4 +- ...seValidatorDashboardSummaryDetailsStore.ts | 6 +- .../useValidatorDashboardSummaryStore.ts | 4 +- .../useValidatorDashboardWithdrawalsStore.ts | 6 +- .../dashboard/useValidatorSlotVizStore.ts | 13 +- .../useNotificationsDashboardStore.ts | 6 +- frontend/stores/useAdConfigurationStore.ts | 6 +- frontend/stores/useCsrfStore.ts | 4 +- frontend/stores/useLatestStateStore.ts | 7 +- frontend/stores/useNetworkStore.ts | 37 +- frontend/stores/useProductsStore.ts | 4 +- frontend/stores/useTooltipStore.ts | 4 +- frontend/stores/useUserStore.ts | 13 +- frontend/types/adConfiguration.ts | 16 +- frontend/types/cookie.ts | 14 +- frontend/types/customFetch.ts | 116 ++--- frontend/types/dashboard/index.ts | 24 +- frontend/types/dashboard/overview.ts | 10 +- frontend/types/dashboard/rewards.ts | 20 +- frontend/types/dashboard/summary.ts | 18 +- frontend/types/datatable.ts | 10 +- frontend/types/date.ts | 4 +- frontend/types/hashTabs.ts | 2 +- frontend/types/helper.ts | 18 +- frontend/types/links.ts | 2 +- frontend/types/menuBar.ts | 22 +- frontend/types/multiBar.ts | 12 +- frontend/types/network.ts | 80 +-- frontend/types/notifications/dashboards.ts | 18 +- frontend/types/notifications/settings.ts | 12 +- .../types/notifications/subscriptionModal.ts | 2 +- frontend/types/pricing.ts | 10 +- frontend/types/searchbar.ts | 197 +++---- frontend/types/settings.ts | 18 +- frontend/types/stripe.ts | 8 +- frontend/types/swipe.ts | 8 +- frontend/types/toast.ts | 12 +- frontend/types/user.ts | 4 +- frontend/types/validator/index.ts | 4 +- frontend/types/window.ts | 4 +- frontend/utils/bigMath.ts | 4 +- frontend/utils/colors.ts | 21 +- frontend/utils/currency.ts | 6 +- frontend/utils/dashboard/group.ts | 5 +- frontend/utils/dashboard/key.ts | 4 +- frontend/utils/dashboard/table.ts | 2 +- frontend/utils/dashboard/validator.ts | 13 +- frontend/utils/encryption.ts | 9 +- frontend/utils/ether.ts | 6 +- frontend/utils/fetch.ts | 2 +- frontend/utils/format.ts | 66 +-- frontend/utils/html.ts | 8 +- frontend/utils/misc.ts | 9 +- frontend/utils/mobileAuth.ts | 10 +- frontend/utils/mock.ts | 146 +++--- frontend/utils/table.ts | 10 +- frontend/utils/translation.ts | 13 +- frontend/utils/userValidation.ts | 14 +- frontend/utils/validation.ts | 8 +- 311 files changed, 6451 insertions(+), 3189 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index eb357f936..0d41bc123 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -8,9 +8,9 @@ useHead({ { key: 'revive', src: '../js/revive.min.js', - async: false - } - ] + async: false, + }, + ], }, { mode: 'client' }) useWindowSizeProvider() useBcToastProvider() diff --git a/frontend/app/router.options.ts b/frontend/app/router.options.ts index 24702e39d..51caf3ee7 100644 --- a/frontend/app/router.options.ts +++ b/frontend/app/router.options.ts @@ -1,5 +1,5 @@ export default { - scrollBehavior (_to: any, _from: any, savedPosition: { left: number, top: number } | null) { + scrollBehavior(_to: any, _from: any, savedPosition: { left: number, top: number } | null) { return { _to, ...savedPosition } - } + }, } diff --git a/frontend/components/bc/BcBlurOverlay.vue b/frontend/components/bc/BcBlurOverlay.vue index 936d56bfb..4357549a3 100644 --- a/frontend/components/bc/BcBlurOverlay.vue +++ b/frontend/components/bc/BcBlurOverlay.vue @@ -1,6 +1,7 @@ + \ No newline at end of file + diff --git a/frontend/components/bc/BcContentFilter.vue b/frontend/components/bc/BcContentFilter.vue index a7c98e950..7012f3713 100644 --- a/frontend/components/bc/BcContentFilter.vue +++ b/frontend/components/bc/BcContentFilter.vue @@ -1,23 +1,25 @@