Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 issues with JSLint #47

Closed
victorbstan opened this issue Oct 24, 2010 · 1 comment
Closed

9 issues with JSLint #47

victorbstan opened this issue Oct 24, 2010 · 1 comment

Comments

@victorbstan
Copy link

Validate Javascript
underscore.js

0 error(s), 9 warning(s)

171: warning: test for equality (==) mistyped as assignment (=)?
if (result = iterator.call(context, value, index, list)) _.breakLoop();
.............................................................^

341: WARNING: block statements containing block statements should use curly braces to resolve ambiguity
for (var i = 0, l = array.length; i < l; i++) if (array[i] === item) return i;
..................................................^

350: WARNING: block statements containing block statements should use curly braces to resolve ambiguity
while (i--) if (array[i] === item) return i;
................^

360: warning: variable start hides argument
start = solo ? 0 : args[0],
........^

361: warning: variable stop hides argument
stop = solo ? args[0] : args[1],
........^

362: warning: variable step hides argument
step = args[2] || 1,
........^

448: WARNING: block statements containing block statements should use curly braces to resolve ambiguity
for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
.........................^

516: WARNING: block statements containing block statements should use curly braces to resolve ambiguity
for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false;
.......................^

523: WARNING: block statements containing block statements should use curly braces to resolve ambiguity
for (var key in obj) if (hasOwnProperty.call(obj, key)) return false;
.........................^

@jashkenas
Copy link
Owner

I'm afraid that Underscore isn't intended to pass JSLint. We use a configured version of JavaScriptLint to lint it, with sane warnings. JSLint encourages a pedantic, heavy style -- and Underscore is written to be read. Sorry about that.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants