From 0a1eaa3c40534b84a922f36f9cf09c9811f90e42 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 8 Aug 2025 11:41:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8(i18n)=20upgrade=20eslint=20to=20v9?= =?UTF-8?q?=20with=20i18n=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We upgraded ESLint to version 9 in the i18n package, which includes several improvements and fixes. This change also involves updating the ESLint configuration files to the new format and ensuring compatibility with the latest ESLint features. --- src/frontend/packages/i18n/.eslintrc.js | 11 ----------- src/frontend/packages/i18n/eslint.config.mjs | 20 ++++++++++++++++++++ src/frontend/packages/i18n/package.json | 2 +- src/frontend/packages/i18n/tsconfig.json | 2 ++ 4 files changed, 23 insertions(+), 12 deletions(-) delete mode 100644 src/frontend/packages/i18n/.eslintrc.js create mode 100644 src/frontend/packages/i18n/eslint.config.mjs diff --git a/src/frontend/packages/i18n/.eslintrc.js b/src/frontend/packages/i18n/.eslintrc.js deleted file mode 100644 index 475c786b..00000000 --- a/src/frontend/packages/i18n/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - root: true, - extends: ['impress/jest', 'plugin:import/recommended'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 'latest', - tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], - }, - ignorePatterns: ['node_modules'], -}; diff --git a/src/frontend/packages/i18n/eslint.config.mjs b/src/frontend/packages/i18n/eslint.config.mjs new file mode 100644 index 00000000..620d4857 --- /dev/null +++ b/src/frontend/packages/i18n/eslint.config.mjs @@ -0,0 +1,20 @@ +import { defineConfig } from '@eslint/config-helpers'; +import docsPlugin from 'eslint-plugin-docs'; + +const eslintConfig = defineConfig([ + { + files: ['**/*.ts', '**/*.mjs', '**/*.js'], + plugins: { + docs: docsPlugin, + }, + extends: ['docs/next', 'docs/test'], + languageOptions: { + parserOptions: { + tsconfigRootDir: import.meta.dirname, + project: ['./tsconfig.json'], + }, + }, + }, +]); + +export default eslintConfig; diff --git a/src/frontend/packages/i18n/package.json b/src/frontend/packages/i18n/package.json index 63f33c24..6333949c 100644 --- a/src/frontend/packages/i18n/package.json +++ b/src/frontend/packages/i18n/package.json @@ -8,7 +8,7 @@ "format-deploy": "yarn format-deploy:impress", "format-deploy:impress": "node ./format-deploy.mjs --app=impress --output=../../apps/impress/src/i18n/translations.json", "format-rebuild-fr:impress": "node ./rebuild-translations.mjs --language=fr --app=impress --output=../../apps/impress/src/i18n/translations.json", - "lint": "eslint --ext .js,.ts,.mjs .", + "lint": "eslint", "test": "jest" }, "dependencies": { diff --git a/src/frontend/packages/i18n/tsconfig.json b/src/frontend/packages/i18n/tsconfig.json index c4350f5a..2c5fee27 100644 --- a/src/frontend/packages/i18n/tsconfig.json +++ b/src/frontend/packages/i18n/tsconfig.json @@ -16,6 +16,8 @@ }, "include": [ "**/*.ts", + "**/*.js", + "**/*.mjs" ], "exclude": ["node_modules"] }