From 65bc5a182674a7059a6d58b3c6b8fd05532443e8 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Fri, 11 Oct 2024 14:08:47 +0300 Subject: [PATCH] feat(eslint-plugin-experience): add i18n plugin (#649) * feat(eslint-plugin-experience): add i18n plugin * chore: apply changes after linting [bot] --------- Co-authored-by: taiga-family-bot --- package-lock.json | 11 +++++++++++ projects/eslint-plugin-experience/all.js | 18 ++++++++++++++++++ projects/eslint-plugin-experience/package.json | 1 + 3 files changed, 30 insertions(+) diff --git a/package-lock.json b/package-lock.json index 9581e430..1295198d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8383,6 +8383,16 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/eslint-plugin-i18n": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-i18n/-/eslint-plugin-i18n-2.3.1.tgz", + "integrity": "sha512-WSL41vOq5hz4t4CkX11yV2OQ+MHOXwPCcMIOPoaudGyKZkz8DLzGgnJ6OeStKl2GeJj0OXm5u8h41/IWUPWoUA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/eslint-plugin-import": { "version": "2.31.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", @@ -19483,6 +19493,7 @@ "eslint-plugin-decorator-position": "^5.0.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-file-progress": "^1.5.0", + "eslint-plugin-i18n": "2.3.1", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-node-import": "^1.0.4", diff --git a/projects/eslint-plugin-experience/all.js b/projects/eslint-plugin-experience/all.js index 19b94934..df73a946 100644 --- a/projects/eslint-plugin-experience/all.js +++ b/projects/eslint-plugin-experience/all.js @@ -128,6 +128,7 @@ module.exports = { '@stylistic/ts', '@stylistic/plus', '@angular-eslint/eslint-plugin', + 'i18n', ], extends: [ 'eslint-config-airbnb-base', @@ -616,6 +617,12 @@ module.exports = { }, ], 'guard-for-in': 'error', + 'i18n/no-chinese-character': 'error', + 'i18n/no-greek-character': 'error', + 'i18n/no-japanese-character': 'error', + 'i18n/no-korean-character': 'error', + 'i18n/no-russian-character': 'error', + 'i18n/no-thai-character': 'error', 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], 'import/first': 'error', 'import/newline-after-import': ['error', {count: 1}], @@ -911,6 +918,17 @@ module.exports = { 'no-implicit-globals': 'error', }, }, + { + files: ['**/i18n/**/*.*', '*.spec.ts', '*.cy.ts'], + rules: { + 'i18n/no-chinese-character': 'off', + 'i18n/no-greek-character': 'off', + 'i18n/no-japanese-character': 'off', + 'i18n/no-korean-character': 'off', + 'i18n/no-russian-character': 'off', + 'i18n/no-thai-character': 'off', + }, + }, { files: ['*.spec.ts'], parser: '@typescript-eslint/parser', diff --git a/projects/eslint-plugin-experience/package.json b/projects/eslint-plugin-experience/package.json index 886ef2a2..b57724df 100644 --- a/projects/eslint-plugin-experience/package.json +++ b/projects/eslint-plugin-experience/package.json @@ -31,6 +31,7 @@ "eslint-plugin-decorator-position": "^5.0.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-file-progress": "^1.5.0", + "eslint-plugin-i18n": "2.3.1", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-node-import": "^1.0.4",