Tern Linter Lint - angelozerr/tern.java GitHub Wiki
Tern & Validation
tern-lint provides the lint.js Tern plugin which is enable to validate your JS files. Please note, that this lint.js is experimetal.
Please read Validation Rules to know what this tern lint is able to validate.
After installing and converting your project as Tern Project, go at Tern project property, you can check the lint plugin.
Validation sample with browser
In the following sample, we have checked browser tern definition :
Here sample validation with document#getElementById
. If you use known property :
var elt = document.getElementById('myId');
you will see no warnings :
If you use unknown property :
var elt = document.getElementByIdXXX('myId');
you will see the Unknown property 'getElementByIdXXX' warning :
Validation sample with YUI
Validation works too with Tern plugin. In the following sample, we have checked YUI tern plugin :
Here sample validation with YUI()#use
. If you use known property :
YUI().use('node', function(Y) {
Y.
});
you will see no warnings :
You can notice, that completion is available for the Y instance.
If you use unknown property :
YUI().useXXX('node', function(Y) {
Y.
});
you will see the Unknown property 'useXXX' warning :
You can notice, that completion is not available for the Y instance.
Validate with JSDoc
Please read here