Questions tagged [jslint]

JSLint is a "code quality" tool for JavaScript developed by Douglas Crockford, a well-known developer also responsible for JSON, JSMin, ADSafe and parts of YUI. JSLint is parallel to C's lint.

JSLint is a static analysis “code quality” tool for JavaScript developed by Douglas Crockford, a well-known developer also responsible for JSON, JSMin, ADSafe and parts of YUI.

The term “linting” originates from fabric lint-rollers that help remove fluff from clothing. In the same way, a code “linter” helps the developer remove fluff from their code.

The first linting tool was developed for the C programming language when early compilers were not sophisticated enough to identify common programming errors. As the language and compilers matured, so the C linter became redundant and obsolete.

As much of the JavaScript written will not have been near a compiler, the requirement for an equivalent linting tool emerged. This is where JSLint comes in.

A similar tool, exists. It was forked from JSLint.

In the words of its creator:

Warning!

JSLint will hurt your feelings.

Resources

Related Tags

1004 questions
0
votes
1 answer

Coding Style - jQuery vs. jslint.com?

Possible Duplicate: How come JQuery doesn't pass JSLint? The jQuery style guideline referenced here gives a spacing style that breaks jslint. I realize I can just have it ignore "messy white-space" but my bigger concern is such: JavaScript is…
user656925
0
votes
2 answers

jshint complaining about not defined?

Why does jshint warn that gConfiguration is not defined? I have it defined before the start of the func. I also tried placing it inside. I know I can declare it as a global variable in the configuration but I don't see what this is wrong? requirejs…
ryan
  • 6,541
  • 5
  • 43
  • 68
0
votes
1 answer

Confusing JSLINT Error

I'm making a JavaScript dice roller for a tabletop strategy game that my friends and I play, but I've hit a snag. Basically there is an irregular hit table, so I can't use a formula (as far as I can tell) to judge the result, instead I've got a…
Maverick Jones
  • 434
  • 2
  • 5
  • 18
0
votes
1 answer

Using JSLint in Java/GWT

I'm currently working on a project in Java, that will allow users to type Javascript code into a GWT Widget. How would I go about importing/using JSLint to check for errors? I looked around and found LSLint4Java, but I couldn't find the way to…
Steven Morad
  • 2,511
  • 3
  • 19
  • 25
0
votes
2 answers

jsLint/jsHint maven site reporting

We are looking to incorporate jsLint or jsHint into our continuous integration process, I have found many maven plugins that will execute jsLint or jsHint and will break the build if the rules have been violated. We do not, however, have the luxury…
user975060
  • 335
  • 4
  • 16
0
votes
1 answer

JSLint: unexpected end

$.fn.hasScrollBar = function () { "use strict"; return this.get(0).scrollHeight > this.height(); } JSLint complains and says this: Unexpected '(end)'. } line 5 character 1 Any ideas what's wrong?
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
0
votes
2 answers

Space before and after = sign in javascript

JSLint screamed at me today: Missing space between 'CMyInterface' and '='. var CMyInterface=Class.create({ line 3 character 21 I am using prototype, so the Class comes from that. But still - is it REQUIRED that i place a whitespace before and…
SquareCat
  • 5,699
  • 9
  • 41
  • 75
0
votes
2 answers

JSLint "bad escapement" on a multiply sign

I need to display a multiply sign (×) in a modal being created by JavaScript like so: $(blah).dialog({ something: '\327' }); However, JSLint says this is a "bad escapement". Unfortunately, using an HTML entity like × doesn't work in this…
clem
  • 3,524
  • 3
  • 25
  • 41
0
votes
1 answer

JavaScript: unexpected Data error

I wrote some coding using javaScript. function showPopupSettings(userName) { var jsonData; setLoading("Loading User Settings"); jsonData = new function(){ this.className = "User"; …
starjava
  • 443
  • 2
  • 8
  • 14