mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
## Summary Enforce i18n import conventions via ESLint: Vue components must use `useI18n()`, non-composable `.ts` files must use the global `t` from `@/i18n`. ## Changes - **What**: Two new `no-restricted-imports` rules in `eslint.config.ts` (both `warn` severity for incremental migration). Removed the disabled `@/i18n--to-enable` placeholder from `.oxlintrc.json`. - `.vue` files: disallow importing `t`/`d`/`st`/`te` from `@/i18n` (37 existing violations to migrate) - Non-composable `.ts` files: disallow importing `useI18n` from `vue-i18n` (2 existing violations) - Composable `use*.ts`, test files, and `src/i18n.ts` are excluded from Rule 2 ## Review Focus - The rules are placed after `oxlint.buildFromOxlintConfigFile()` to re-enable ESLint's `no-restricted-imports` for these specific file scopes without conflicting with oxlint's base rule (which handles PrimeVue deprecations). - `warn` severity chosen so CI is not blocked while existing violations are migrated. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8701-feat-enforce-i18n-import-conventions-via-ESLint-2ff6d73d36508123b6f9edf2693fb5e0) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
8.7 KiB
8.7 KiB