From b15db646b6cc0b994d36d515ba25a7211284ecff Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sun, 27 Jul 2025 18:34:56 +0200 Subject: [PATCH] frontend: switch to flat eslint config We still need eslint/compat for the .gitignore file. https://eslint.org/docs/latest/use/configure/ignore#including-gitignore-files The tests now need an ecmaVersion 2022. --- frontend/eslint.config.mjs | 20 +++++++------------- frontend/package-lock.json | 1 - frontend/package.json | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index c051026e8d..f02782a5f6 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -2,27 +2,21 @@ import vueEslintConfigPrettier from '@vue/eslint-config-prettier' import { includeIgnoreFile } from '@eslint/compat' import localRules from 'eslint-plugin-local-rules' +import vueEslint from 'eslint-plugin-vue' +import vueScopedCssEslint from 'eslint-plugin-vue-scoped-css' import globals from 'globals' import path from 'node:path' import { fileURLToPath } from 'node:url' import js from '@eslint/js' -import { FlatCompat } from '@eslint/eslintrc' const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all, -}) const gitignorePath = path.resolve(__dirname, '.gitignore') export default [ - ...compat.extends( - 'plugin:vue/recommended', - 'plugin:vue/vue3-recommended', - 'plugin:vue-scoped-css/vue3-recommended', - 'eslint:recommended' - ), + ...vueEslint.configs['flat/vue2-recommended'], + ...vueEslint.configs['flat/recommended'], + ...vueScopedCssEslint.configs['flat/recommended'], + js.configs.recommended, { ignores: ['data/', 'dist/', 'public/twemoji/'], }, @@ -42,7 +36,7 @@ export default [ }, parserOptions: { - ecmaVersion: '6', + ecmaVersion: 2022, parser: '@babel/eslint-parser', }, }, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f5073d906e..755353832c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -73,7 +73,6 @@ "devDependencies": { "@babel/eslint-parser": "7.28.0", "@eslint/compat": "1.3.1", - "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.32.0", "@sentry/vite-plugin": "3.6.1", "@testing-library/jest-dom": "6.6.4", diff --git a/frontend/package.json b/frontend/package.json index 589cbe6cd8..6653f88cd9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -86,7 +86,6 @@ "devDependencies": { "@babel/eslint-parser": "7.28.0", "@eslint/compat": "1.3.1", - "@eslint/eslintrc": "3.3.1", "@eslint/js": "9.32.0", "@sentry/vite-plugin": "3.6.1", "@testing-library/jest-dom": "6.6.4",