From df9a6e968e582bd572266956dbdeead449df57d2 Mon Sep 17 00:00:00 2001 From: Jeremy Wharton Date: Thu, 13 Jul 2023 18:45:59 -0500 Subject: [PATCH] web/satellite: lint Vuetify files This change enables linting for the Vuetify proof of concept code and fixes the linting errors that were detected. Additionally, it migrates the Vuetify components to the composition API. Change-Id: Id8cc083954e3f4cb66a00ad2715a96c8747b592c --- web/satellite/.eslintignore | 2 + web/satellite/.eslintrc.js | 3 +- web/satellite/package.json | 4 +- web/satellite/vite.config-vuetify.js | 90 ++- .../src/components/AccessTableComponent.vue | 183 +++-- .../BrowserBreadcrumbsComponent.vue | 18 +- .../src/components/BrowserNewFolderDialog.vue | 152 +++-- .../components/BrowserSnackbarComponent.vue | 292 ++++---- .../src/components/BrowserTableComponent.vue | 442 ++++++------ .../src/components/BucketsDataTable.vue | 80 +-- .../src/components/CardStatsComponent.vue | 24 +- .../src/components/PageSubtitleComponent.vue | 13 +- .../src/components/PageTitleComponent.vue | 12 +- .../src/components/ProjectsTableComponent.vue | 163 +++-- .../src/components/TeamTableComponent.vue | 10 +- .../src/components/UsageProgressComponent.vue | 51 +- .../src/components/icons/IconAccess.vue | 21 +- .../src/components/icons/IconAllProjects.vue | 26 +- .../src/components/icons/IconBrowse.vue | 20 +- .../src/components/icons/IconBucket.vue | 20 +- .../src/components/icons/IconDashboard.vue | 19 +- .../src/components/icons/IconDocs.vue | 20 +- .../src/components/icons/IconFolder.vue | 19 +- .../src/components/icons/IconForum.vue | 19 +- .../src/components/icons/IconNew.vue | 20 +- .../src/components/icons/IconPassphrase.vue | 20 +- .../src/components/icons/IconProject.vue | 19 +- .../src/components/icons/IconResources.vue | 19 +- .../src/components/icons/IconSettings.vue | 19 +- .../src/components/icons/IconSupport.vue | 20 +- .../src/components/icons/IconTeam.vue | 20 +- .../src/components/icons/IconUpload.vue | 19 +- .../src/layouts/default/Account.vue | 20 +- .../src/layouts/default/AccountNav.vue | 158 ++--- .../src/layouts/default/AllProjects.vue | 16 +- .../src/layouts/default/AppBar.vue | 338 +++++----- .../src/layouts/default/Default.vue | 7 +- .../src/layouts/default/ProjectNav.vue | 478 +++++++------ .../vuetify-poc/src/layouts/default/View.vue | 11 +- web/satellite/vuetify-poc/src/main.ts | 15 +- .../vuetify-poc/src/plugins/index.ts | 18 +- .../vuetify-poc/src/plugins/vuetify.ts | 174 +++-- .../vuetify-poc/src/plugins/webfontloader.ts | 12 +- web/satellite/vuetify-poc/src/router/index.ts | 138 ++-- .../vuetify-poc/src/views/Access.vue | 476 ++++++------- .../vuetify-poc/src/views/AccountSettings.vue | 222 +++--- .../vuetify-poc/src/views/Billing.vue | 565 ++++++++-------- .../vuetify-poc/src/views/Bucket.vue | 89 +-- .../vuetify-poc/src/views/Buckets.vue | 312 +++++---- .../vuetify-poc/src/views/Dashboard.vue | 17 +- .../vuetify-poc/src/views/DesignLibrary.vue | 542 ++++++++------- .../vuetify-poc/src/views/Projects.vue | 632 +++++++++--------- web/satellite/vuetify-poc/src/views/Team.vue | 64 +- 53 files changed, 2958 insertions(+), 3205 deletions(-) diff --git a/web/satellite/.eslintignore b/web/satellite/.eslintignore index f594f9373eb5..de8a574b416a 100644 --- a/web/satellite/.eslintignore +++ b/web/satellite/.eslintignore @@ -2,3 +2,5 @@ dist dist_vuetify_poc node_modules coverage +tests/unit/ignore +static/wasm diff --git a/web/satellite/.eslintrc.js b/web/satellite/.eslintrc.js index ea2f6f2bbc99..504c96c88f98 100644 --- a/web/satellite/.eslintrc.js +++ b/web/satellite/.eslintrc.js @@ -44,7 +44,7 @@ module.exports = { }, { 'group': 'internal', - 'pattern': '@/components/**', + 'pattern': '@?(poc)/components/**', 'position': 'after', }, { @@ -80,6 +80,7 @@ module.exports = { 'vue/no-unused-refs': ['warn'], 'vue/no-unused-vars': ['warn'], 'vue/no-useless-v-bind': ['warn'], + 'vue/valid-v-slot': ['error', { 'allowModifiers': true }], 'vue/no-useless-template-attributes': ['off'], // TODO: fix later 'vue/no-multiple-template-root': ['off'], // it's possible to have multiple roots in template in Vue 3 diff --git a/web/satellite/package.json b/web/satellite/package.json index d7093f6a3b63..eb2cb818d659 100644 --- a/web/satellite/package.json +++ b/web/satellite/package.json @@ -9,8 +9,8 @@ "build-watch": "NODE_ENV=development vite build -c vite.config.js --watch", "build-vuetify": "vite build -c vite.config-vuetify.js", "build-vuetify-watch": "NODE_ENV=development vite build -c vite.config-vuetify.js --watch", - "lint": "eslint --ext .js,.ts,.vue src --fix && stylelint . --max-warnings 0 --fix", - "lint-ci": "eslint --ext .js,.ts,.vue src --no-fix && stylelint . --max-warnings 0 --no-fix", + "lint": "eslint **/*.{js,ts,vue} --fix && stylelint . --max-warnings 0 --fix", + "lint-ci": "eslint **/*.{js,ts,vue} --no-fix && stylelint . --max-warnings 0 --no-fix", "wasm": "chmod +x ./scripts/build-wasm.sh && ./scripts/build-wasm.sh", "wasm-dev": "chmod +x ./scripts/build-wasm-dev.sh && ./scripts/build-wasm-dev.sh", "test": "vitest run" diff --git a/web/satellite/vite.config-vuetify.js b/web/satellite/vite.config-vuetify.js index d0f6ffcd80e2..bf01f4cad8fb 100644 --- a/web/satellite/vite.config-vuetify.js +++ b/web/satellite/vite.config-vuetify.js @@ -1,55 +1,53 @@ // Copyright (C) 2023 Storj Labs, Inc. // See LICENSE for copying information. -// Plugins -import vue from '@vitejs/plugin-vue' -import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' +import { fileURLToPath, URL } from 'node:url'; -// Utilities -import { defineConfig } from 'vite' -import { fileURLToPath, URL } from 'node:url' +import vue from '@vitejs/plugin-vue'; +import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'; +import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ - base: '/static/dist_vuetify_poc', - plugins: [ - vue({ - template: { transformAssetUrls } - }), - // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin - vuetify({ - autoImport: true, - styles: { - configFile: 'vuetify-poc/src/styles/settings.scss', - }, - }), - ], - define: { 'process.env': {} }, - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), - '@poc': fileURLToPath(new URL('./vuetify-poc/src', import.meta.url)), - }, - extensions: [ - '.js', - '.json', - '.jsx', - '.mjs', - '.ts', - '.tsx', - '.vue', + base: '/static/dist_vuetify_poc', + plugins: [ + vue({ + template: { transformAssetUrls }, + }), + // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin + vuetify({ + autoImport: true, + styles: { + configFile: 'vuetify-poc/src/styles/settings.scss', + }, + }), ], - }, - build: { - outDir: fileURLToPath(new URL('dist_vuetify_poc', import.meta.url)), - emptyOutDir: true, - rollupOptions: { - input: { - 'vuetify-poc': fileURLToPath(new URL('./index-vuetify.html', import.meta.url)), - }, + define: { 'process.env': {} }, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + '@poc': fileURLToPath(new URL('./vuetify-poc/src', import.meta.url)), + }, + extensions: [ + '.js', + '.json', + '.jsx', + '.mjs', + '.ts', + '.tsx', + '.vue', + ], + }, + build: { + outDir: fileURLToPath(new URL('dist_vuetify_poc', import.meta.url)), + emptyOutDir: true, + rollupOptions: { + input: { + 'vuetify-poc': fileURLToPath(new URL('./index-vuetify.html', import.meta.url)), + }, + }, + }, + server: { + port: 3000, }, - }, - server: { - port: 3000, - } -}) +}); diff --git a/web/satellite/vuetify-poc/src/components/AccessTableComponent.vue b/web/satellite/vuetify-poc/src/components/AccessTableComponent.vue index 4d98f9e4cae7..4fa89e63e1fb 100644 --- a/web/satellite/vuetify-poc/src/components/AccessTableComponent.vue +++ b/web/satellite/vuetify-poc/src/components/AccessTableComponent.vue @@ -2,105 +2,94 @@ // See LICENSE for copying information. - \ No newline at end of file +]; + diff --git a/web/satellite/vuetify-poc/src/components/BrowserBreadcrumbsComponent.vue b/web/satellite/vuetify-poc/src/components/BrowserBreadcrumbsComponent.vue index aedd3a26cafd..3ae7af16345c 100644 --- a/web/satellite/vuetify-poc/src/components/BrowserBreadcrumbsComponent.vue +++ b/web/satellite/vuetify-poc/src/components/BrowserBreadcrumbsComponent.vue @@ -2,15 +2,13 @@ // See LICENSE for copying information. - \ No newline at end of file + diff --git a/web/satellite/vuetify-poc/src/components/BrowserNewFolderDialog.vue b/web/satellite/vuetify-poc/src/components/BrowserNewFolderDialog.vue index 082f3b4df4c0..74f49ec9f2da 100644 --- a/web/satellite/vuetify-poc/src/components/BrowserNewFolderDialog.vue +++ b/web/satellite/vuetify-poc/src/components/BrowserNewFolderDialog.vue @@ -2,84 +2,88 @@ // See LICENSE for copying information. - \ No newline at end of file + diff --git a/web/satellite/vuetify-poc/src/components/BrowserSnackbarComponent.vue b/web/satellite/vuetify-poc/src/components/BrowserSnackbarComponent.vue index 4628c1c43c34..bf05b2faed48 100644 --- a/web/satellite/vuetify-poc/src/components/BrowserSnackbarComponent.vue +++ b/web/satellite/vuetify-poc/src/components/BrowserSnackbarComponent.vue @@ -2,153 +2,151 @@ // See LICENSE for copying information. - \ No newline at end of file diff --git a/web/satellite/vuetify-poc/src/components/BrowserTableComponent.vue b/web/satellite/vuetify-poc/src/components/BrowserTableComponent.vue index b5d4e52531d8..a7e5bfd15ef7 100644 --- a/web/satellite/vuetify-poc/src/components/BrowserTableComponent.vue +++ b/web/satellite/vuetify-poc/src/components/BrowserTableComponent.vue @@ -2,298 +2,290 @@ // See LICENSE for copying information. - + \ No newline at end of file diff --git a/web/satellite/vuetify-poc/src/views/Bucket.vue b/web/satellite/vuetify-poc/src/views/Bucket.vue index 0f9e70930307..268fed1f85c1 100644 --- a/web/satellite/vuetify-poc/src/views/Bucket.vue +++ b/web/satellite/vuetify-poc/src/views/Bucket.vue @@ -2,44 +2,43 @@ // See LICENSE for copying information. - diff --git a/web/satellite/vuetify-poc/src/views/Buckets.vue b/web/satellite/vuetify-poc/src/views/Buckets.vue index 6928fb289abb..9be9276c9773 100644 --- a/web/satellite/vuetify-poc/src/views/Buckets.vue +++ b/web/satellite/vuetify-poc/src/views/Buckets.vue @@ -2,174 +2,162 @@ // See LICENSE for copying information. - diff --git a/web/satellite/vuetify-poc/src/views/Dashboard.vue b/web/satellite/vuetify-poc/src/views/Dashboard.vue index ccee8ac66c6d..22cefd98916f 100644 --- a/web/satellite/vuetify-poc/src/views/Dashboard.vue +++ b/web/satellite/vuetify-poc/src/views/Dashboard.vue @@ -3,9 +3,8 @@ diff --git a/web/satellite/vuetify-poc/src/views/Projects.vue b/web/satellite/vuetify-poc/src/views/Projects.vue index 9a8de20d9805..3fc7d4fb4724 100644 --- a/web/satellite/vuetify-poc/src/views/Projects.vue +++ b/web/satellite/vuetify-poc/src/views/Projects.vue @@ -2,94 +2,90 @@ // See LICENSE for copying information.