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

Fixes to make JSLint happy #6

Merged
merged 2 commits into from Aug 10, 2011
Merged

Fixes to make JSLint happy #6

merged 2 commits into from Aug 10, 2011

Conversation

drewish
Copy link
Contributor

@drewish drewish commented Aug 10, 2011

Make JSLint happy by:

  • Declaring variables once, in one statement at the beginning of each function.
  • Consistently indenting and using whitespace between operators.
  • Wrapping if and else blocks in curly braces.
  • Using === for comparisons.
  • Using "[]" rather than "new Array()" to initialize arrays.
  • Avoid using "static", which is a reserved word, as variable name.
  • Providing a radix to parseInt().

 - Declaring variables once, in one statement at the beginning of each function.
 - Consistently indenting and using whitespace between operators.
 - Wrapping if and else blocks in curly braces.
 - Using === for comparisons.
 - Using "[]" rather than "new Array()" to initialize arrays.
 - Avoid using "static", which is a reserved word, as variable name.
 - Providing a radix to parseInt().
@kennethkufluk
Copy link
Owner

Don't know how the whitespace got so bad. Good fix.

Not overly fussed about making JSLint happy - don't agree with all those rules. But if it's done, it's done.

kennethkufluk added a commit that referenced this pull request Aug 10, 2011
Fixes to make JSLint happy
@kennethkufluk kennethkufluk merged commit 6a2b0d6 into kennethkufluk:master Aug 10, 2011
@drewish
Copy link
Contributor Author

drewish commented Aug 10, 2011

Yeah I think some of his stuff is a bit silly (continue and ++/--) but many really do help avoid problems.

@kennethkufluk
Copy link
Owner

Oh, yes, most of them are obvious and invaluable.
Some of them are frivolous and silly.
Would rather have the first, but ignore the second (a la JSHint), but the standard is JSLint. Thanks for doing the work. :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants