From 8d0d611e97af335280f3c42b9be39149bdec4792 Mon Sep 17 00:00:00 2001 From: Marvin Gutstein Date: Tue, 6 Oct 2026 10:02:34 +0200 Subject: [PATCH] feat(vue-vite): upgrade to eslint@10 and flat config --- vue-vite/base/.eslintignore | 27 --------------------------- vue-vite/base/.eslintrc.cjs | 20 -------------------- vue-vite/base/eslint.config.js | 26 ++++++++++++++++++++++++++ vue-vite/base/package.json | 8 +++++--- 4 files changed, 31 insertions(+), 50 deletions(-) delete mode 100644 vue-vite/base/.eslintignore delete mode 100644 vue-vite/base/.eslintrc.cjs create mode 100644 vue-vite/base/eslint.config.js diff --git a/vue-vite/base/.eslintignore b/vue-vite/base/.eslintignore deleted file mode 100644 index 7462f77ad..000000000 --- a/vue-vite/base/.eslintignore +++ /dev/null @@ -1,27 +0,0 @@ -.DS_Store -node_modules -/coverage -/dist -/ios -/android - - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - diff --git a/vue-vite/base/.eslintrc.cjs b/vue-vite/base/.eslintrc.cjs deleted file mode 100644 index 8f715012c..000000000 --- a/vue-vite/base/.eslintrc.cjs +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - root: true, - env: { - node: true - }, - 'extends': [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/typescript/recommended' - ], - parserOptions: { - ecmaVersion: 2020 - }, - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'vue/no-deprecated-slot-attribute': 'off', - '@typescript-eslint/no-explicit-any': 'off', - } -} diff --git a/vue-vite/base/eslint.config.js b/vue-vite/base/eslint.config.js new file mode 100644 index 000000000..03921d897 --- /dev/null +++ b/vue-vite/base/eslint.config.js @@ -0,0 +1,26 @@ +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'; +import pluginVue from 'eslint-plugin-vue'; +import pluginJs from '@eslint/js'; +import { globalIgnores } from 'eslint/config'; +import globals from 'globals'; + +export default defineConfigWithVueTs( + pluginVue.configs['flat/essential'], + pluginJs.configs.recommended, + vueTsConfigs.recommended, + { + languageOptions: { + globals: globals.node, + + ecmaVersion: 2020, + }, + + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'vue/no-deprecated-slot-attribute': 'off', + '@typescript-eslint/no-explicit-any': 'off', + }, + }, + globalIgnores(['coverage', 'dist', 'ios', 'android']) +); diff --git a/vue-vite/base/package.json b/vue-vite/base/package.json index 0667304de..a5bc95345 100644 --- a/vue-vite/base/package.json +++ b/vue-vite/base/package.json @@ -19,13 +19,15 @@ "vue-router": "^5.0.0" }, "devDependencies": { + "@eslint/js": "^10.0.1", "@vitejs/plugin-legacy": "^8.0.0", "@vitejs/plugin-vue": "^6.0.0", - "@vue/eslint-config-typescript": "^12.0.0", + "@vue/eslint-config-typescript": "^14.9.0", "@vue/test-utils": "^2.3.0", "cypress": "^13.5.0", - "eslint": "^8.35.0", - "eslint-plugin-vue": "^9.9.0", + "eslint": "^10.12.0", + "eslint-plugin-vue": "^10.11.1", + "globals": "^17.13.0", "jsdom": "^22.1.0", "terser": "^5.16.0", "typescript": "~5.9.0",