Is there a working JSLint Eclipse plug-in? - javascript

Can anyone point to a functioning JSLint plug-in for Eclipse?

Use this:
In Eclipse, Install New Software to http://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download
I used jslint4java to add jslint to the Eclipse plugin for Android PhoneGap development. If you're not interested in PhoneGap or Android, you can choose only the jslint4java feature in the install wizard
Usage information here.

There is a plugin here and it works ok. (site is down sometime in 2011)
The update site is http://update.rockstarapps.com/site.xml (site down 2012-07-24)
You can also run jslint4java as an external tool:
Download jslint4java
Put jslint4java.jar somewhere
Add an external tool configuration in Eclipse (Run > External Tools > External Tools Configurations > Program > New...):
Location: /usr/bin/java
(or your path to javaw.exe)
Arguments: -jar /path/to/jslint4java.jar ${resource_loc}
Now you can select a js file in the Project Explorer and run jslint4java from the external tools menu.

I think I've found the simplest solution. If you install Aptana Studio, a free Eclipse plug-in, you get among other things, an excellent JavaScript IDE with support for Ext, jQuery and other major libraries.
Using these instructions (copied here in case blogspot is blocked at work), you can easily turn on JSLint support.
You can enable it by doing:
Open Aptana Studio- Go to Window > Preferences
Go to Aptana > Editors > JavaScript > Validation in the left hand menu
Check "JSLint JavaScript Validator"- Hit OK- Go to Window > Show View > Validation
(may need to go to Show View - Other - Aptana Views)
You'll see the Validation on the bottom right of the screen- Now also click Toggle Information and Toggle Warnings (found on the top left corner of the validation pane)
You're all set. JSLint will warn you whilst writing code

You might consider a JsHint Eclipse plugin as an alternative.
From what the project objective reads, JSHint was originally a fork of JsLHint with more option configuration.
Eclipse plugin http://github.eclipsesource.com/jshint-eclipse/
JsHint reference http://www.jshint.com/about/

