Skip to content
Angelo edited this page May 14, 2015 · 14 revisions

Tern Linter (Validator)

Since 0.9.0, Tern IDE provides a WTP Tern Validator which uses several linter to validate your JavaScript files :

WTP Tern Validator is able to use those linter :

  • as you are typing on the JavaScript (JSDT), HTML, JSP editors.
  • Manual/Build Validation like other WTP Validators (HTML, XML, etc).

Tern linters are tern modules, so to activate validation with those linters, you must just select it (one or several) in the Tern / Modules project properties page. So it's possible to validate your JavaScript files with Lint and JSHint together for instance.

Each linter are tern plugin which are executed with node.js. The goal of tern linter is to provide the capability to add your own linter (ex : JSLint) easily.

Configuration

Tern Linter

To use tern validation, you must select one or several linters and configure it. Please read:

WTP Tern Validator

WTP Tern Validator which uses linters (JSHint, ESLInt, etc) can be configured like other WTP Validator (HTML, XML, etc). To configure it, open the project properties and go at Validation. By default Tern Validation is enable :

Tern validator - Validation

If you want that validation is done each time you save your JavaScript Editor, you must select Add Validation Builder and check that Build checkbox is checked for Tern Validator :

Tern validator - Add Validation Builder

Click on OK button, reopen the project properties and go at Builders: you should see that Validation builder is added to the Builders list :

Tern validator - Validation Builders

Now tern validation should be done as soon as you save your JavaScritpt editor.

Improvement (TODO)

  • Tern Script path to ignore JavaScript files to ignore.
Clone this wiki locally