chore: introduce eslint-plugin-react-google-translate

This commit is contained in:
Stephen Zhou
2025-01-16 10:59:06 +08:00
parent 4ae7290de1
commit 596476d924
3 changed files with 41 additions and 20 deletions
+12 -1
View File
@@ -2,7 +2,8 @@
import path from "node:path"
import { fixupPluginRules } from "@eslint/compat"
import { defineConfig, GLOB_TS_SRC } from "eslint-config-hyoban"
import { defineConfig, GLOB_JSX_SRC, GLOB_TS_SRC } from "eslint-config-hyoban"
import googleTranslate from "eslint-plugin-react-google-translate"
import reactNative from "eslint-plugin-react-native"
import checkI18nJson from "./plugins/eslint/eslint-check-i18n-json.js"
@@ -124,4 +125,14 @@ export default defineConfig(
"react-native/no-inline-styles": "warn",
},
},
{
files: GLOB_JSX_SRC,
plugins: {
"react-google-translate": googleTranslate,
},
rules: {
"react-google-translate/no-conditional-text-nodes-with-siblings": "warn",
"react-google-translate/no-return-text-nodes": "warn",
},
},
)
+1
View File
@@ -88,6 +88,7 @@
"electron-vite": "^2.3.0",
"eslint": "^9.16.0",
"eslint-config-hyoban": "^3.1.15",
"eslint-plugin-react-google-translate": "^0.0.114",
"eslint-plugin-react-native": "^4.1.0",
"fake-indexeddb": "6.0.0",
"fast-glob": "^3.3.2",
+28 -19
View File
@@ -180,6 +180,9 @@ importers:
eslint-config-hyoban:
specifier: ^3.1.15
version: 3.1.15(@typescript-eslint/eslint-plugin@8.17.0(@typescript-eslint/parser@8.17.0(eslint@9.16.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.16.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.16.0(jiti@2.3.3))(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2)))(typescript@5.7.2)
eslint-plugin-react-google-translate:
specifier: ^0.0.114
version: 0.0.114(eslint@9.16.0(jiti@2.3.3))
eslint-plugin-react-native:
specifier: ^4.1.0
version: 4.1.0(eslint@9.16.0(jiti@2.3.3))
@@ -8457,6 +8460,12 @@ packages:
typescript:
optional: true
eslint-plugin-react-google-translate@0.0.114:
resolution: {integrity: sha512-ixV5l+ejPj3OdvlqSii4hnj42jAXy7EiMS65DvNQ40T5TkqD8RuSsYiIODTYDyoD3L3knLzF2LdTOQiqawMTGQ==}
engines: {node: ^14.17.0 || ^16.0.0 || >= 18.0.0}
peerDependencies:
eslint: '>=7'
eslint-plugin-react-hooks-extra@1.18.0:
resolution: {integrity: sha512-Pcv/+tF9nunEE4WNtXT0Iju+3uvnqGFi3ZfuTqvILyxO0QhrzkSGuESZsrwvS1F8Mf/b6vikREqHMl4Vc6JjgA==}
engines: {bun: '>=1.0.15', node: '>=18.18.0'}
@@ -13065,6 +13074,10 @@ packages:
resolution: {integrity: sha512-nYzyjnFcPNGR3lx9lwPPPnuQxv6JWEZd2Ci0u9opN7N5zUEPIhY/GbL3vMGOr2UXwEg9WwSyV9X9Y/kLFgPsOg==}
engines: {node: '>= 4.0.0'}
requireindex@1.2.0:
resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==}
engines: {node: '>=0.10.5'}
requires-port@1.0.0:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
@@ -13423,10 +13436,6 @@ packages:
resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==}
engines: {node: '>= 0.4'}
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
engines: {node: '>= 0.4'}
side-channel@1.1.0:
resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
engines: {node: '>= 0.4'}
@@ -17262,16 +17271,16 @@ snapshots:
'@0no-co/graphql.web': 1.0.12(graphql@16.8.1)
'@babel/runtime': 7.26.0
'@expo/code-signing-certificates': 0.0.5
'@expo/config': 10.0.6
'@expo/config-plugins': 9.0.12
'@expo/config': 10.0.8
'@expo/config-plugins': 9.0.14
'@expo/devcert': 1.1.4
'@expo/env': 0.4.0
'@expo/image-utils': 0.6.3
'@expo/json-file': 9.0.0
'@expo/json-file': 9.0.1
'@expo/metro-config': 0.19.8
'@expo/osascript': 2.1.4
'@expo/package-manager': 1.6.1
'@expo/plist': 0.2.0
'@expo/plist': 0.2.1
'@expo/prebuild-config': 8.0.23
'@expo/rudder-sdk-node': 1.1.1(encoding@0.1.13)
'@expo/spawn-async': 1.7.2
@@ -24156,6 +24165,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-plugin-react-google-translate@0.0.114(eslint@9.16.0(jiti@2.3.3)):
dependencies:
eslint: 9.16.0(jiti@2.3.3)
requireindex: 1.2.0
eslint-plugin-react-hooks-extra@1.18.0(eslint@9.16.0(jiti@2.3.3))(typescript@5.7.2):
dependencies:
'@eslint-react/ast': 1.18.0(eslint@9.16.0(jiti@2.3.3))(typescript@5.7.2)
@@ -24801,8 +24815,8 @@ snapshots:
dependencies:
'@babel/runtime': 7.26.0
'@expo/cli': 0.22.7(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)
'@expo/config': 10.0.6
'@expo/config-plugins': 9.0.12
'@expo/config': 10.0.8
'@expo/config-plugins': 9.0.14
'@expo/fingerprint': 0.11.6
'@expo/metro-config': 0.19.8
'@expo/vector-icons': 14.0.4
@@ -26058,7 +26072,7 @@ snapshots:
dependencies:
es-errors: 1.3.0
hasown: 2.0.2
side-channel: 1.0.6
side-channel: 1.1.0
interpret@1.4.0: {}
@@ -29712,6 +29726,8 @@ snapshots:
rc: 1.2.8
resolve: 1.7.1
requireindex@1.2.0: {}
requires-port@1.0.0:
optional: true
@@ -30153,13 +30169,6 @@ snapshots:
object-inspect: 1.13.3
side-channel-map: 1.0.1
side-channel@1.0.6:
dependencies:
call-bind: 1.0.8
es-errors: 1.3.0
get-intrinsic: 1.2.6
object-inspect: 1.13.3
side-channel@1.1.0:
dependencies:
es-errors: 1.3.0
@@ -30407,7 +30416,7 @@ snapshots:
internal-slot: 1.0.7
regexp.prototype.flags: 1.5.3
set-function-name: 2.0.2
side-channel: 1.0.6
side-channel: 1.1.0
string.prototype.trim@1.2.9:
dependencies: