Eclipse 默認對 JavaScript 支持較弱,無代碼補全、語法高亮、錯誤標記。通過安裝 **Wild Web Developer**(原 Nodeclipse/Enide)或 **TypeScript/JavaScript Language Server** 可獲得 VS Code 級別的智能提示體驗。
Wild Web Developer 安裝(若已內置可跳過)。JavaScript、TypeScript、JSON 驗證。node_modules(可選)。.js 文件,按 Ctrl+Space 觸發內容助手,支持:@types/*)自動識別npm install -g typescript-language-server typescript。Command: typescript-language-server --stdio
File Extensions: js,jsx,ts,tsx,json
package.json 或 tsconfig.json。| 需求 | 設置位置 | 操作 |
|---|---|---|
| 關閉烦人驗證 | Preferences → Validation | 取消勾選 JavaScript Validator(舊版) |
| 關聯 .vue/.jsx 文件 | Preferences → General → Editors → File Associations | 添加 *.vue 關聯 Wild Web Developer Editor |
| 項目級 jsconfig.json | 項目根目錄新建 | 配置 compilerOptions.target、include、exclude 優化補全範圍 |
| 使用項目內 ESLint/Prettier | Preferences → Wild Web Developer → Linting/Formatting | 啟用並指定配置文件路徑 |
node_modules 或設置 jsconfig.json "exclude": ["node_modules"]。