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
-1
votes
2 answers

Expected an identifier and instead saw '...'

This error is coming up in jslint, how would I fix this line? const { width, height, ...options } = opts; Full Code: https://jsfiddle.net/zt7anuL3/18/ Section of the code where the line is: function initPlayer(wrapper) { const video…
Eve Ninnall
  • 1
  • 3
  • 20
-1
votes
1 answer

Disabling all jslint rules with Inline Comments

/* eslint-disable */ is the inline comment that disables/ignores all the eslint rules in a js file. Similarly is there any way to disable all jslint rules with inline comment within a js file?
Vishwas R
  • 3,340
  • 1
  • 16
  • 37
-1
votes
1 answer

keep getting 'Unexpected '(space)' error?

in jsLint i keep getting this 5 errors : 'Unexpected '(space)' case summer. 'Unexpected '(space)' case winter. 'Unexpected '(space)' case fall. 'Unexpected '(space)' case autumn. 'Unexpected '(space)' case spring. var season = prompt("what is your…
Řě Đã
  • 31
  • 3
-1
votes
1 answer

Expected an identifier and instead saw '*' line 7 pos 3

I am trying to merge the coins into master but there is a conflict. I am unable to save the game.js file either because sublime is yelling at me for having a syntax error that I can't figure out, please help enter image description here here is all…
Omar
  • 49
  • 1
  • 6
-1
votes
1 answer

What is causing $ to be undefined? (JQuery)

I am practicing my JQuery at the moment, and I cannot understand how to make this error message go away: '$' was used before it was defined. The code seems to work though. Nothing wrong with it. I downloaded the latest version of JQuery, using a…
Los
  • 75
  • 1
  • 6
-1
votes
1 answer

"Read only" JSLint Error

I'm trying to set up google maps geolocation and and JSLint keeps saying "Read only." for this code: function geolocationSuccess(position) { // Turn the geolocation position into a LatLng object. location = new…
Jake Scervino
  • 581
  • 4
  • 9
  • 26
-1
votes
1 answer

JSLint expected "/" after

The title says it all really. I've written a bit of JS code, it works fine, but I decided to run it through JSLint just to be sure. There were a few trailing spaces, and a couple of instances of "use spaces, not tabs" which is all fine. However,…
Tijmen
  • 542
  • 1
  • 6
  • 29
-1
votes
2 answers

JSLint reports "expected : and instead saw ')'" on regexp

function phonenumberValidation(inputtext) { var phonenumber = /^(?([0-9]{3})\)?[-.]?([0-9]{3})[-.]?([0-9]{4})$/ if (inputtext.value.match(phonenumber)); { alert("Valid Phone Number"); return true; } else { …
Ashvin Ashoke
  • 43
  • 1
  • 4
-1
votes
1 answer

Javascript increment ( ++) warning

I noticed, that jslint warns me about increment: var x = 1; x++; Unexpected expression '++' in statement position. From doc: They are second only to faulty architecture in enabling to viruses and other security menaces How can viruses exploit…
alexey
  • 1,381
  • 9
  • 19
-1
votes
1 answer

How to remove the following error in Jslint?

I am the first experience with Jslint/jshint, Just received the error like this ES5 option is now set per default How to fix it?
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
-1
votes
1 answer

Validation error in JSlint

I am having some troubles. We had an assignment in the JavaScript class that I am taking to create a game of Hangman using module pattern. I have succeeded with making it function, however, my code does not pass the Jslint validation test. It keeps…
BjornRunow
  • 525
  • 1
  • 4
  • 10
-1
votes
1 answer

How to format a base64 encoded string to jslintable lines of x characters?

I have to lint a number of files which include images as base64 strings. Of course I can break them into the correct line format by hand, but... Question: Are there any online converters which break strings into "JavaScript usable" lines of n…
frequent
  • 27,643
  • 59
  • 181
  • 333
-1
votes
4 answers

Correct Way Of Achieving This Result?

So I currently have this piece of code: if(direction === "right" ) { var signOne = '-'; var signTwo = ''; } if(direction === "left" ) { var signOne = ''; var signTwo = '-'; } innerWork.not('.active').css({'left': signOne + '450px'}); // Move the…
Tenatious
  • 849
  • 4
  • 12
  • 32
-1
votes
1 answer

What is difference between "options and error code" in jshint?

I had confusion between options and error/warning code in jshint. curly : true or W116 How to identify "curly options" belongs to W116 Code? while(true) alert("ok"); demo.js: line 3, col 5, Expected '{' and instead saw…
-1
votes
2 answers

JSLint Missing Semi-colon

I got that error message but I'm not sure where a semi-colon should be. This is the code. $('.animation1').delay(350).queue(function(){ $(this).addClass("animate-from-top") });
fender967
  • 285
  • 8
  • 17
1 2 3
66
67