Basic Usage
Quick Start
Using Translation
- Open any JavaScript or TypeScript file
- Ensure the file has ESLint errors (red squiggly lines)
- Hover over an ESLint error
- View the translation and fix suggestion in the tooltip
Example
Code:
javascript
const unused = 42;
console.log("Hello");ESLint Error:
'unused' is assigned a value but never used. (no-unused-vars)ESLint Intl Translation:
Variable 'unused' is assigned a value but never used.
💡 Fix Suggestion: Delete the unused variable or use it in your codeSwitching Languages
Method 1: Via Settings
- Open VS Code Settings (
Ctrl+,) - Search
eslintIntl.targetLanguage - Select your preferred language
Method 2: Via Command Palette
Open Command Palette (Ctrl+Shift+P) and run:
ESLint Intl: Toggle TranslationEnable/Disable Translation
Method 1: Via Settings
- Open Settings (
Ctrl+,) - Search
eslintIntl.enabled - Check or uncheck
Method 2: Via Command
Open Command Palette (Ctrl+Shift+P) and run:
ESLint Intl: Toggle TranslationShow Original Error
Sometimes you may want to see the original English error message. Enable this feature:
- Open Settings (
Ctrl+,) - Search
eslintIntl.showOriginal - Check to enable
Now the hover tooltip will show both translation and original error.
Using Different APIs
Switch API Provider
Modify the following settings to use different APIs:
json
{
"eslintIntl.openai.baseUrl": "https://your-api.com/v1",
"eslintIntl.openai.apiKey": "your-key",
"eslintIntl.openai.model": "your-model"
}Supported API Providers
- OpenAI:
https://api.openai.com/v1 - Azure OpenAI:
https://{resource}.openai.azure.com/v1 - Ollama (local):
http://localhost:11434/v1 - Custom Service: Any OpenAI-compatible service
File Type Support
ESLint Intl supports all file types that ESLint can check:
- ✅
.js- JavaScript - ✅
.jsx- React JSX - ✅
.ts- TypeScript - ✅
.tsx- TypeScript JSX - ✅
.json- JSON (if ESLint configured) - ✅
.vue- Vue (if ESLint configured) - ✅
.html- HTML (if ESLint configured)
Performance Tips
Enable Caching
Caching is enabled by default. Cached translations expire in 7 days.
Force Fresh Translation
To always get the latest translation, clear cache:
ESLint Intl: Clear Translation CacheBatch Translation
Hover over multiple errors to fill the cache; subsequent same errors will be faster.
Debugging
View Output Log
Open Command Palette (Ctrl+Shift+P) and run:
ESLint Intl: Show Output LogCheck Cache Status
Cache status information is displayed in the output log.
Troubleshooting
Translation Not Showing
- Ensure
eslintIntl.enabledistrue - Check that file truly has ESLint errors
- Check output log for error messages
- Restart VS Code
API Connection Error
- Check if API Key is correct
- Check network connection
- Verify Base URL is correct
- See output log for detailed errors
Poor Translation Quality
- Try switching models:
eslintIntl.openai.model - Clear cache to get fresh translations
- Check if API service is working properly
More Help
- 📖 Check FAQ
- 🔧 See Configuration Guide
- 🐛 Submit an Issue