From 39bbaf02a89dd0828887bbab919ecbe2761ccab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20S=C3=A4=C3=A4vuori?= Date: Thu, 24 Oct 2024 20:39:57 +0300 Subject: [PATCH] fix: fix eslint config --- .eslintrc-auto-import.json | 100 ----------------------------------- eslint.config.js | 11 ++-- package.json | 2 +- tests/e2e/scrollbars.spec.ts | 12 ++--- vite.config.ts | 3 -- 5 files changed, 9 insertions(+), 119 deletions(-) delete mode 100644 .eslintrc-auto-import.json diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json deleted file mode 100644 index 451ced4..0000000 --- a/.eslintrc-auto-import.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "globals": { - "Component": true, - "ComponentPublicInstance": true, - "ComputedRef": true, - "EffectScope": true, - "InjectionKey": true, - "PropType": true, - "Ref": true, - "VNode": true, - "acceptHMRUpdate": true, - "computed": true, - "createApp": true, - "createPinia": true, - "customRef": true, - "defineAsyncComponent": true, - "defineComponent": true, - "defineStore": true, - "effectScope": true, - "getActivePinia": true, - "getCurrentInstance": true, - "getCurrentScope": true, - "h": true, - "inject": true, - "isProxy": true, - "isReactive": true, - "isReadonly": true, - "isRef": true, - "mapActions": true, - "mapGetters": true, - "mapState": true, - "mapStores": true, - "mapWritableState": true, - "markRaw": true, - "nextTick": true, - "onActivated": true, - "onBeforeMount": true, - "onBeforeRouteLeave": true, - "onBeforeRouteUpdate": true, - "onBeforeUnmount": true, - "onBeforeUpdate": true, - "onDeactivated": true, - "onErrorCaptured": true, - "onMounted": true, - "onRenderTracked": true, - "onRenderTriggered": true, - "onScopeDispose": true, - "onServerPrefetch": true, - "onUnmounted": true, - "onUpdated": true, - "provide": true, - "reactive": true, - "readonly": true, - "ref": true, - "resolveComponent": true, - "setActivePinia": true, - "setMapStoreSuffix": true, - "shallowReactive": true, - "shallowReadonly": true, - "shallowRef": true, - "storeToRefs": true, - "toRaw": true, - "toRef": true, - "toRefs": true, - "triggerRef": true, - "unref": true, - "useAttrs": true, - "useCssModule": true, - "useCssVars": true, - "useHead": true, - "useLink": true, - "useRoute": true, - "useRouter": true, - "useSlots": true, - "useStore": true, - "watch": true, - "watchEffect": true, - "watchPostEffect": true, - "watchSyncEffect": true, - "toValue": true, - "useSeoMeta": true, - "ExtractDefaultPropTypes": true, - "ExtractPropTypes": true, - "ExtractPublicPropTypes": true, - "WritableComputedRef": true, - "getActiveHead": true, - "injectHead": true, - "useHeadSafe": true, - "useServerHead": true, - "useServerHeadSafe": true, - "useServerSeoMeta": true, - "DirectiveBinding": true, - "MaybeRef": true, - "MaybeRefOrGetter": true, - "onWatcherCleanup": true, - "useId": true, - "useModel": true, - "useTemplateRef": true - } -} diff --git a/eslint.config.js b/eslint.config.js index f8c1f30..b109ada 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,7 +4,7 @@ import vueTsEslintConfig from '@vue/eslint-config-typescript' import pluginPlaywright from 'eslint-plugin-playwright' import security from 'eslint-plugin-security' import pluginVue from 'eslint-plugin-vue' -import autoImportGlobals from './.eslintrc-auto-import.json' assert { type: 'json' } +// import autoImportGlobals from './.eslintrc-auto-import.json' with { type: 'json' } export default [ { @@ -14,7 +14,7 @@ export default [ { name: 'app/files-to-ignore', - ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/test-results/**'], + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/test-results/**', '*.config.*'], }, { @@ -27,12 +27,7 @@ export default [ 'id-length': [2, { exceptions: ['i', 'j', '_'] }], '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '_' }], }, - }, - - { - languageOptions: { - globals: autoImportGlobals.globals, - }, + // languageOptions: autoImportGlobals, }, ...pluginVue.configs['flat/recommended'], diff --git a/package.json b/package.json index b4092fe..47a62fd 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test-e2e": "playwright test --headed", "test:ci": "vitest run --coverage", "test:ci-e2e": "playwright test", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "lint": "eslint . --fix", "type-check": "vue-tsc --build --force" }, "dependencies": { diff --git a/tests/e2e/scrollbars.spec.ts b/tests/e2e/scrollbars.spec.ts index bdc2d9e..9db28c3 100644 --- a/tests/e2e/scrollbars.spec.ts +++ b/tests/e2e/scrollbars.spec.ts @@ -3,12 +3,10 @@ import { expect, test } from '@playwright/test' test('homepage should not have scrollbars', async ({ page }) => { await page.goto('/') - const html = await page.$('html') - if (html) { - const scrollWidth = Number(await html.getAttribute('scrollWidth')) - const clientWidth = Number(await html.getAttribute('clientWidth')) - const scrollBarWidth = scrollWidth - clientWidth + const html = page.locator('html') + const scrollWidth = Number(await html.getAttribute('scrollWidth')) + const clientWidth = Number(await html.getAttribute('clientWidth')) + const scrollBarWidth = scrollWidth - clientWidth - expect(scrollBarWidth).toBe(0) - } + expect(scrollBarWidth).toBe(0) }) diff --git a/vite.config.ts b/vite.config.ts index 1faaba5..c2833a5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,9 +26,6 @@ export default defineConfig({ ], dts: 'auto-imports.d.ts', vueTemplate: true, - eslintrc: { - enabled: true, - }, }), Components({ dts: 'components.d.ts',