Sometime ago I asked this question: Enable javascript validation for eclipse
I wanted eclipse to highlight javascript errors/warnings.. The problem as you can see in
Partial response (coz Need ans asked in comment): you can convert your project to a JavaScript project by adding the following nature to the .project file contained at the root of your project:
//... other project settings
org.eclipse.wst.jsdt.core.jsNature
If you are not able to find .project see Showing or hiding files in the Project Explorer view for more details.