I do this a different way that integrates nicely with the IDE In eclipse most of this is one time set up and then it becomes quite easy to validate your code after that.
Help -> Install new software
Click the 'Add' button
Name : Rockstar Apps (or whatever you want)
Location : http://update.rockstarapps.com/site.xml
expend the selection and check Rockstar JsLint
Click 'Next'...again
Accept and install
(you'll have to hit okay when it prompts you about installing unsigned content).
Restart Eclipse...
Almost done
Now when you want to validate your javascript right click the file Rockstarapps -> Validate with JsLint...
customize your validation settings and your done. (i usually just choose recommended)
the problems will show up in your problems panel.

Related

Turning off Eclipse 2020-06 Javascript Validation Notes

Using Eclipse's 2020-06 built in JavaScript editor, I need to disable the JavaScript informational notes on syntax and warnings as displayed with an (i) icon to the left of the line number and with markers to the right of the scroll bar. See links to the two images showing what these look like.
An example of the informational icon
An example of the markers
There are two warnings repeating numerous times:
'aVariableName' is declared but its value is never read.
This constructor function may be converted to a class declaration.
I would rather turn off these two individual messages since they do not apply to the project, but such control does not appear to exist, but they are overly spamming the editor and are interfering with other notifications and informational notes. FYI: I'm needing to follow specific coding conventions for the project and therefore the warnings don't even apply to the project and are just spam.
So I'll just settle for shutting off javascript validation, but the validation will not turn off.
I've tried to disable the project level settings for the javascript validation through the menu option Window, Preferences, Web, HTML Files, Client-side Javascript, Validator, Errors/Warnings: and unchecked both options of Strict Validation of Javascript keywords usage, and Enable JavaScript semantic validation. But making those changes accomplishes nothing since the warnings are still there even after running validation on the project, cleaning the project, and even restarting eclipse.
The specific version of Eclipse is:
Eclipse IDE for Enterprise Java Developers Version 2020-06 (4.16.0)
To try to better explain the need to install Node.js, this is the dialog requested Node.js be installed. The text of the dialog reads: "Missing node.js" "Could not find node.js. This will result in editors missing key features. Please make sure node.js is installed and that your PATH environment variable contains the location to the 'node' executable."
Eclipse's Missing Node.js dialog
Are there any other ways to shut off individual warnings/messages, or the javascript validations? Any help, or constructive suggestions would be very much appreciated. Thanks!
Sorry, the stackoverflow editor won't allow in-lining simple images.
Update: So I have not been able to figure out how to disable the informational notices that are showing up in the JavaScript editor along both the left and right margins. I would still love to find out how to do that. I'm wondering if the issues I'm seeing may have been resolved in the current release of Eclipse? I cannot put my development environments at risk if downgrading is not possible. But some hopeful and important details that I have learned is that the latest release of Eclipse "can" support java 1.8 although it says the minimal version supported is Java 11. And also the latest release is better integrated with Node.js so an external install is no longer required. At this time I cannot risk testing the latest Eclipse release due to possible lockout of the workspaces if eclipse cannot be downgraded. I will make plans to rebuild some of the workspaces on another workstation so it will not impact vital projects if something should go wrong.
I was able to disable these javascript validation notes by changing the following setting.
Eclipse -> Window -> Preferences -> General -> Editors ->Text Editors -> Annotations
find "Infos" in the "Annotation types" and click it
uncheck both the "Vertical Ruler" and "Overview Ruler"
optional - uncheck "Text as "Squiggly Line"
Click Apply and Close
Voila enjoy the less cluttered javascript files

IntelliJ Firefox Web Extensions Development

Am learning how to use the Firefox Web Extensions API, and am using IntelliJ.
Is there a way to get code completion / suggestions for the API?
I followed the steps in the answer below, but there doesn't seem to be a complete one for Firefox.
https://stackoverflow.com/a/25466708/5941389
Firefox WebExtension type stubs were added recently (Nov 2017) under the name firefox-webext-browser. The steps in the answer you linked are now valid (relevant changes in bold):
First time setup
Open the Settings dialog (File > Settings)
Click Languages & Frameworks > Javascript > Libraries
Click Download
Make sure TypeScript community stubs is selected
Select firefox-webext-browser from the list (you can find it quickly by just typing firefox-w)
Click Download and Install
Click OK to close the Settings dialog.
In Subsequent Projects
Open the Settings dialog again (File > Settings)
Click Languages & Frameworks > Javascript > Libraries again
Check #types/firefox-webext-browser
Click OK to close the dialog.

Use Quorum Plugin on another IDE; Sonic Pi; MIDI; javascript

I wrote a program that plays a song using sonic pi. I have to transcribe the code to a web language (javascript). Since I'm new at javascript I thought it would be ideal to use QUORUM (http://quorumlanguage.com/) to transcribe it since there is easy access to MIDI libraries, etc. (that I absolutely need). I have a mac and tried to use netbeans, etc (all processes suggested on the quorum site) but they are not working. So, I figured I should be able to use the Quorum plugin that I downloaded on another IDE (a cloud IDE would probably be better). I keep failing and I honestly don't know really know what I'm doing. I'd prefer not to pay for an IDE. I tried orion's cloud ide "che" but it won't let me download the plugin via the internet or give me an option for uploading or running a native file.
Basically, I would like to find someway I can use quorum on my Mac.
Please help.
Doing all this for my graduate degree.
Thanks.
Em.
In order to use The Quorum Programming language, it MUST be in the Netbeans IDE. No exceptions.
The process of installing the plugin for Quorum Language Support is as follows:
MAKE SURE YOU HAVE THE LATEST VERSION OF THE JAVA DEVELOPMENT KIT!!! - This is VERY important as Quorum 3.0 uses the Latest Version of Java and Quorum compiles to Java Byte Code.
You MUST Have Netbeans 8.0 or greater (at most Netbeans 8.0.2). - This is also very important as Quorum 3.0 takes advantage of features in Netbeans 8.
Go to the plugins page. This can be done by clicking on "Tools" in the Menu Bar and then going to "Plugins"
Go to the Settings Tab and hit the button that says "Add"
In the Name Field, Type "Quorum"
In the URL Field, Type the following: http://quorumlanguage.com/updates/quorum/updates.xml
Now under "Available Plugins", Check the Box for Quorum
Click the Install Button
Restart Netbeans.
Now, upon completed load of the Netbeans IDE, The Quorum Module should ask you if you would like dictation of everything you do. If you do not want this, tell it that you do not. If you do, then go for it.
When you go to Create a new Project in Netbeans, you should see an option for Quorum. If you do see this,then you have successfully installed the Quorum Plugin to Netbeans.

How do I use WebStorm for Chrome Extension Development?

I just bought WebStorm 5 and so far have been really enjoying its Inspection features. One hitch I've run in to when developing my Chrome extension is that it doesn't recognize the chrome variable:
Is there a way I can add the chrome variable to the Inspector so that it can autocomplete as I type? I'm guessing I would need to add Chromium as an External Library but I'm unsure where to start.
First Time Setup
Open the Settings dialog (File > Settings)
Click Languages & Frameworks > Javascript > Libraries
Click Download
Make sure TypeScript community stubs is selected
Select chrome from the list (you can find it quickly by just typing chrome)
Click Download and Install
Click OK to close the Settings dialog.
Steps 2-6 illustrated below:
In Subsequent Projects
In any subsequent project, you just:
Open the Settings dialog again (File > Settings)
Click Languages & Frameworks > Javascript > Libraries again
Check chrome-DefinitelyTyped
Click OK to close the dialog.
Steps 2-4 shown below:
UPDATE 2:
It's now supported out of the box, see the complete answer below.
UPDATE:
There is a more complete stub file that can be added as a library to get code completion. It's a part of the Closure Compiler project. Download chrome_extensions.js.
See also the feature request for WebStorm to add this library automatically from the IDE.
You need to get the JavaScript library for the Chrome API somewhere, or use a stub to get basic completion.
Library or a stub can be configured in WebStorm.
I found the JSON files with the Extension API. One can write a script that will build JS stubs from these JSON files, the stubs can look like the basic version linked on GitHub above, but with the automatic generation they will contain almost complete API and JSDoc comments so that documentation like here can be viewed directly in the IDE.
JSON => JavaScript object stubs mapping is pretty straightforward in this case and writing this kind of converter should not take more than a day (or several hours for the skilled coder).
If someone goes ahead and implements it, please post the link to the results here.
WebStorm should one day accept json definitions directly to enable autocomplete for the functions defined. Meanwhile, you can use the program at https://github.com/QuickrWorld/jsgen to convert the json files to js to enable auto-complete for the chrome extension APIs.
For writing AppScript, functions and classes such as DriveApp, SpreadsheetApp, there is a plugin in WebStorm or Intellij called google-app-script.
The installation method is the same as above. On the other hand, you should mark or open the .gs file as JavaScript. (July 2017)

Eclipse PDT - Javascript Code Assist is not work?

I thought PDT would do code assisting on JS files. Was I wrong, or is there a bug or something I am missing?
Is the Javascript development tools installed? I'm not sure, whether its installed together with the PHP Development Tools.
Select Help/Install new software, then select the Helios update site (http://download.eclipse.org/releases/helios), then install the Javascript Development Tools from the Web, XML and Java EE category.
Update: See the answer at your other question.
Got here because I had the same problem, first install "Eclipse web developer tools => javascript development tools"
Then instead of creating a javascript project create a "static web project". Right click the project in project explorer choose configure (in the bottom) make sure you add javascript support (if it's not there than it's probably already supported).
Under your project in project explorer there should be an item called javascript resources right click that and choose properties. If the browser libraries or ecma3 libraries are not there you can add them.

Categories