From 75cb87a5774f369f67aa352cd3ae1b9f43fd80c3 Mon Sep 17 00:00:00 2001 From: Bryant Gillespie Date: Thu, 12 Sep 2024 10:56:59 -0400 Subject: [PATCH] Update Dependencies to latest versions (#168) * reorder css declarations per sass rules * fix operator * move to nuxt-icon with v1 release * explictly import utils to appease TS * explicitly type clients * more util imports * css changes * Update Google Tag Manager ID in .env.example * Refactor code-highlighter.post.ts to use createHighlighter instead of getHighlighter * update dependencies to latest versions * add back vue to package.json * bump typescript and eslint back * flat config test * lint ignore * fix ignore settings * lint fixes * fix hsform --------- Co-authored-by: Alexandre Chopin --- .env.example | 2 +- .eslintignore | 2 - .eslintrc.js | 93 - components/Base/FormGroup.vue | 2 +- components/Base/HsForm.vue | 1 + components/Base/Icon.vue | 6 +- components/Base/Input.vue | 2 - components/Block/Card.vue | 15 +- components/Block/CardGroupDynamic.vue | 2 +- components/Block/Media.vue | 2 +- components/Block/Metric.vue | 3 +- components/Block/Table.vue | 3 +- components/LogoTitle.vue | 1 + components/Nav/Footer.vue | 1 + components/Nav/Header.vue | 11 +- components/Tv/TVByline.vue | 2 + components/Tv/TVReactions.vue | 4 +- eslint.config.mjs | 186 + .../posthog/runtime/plugins/posthog.client.ts | 14 +- nuxt.config.ts | 34 +- package.json | 64 +- pages/agency-directory/[slug].vue | 17 +- pages/built-with-directus/[slug].vue | 18 +- pages/team/[slug].vue | 6 +- pages/tv/[show]/index.vue | 2 +- plugins/directus.ts | 32 +- pnpm-lock.yaml | 8036 ++++++++--------- server/api/code-highlighter.post.ts | 14 +- server/routes/rss.xml.ts | 2 +- utils/og.ts | 2 +- 30 files changed, 3948 insertions(+), 4631 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs diff --git a/.env.example b/.env.example index e3f27832..5374d74d 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ DIRECTUS_URL="https://your-instance.directus.app" DIRECTUS_TV_URL="https://your-instance.directus.app" -GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH" +NUXT_PUBLIC_SCRIPTS_GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH" NUXT_PUBLIC_SITE_URL=https://directus.io POSTHOG_API_KEY="phc_project_api_key" POSTHOG_API_HOST="https://us.i.posthog.com" diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f06235c4..00000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -dist diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e9cca972..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,93 +0,0 @@ -const defaultRules = { - // No console statements in production - 'no-console': process.env.NODE_ENV !== 'development' ? 'error' : 'off', - // No debugger statements in production - 'no-debugger': process.env.NODE_ENV !== 'development' ? 'error' : 'off', - // Enforce prettier formatting - 'prettier/prettier': 'error', - 'padding-line-between-statements': [ - 'error', - { - blankLine: 'always', - prev: [ - 'block', - 'block-like', - 'cjs-export', - 'class', - 'export', - 'import', - 'multiline-block-like', - 'multiline-const', - 'multiline-expression', - 'multiline-let', - 'multiline-var', - ], - next: '*', - }, - { - blankLine: 'always', - prev: ['const', 'let'], - next: ['block', 'block-like', 'cjs-export', 'class', 'export', 'import'], - }, - { - blankLine: 'always', - prev: '*', - next: ['multiline-block-like', 'multiline-const', 'multiline-expression', 'multiline-let', 'multiline-var'], - }, - { blankLine: 'any', prev: ['export', 'import'], next: ['export', 'import'] }, - ], - 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], - 'no-nested-ternary': 'error', - curly: ['error', 'multi-line'], -}; - -module.exports = { - // Stop looking for ESLint configurations in parent folders - root: true, - // Global variables: Browser and Node.js - env: { - browser: true, - node: true, - }, - // Basic configuration for js files - plugins: ['@typescript-eslint', 'prettier'], - extends: ['eslint:recommended', 'prettier'], - rules: defaultRules, - parserOptions: { - ecmaVersion: 2022, - sourceType: 'module', - }, - overrides: [ - // Configuration for ts/vue files - { - files: ['*.ts', '*.vue'], - parser: 'vue-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser', - }, - extends: [ - 'plugin:vue/vue3-recommended', - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - ], - rules: { - ...defaultRules, - 'vue/multi-word-component-names': 'off', - 'vue/require-default-prop': 'off', - // It's recommended to turn off this rule on TypeScript projects - 'no-undef': 'off', - // Allow ts-directive comments (used to suppress TypeScript compiler errors) - '@typescript-eslint/ban-ts-comment': 'off', - // Allow usage of the any type (consider to enable this rule later on) - '@typescript-eslint/no-explicit-any': 'off', - // Allow usage of require statements (consider to enable this rule later on) - '@typescript-eslint/no-var-requires': 'off', - // Allow non-null assertions for now (consider to enable this rule later on) - '@typescript-eslint/no-non-null-assertion': 'off', - // Allow unused arguments and variables when they begin with an underscore - '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], - }, - }, - ], -}; diff --git a/components/Base/FormGroup.vue b/components/Base/FormGroup.vue index e5c5f19a..00b90e9c 100644 --- a/components/Base/FormGroup.vue +++ b/components/Base/FormGroup.vue @@ -6,7 +6,7 @@ interface Props { hideLabel?: boolean; } -const props = withDefaults(defineProps(), { +withDefaults(defineProps(), { required: false, hideLabel: false, }); diff --git a/components/Base/HsForm.vue b/components/Base/HsForm.vue index eea6991e..68833383 100644 --- a/components/Base/HsForm.vue +++ b/components/Base/HsForm.vue @@ -18,6 +18,7 @@ const { formId } = toRefs(props); const { $directus, $readSingleton, $posthog } = useNuxtApp(); declare global { + // eslint-disable-next-line no-var var hbspt: any; } diff --git a/components/Base/Icon.vue b/components/Base/Icon.vue index 50342fc6..b18b7020 100644 --- a/components/Base/Icon.vue +++ b/components/Base/Icon.vue @@ -1,6 +1,4 @@ diff --git a/components/Base/Input.vue b/components/Base/Input.vue index d072d9d1..c8f0ac85 100644 --- a/components/Base/Input.vue +++ b/components/Base/Input.vue @@ -33,8 +33,6 @@ const inputClasses = computed(() => ({ 'has-prepend-icon': !!props.prependIcon, 'has-append-icon': !!props.appendIcon, })); - -const { theme } = useTheme();