ITADN

`no-literal-string` fails to detect strings when assigned to UPPER_SNAKE_CASE constants

#148Openshcshcshc 创建于 2025-09-25
S
shcshcshccommented
## Package version ``` "@eslint/js": "^9.7.0", "typescript-eslint": "^8.4.0", "eslint": "^8.57.0", "typescript-eslint": "^8.4.0", "eslint-plugin-i18next": "^6.1.3", ``` ## 🧪 Minimal Reproduction With the following code: ```tsx export const SNAKE_UPPER_CASE_EXAMPLE = "this should be error"; export const camelCaseExample = "thisShouldBeError"; ``` And this rule configuration: ```tsx "i18next/no-literal-string": [ "error", { mode: "all", }, ], ``` ➡️ Expected: Both cases should be flagged as literal strings ❌ Actual: SNAKE_UPPER_CASE_EXAMPLE is not reported. <img width="750" height="51" alt="Image" src="https://github.com/user-attachments/assets/0a17319a-2cf3-447a-94c4-a2592e6fefa4" /> Is the behavior where objects assigned to SNAKE_UPPER_CASE constants are excluded from reporting intentional? If so, I would like to know how I can report or handle this behavior. If not, I believe this behavior is a bug, and that's why I'm reporting it.
0 条评论