Add i18n ESLint plugin configuration#211
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This pull request adds internationalization (i18n) validation to the project by installing and configuring the eslint-plugin-i18n-json plugin to validate JSON translation files.
- Installs
eslint-plugin-i18n-jsonas a development dependency - Configures ESLint rules for JSON translation validation with error and warning levels
- Creates required configuration files for the i18n plugin functionality
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds eslint-plugin-i18n-json as dev dependency |
| .eslintrc.json | Configures i18n ESLint rules for JSON validation |
| translations/static-label-pairing.js | Creates empty configuration file for static label pairing |
| translations/static-label-pairing.cjs | Creates CommonJS version of static label pairing config |
| src/components/lib/i18n/translations/en.json | Adds comprehensive English translation file with 399 translation keys |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| ? `…${e.file_path?.slice(-18)}` | ||
| : e.file_path} | ||
| L{e.line_number} | ||
| {t('L', 'L')} |
|
let sno try to remove src/components/lib/i18n/translations/en.json if possible, or add a readme for src/components/lib/i18n/translations/en.json in src/components/lib/i18n/translations/README.md |
- Install eslint-plugin-i18n-json for JSON translation file validation - Configure ESLint rules for i18n JSON files: - valid-json: Error for invalid JSON syntax - sorted-keys: Warning for unsorted translation keys - identical-keys: Error for inconsistent keys across locales - Set up required directory structure and files - Run ESLint fix to apply automated fixes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added eslint-plugin-i18n-json package to enforce i18n JSON file standards - Configured ESLint rules for JSON validation, key sorting, and consistency - Fixed React hooks dependency warning in claim-my-node component - Verified linting and build processes work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…-json - Replaced eslint-plugin-i18n-json with @spaced-out/eslint-plugin-i18n v3.0.5 - Created required configuration files for the plugin to work properly - Added translations/static-label-pairing.cjs for plugin compatibility - Created symlink to existing translation files in expected location - Configured ESLint with missing-translation rule for i18n validation - Fixed React hooks dependencies warning in claim-my-node component - Verified both lint and build processes work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace .eslintrc.json with .eslintrc.yaml for better readability - Configure @spaced-out/i18n plugin with progressive enablement approach - Update scan-i18n.ts to support default values in translation keys - Add support for t(key, defaultValue) pattern - Improve translation key extraction with better error handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Applied ESLint fixes to ensure proper internationalization patterns across the codebase using @spaced-out/eslint-plugin-i18n. This enforces consistent usage of translation functions and prevents hardcoded text strings. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ionalization support in status badge component feat(NodeStatusReason): integrate useNextTranslation hook for internationalization support in YAML components
…nto separate functional components for better readability and maintainability
- Remove unnecessary ESM export since ESLint plugin uses require() - Use .cjs extension for proper CommonJS handling in ES module project - Create .js symlink for plugin compatibility (plugin expects .js path) - Keep only the format that's actually used by the ESLint plugin Result: Cleaner, single-format configuration file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
c5ba12a to
72b8f49
Compare
- Update NodeVersionCompatibilityEditModal.tsx to use proper i18n interpolation - Disable i18n static label checks in MockFeaturedPage.stories.tsx
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
- Update plugin references from @spaced-out/eslint-plugin-i18n to eslint-plugin-i18n-json in static-label-pairing files
- Fix NodeStatusReason L{{number}} interpolation to use proper i18next format
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
827742a to
0281ed9
Compare
- Remove unused src/components/lib/i18n/translations/en.json symlink pointing to locales/en/common.json - Remove unused translations/static-label-pairing.js symlink pointing to static-label-pairing.cjs - Clean up empty directories left behind These symlinks were creating file duplications in the repository without being used. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Merged latest changes from main branch and resolved conflicts in: - components/NodeStatusBadge.tsx: Combined i18n import with NodeVersionStatus import - components/common/LanguageSwitcher.tsx: Kept both i18n changes and modal contributions - package.json: Merged biome scripts with i18n eslint plugin - src/stories/*.tsx: Combined i18n imports with new imports from main All conflicts resolved by keeping both sets of changes where applicable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Merged latest changes from main branch - Updated all locale files (ar, es, fr, ja, ko, ru, tr, zh) - Added README.md explaining why en.json exists as a placeholder - The @spaced-out/eslint-plugin-i18n plugin requires en.json at src/components/lib/i18n/translations/en.json (hardcoded path) - Actual translations remain in ./locales/ directory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
ESLint auto-fix added t() calls but the import was missing, causing TypeScript build errors. This commit adds the necessary import and hook usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
eslint-plugin-i18n-jsonfor validation of i18n JSON translation filesChanges
eslint-plugin-i18n-jsonas dev dependency.eslintrc.jsonwith i18n validation rules:i18n-json/valid-json: Error for invalid JSON syntaxi18n-json/sorted-keys: Warning for unsorted translation keysi18n-json/identical-keys: Error for inconsistent keys across localesTest plan
locales/directorybun run fix🤖 Generated with Claude Code