From 44161ab33c515679a2db4a5cc1ae9351af3d02ed Mon Sep 17 00:00:00 2001 From: vben Date: Sat, 21 Sep 2024 13:42:29 +0800 Subject: [PATCH] fix: improve global type detection of vue files --- .../eslint-config/src/configs/javascript.ts | 2 +- .../eslint-config/src/configs/vue.ts | 16 ++++++++++++++++ .../effects/common-ui/src/ui/about/about.vue | 1 - 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/internal/lint-configs/eslint-config/src/configs/javascript.ts b/internal/lint-configs/eslint-config/src/configs/javascript.ts index cae21b81969..0d87c1ba13a 100644 --- a/internal/lint-configs/eslint-config/src/configs/javascript.ts +++ b/internal/lint-configs/eslint-config/src/configs/javascript.ts @@ -147,7 +147,7 @@ export async function javascript(): Promise { 'no-template-curly-in-string': 'error', 'no-this-before-super': 'error', 'no-throw-literal': 'error', - 'no-undef': 'error', + 'no-undef': 'off', 'no-undef-init': 'error', 'no-unexpected-multiline': 'error', 'no-unmodified-loop-condition': 'error', diff --git a/internal/lint-configs/eslint-config/src/configs/vue.ts b/internal/lint-configs/eslint-config/src/configs/vue.ts index 8c45e8ad0c8..27cc3cf29c1 100644 --- a/internal/lint-configs/eslint-config/src/configs/vue.ts +++ b/internal/lint-configs/eslint-config/src/configs/vue.ts @@ -15,6 +15,22 @@ export async function vue(): Promise { { files: ['**/*.vue'], languageOptions: { + // globals: { + // computed: 'readonly', + // defineEmits: 'readonly', + // defineExpose: 'readonly', + // defineProps: 'readonly', + // onMounted: 'readonly', + // onUnmounted: 'readonly', + // reactive: 'readonly', + // ref: 'readonly', + // shallowReactive: 'readonly', + // shallowRef: 'readonly', + // toRef: 'readonly', + // toRefs: 'readonly', + // watch: 'readonly', + // watchEffect: 'readonly', + // }, parser: parserVue, parserOptions: { ecmaFeatures: { diff --git a/packages/effects/common-ui/src/ui/about/about.vue b/packages/effects/common-ui/src/ui/about/about.vue index b2ad06672c3..41189c17310 100644 --- a/packages/effects/common-ui/src/ui/about/about.vue +++ b/packages/effects/common-ui/src/ui/about/about.vue @@ -52,7 +52,6 @@ const { license, version, // vite inject-metadata 插件注入的全局变量 - // eslint-disable-next-line no-undef } = __VBEN_ADMIN_METADATA__ || {}; const vbenDescriptionItems: DescriptionItem[] = [