[ESLint 7/10] Fix i18next/no-literal-string warnings - #31031
[ESLint 7/10] Fix i18next/no-literal-string warnings#31031ShaileshParmar11 wants to merge 1 commit into
Conversation
Resolve all 2,282 i18next/no-literal-string warnings. - 2,242 (98%) were in test/mock files, which contain no user-facing strings. Turned the rule off for test/spec/mock files via the existing test-file override in eslint.config.mjs (one policy change instead of 2,242 inline disables). Trivially reversible if maintainers prefer inline disables. - 40 genuine production warnings (9 files): 34 replaced with t() + 26 new alphabetically-sorted en-us.json keys (reusing existing keys where the English matched); 6 non-user-facing glyphs/separators (✓ ▸ ⌘↵ Esc, UTC offset punctuation) disabled-with-reason. Ran `yarn i18n` to sync all 20 locale files. NOTE: yarn i18n copies the English strings verbatim into the 19 non-en locales as placeholders — real translations are follow-up work (CI only verifies key sync, which passes). Verified: i18next/no-literal-string 0 across all src, 0 eslint errors, no new warnings (git-stash before/after), 0 new tsc signatures vs baseline, `yarn check-i18n` passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedDisables i18next/no-literal-string for test files and wraps 40 genuine production strings with internationalization keys. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
|
| Count | Rule |
|---|---|
| 8 | react-hooks/exhaustive-deps |
| 3 | sonarjs/cyclomatic-complexity |
| 1 | sonarjs/expression-complexity |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Database/SchemaTable/SchemaTable.component.tsx:357:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchTestCaseSummary'. Either include it or remove the dependency array. |
| 🟡 | src/components/Database/SchemaTable/SchemaTable.component.tsx:459:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'tableFqn'. Either include it or remove the dependency array. |
| 🟡 | src/components/Database/SchemaTable/SchemaTable.component.tsx:774:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'handleEditDisplayNameClick' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Database/SchemaTable/SchemaTable.component.tsx:901:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'handleColumnClick' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Database/SchemaTable/SchemaTable.component.tsx:981:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx:36:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'getResourceLimit'. Either include it or remove the dependency array. |
| 🟡 | src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx:94:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'maxVersions'. Either include it or remove the dependency array. |
| 🟡 | src/components/ServiceAgents/components/RunHistoryDrawer.component.tsx:149:4 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":149,"column":3,"endLine":149,"endColumn |
| 🟡 | src/pages/TaskFormSettingsPage/TaskFormSettingsPage.tsx:121:61 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":121,"column":60,"endLine":121,"endColum |
| 🟡 | src/pages/TaskFormSettingsPage/TaskFormSettingsPage.tsx:176:33 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":176,"column":32,"endLine":176,"endColum |
| 🟡 | src/pages/TaskFormSettingsPage/TaskFormSettingsPage.tsx:292:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'loadSchemas'. Either include it or remove the dependency array. |
| 🟡 | src/pages/TaskFormSettingsPage/TaskFormSettingsPage.tsx:474:5 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (4) used in the expression (maximum allowed 3). |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
✅ Playwright Results — workflow succeededValidated commit ✅ 610 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 55m 18s ⏱️ Max setup 3m 9s · max shard execution 17m 38s · max shard-job elapsed before upload 21m 17s · reporting 5s 🌐 210.55 requests/attempt · 2.75 app boots/UI scenario · 4.25% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Fixes #30985. Part of epic #30977.
Stacked PR 7 of 10 — base branch
ShaileshParmar11/eslint-06-duplicate-string. Review after the previous PR in the stack. The diff here contains only the i18next/no-literal-string changes.mainas each lands. See epic #30977 for the full approach and reviewer caveats.Behavior-preserving lint cleanup. Verified: target rule(s) → 0, no new warnings (git-stash ESLint before/after), 0 new tsc signatures vs baseline.
🤖 Generated with Claude Code
Reviewer notes — the i18n approach
98% (2,242) of the⚠️ The 26 keys land as English placeholders in the 19 non-English locales — real translation is unavoidable human follow-up (CI only verifies key sync, which passes).
i18next/no-literal-stringwarnings were in test/spec/mock files, which contain no user-facing strings. Rather than 2,242 inline disables, the rule is turned off for test/spec/mock files via the existing test-file override ineslint.config.mjs— one config line (trivially reversible). The 40 genuine production strings are properly internationalised witht()+ 26 new alphabetically-sorteden-us.jsonkeys;yarn i18nthen synced all 20 locale files.