HotDrink / hotdrink

JavaScript MVVM library with support for multi-way dependencies and generic, rich UI behaviors.
http://hotdrink.github.io/hotdrink/
58 stars 9 forks source link

JSLint test #34

Closed philipvr closed 12 years ago

philipvr commented 12 years ago

You can now run JSLint via command line:

$ cd test/jslint/
$ source jslint ../js/hotdrink.js
=== ../js/hotdrink.js ===
ERRORS:
 6:3    Missing 'use strict' statement.
    var error = function (message) {
 ---
 7:26   Expected '{' and instead saw 'return'.
    if (!window.console) return;
 ---
 11:3   Unexpected 'var'.
    var warning = function (message) {
 ---
 11:3   Stopping.  (0% scanned).
===
thejohnfreeman commented 12 years ago

Don't put JSLint into the repository. Just assume the user has it installed, and add the appropriate commands to the Makefile so that it is run on every build.

Once that is done, the branch can start work on fixing all the errors.

philipvr commented 12 years ago

Even after adding /*global hd:true */, jslint still gives the error:

Unexpected 'hd'.
hd.__private.Variable   = Variable;
thejohnfreeman commented 12 years ago

A semicolon is missing from the preceding statement.

philipvr commented 12 years ago

I have fixed most of the jslint errors, but main thing that jslint still has a problem with is the use of 'in':

lib/bindings/behavior/value.js error(s)
================================
30   Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.
:19  if ("value" in maybe) {
---
thejohnfreeman commented 12 years ago

Could you follow the suggestion and convert them all to use hasOwnProperty please?