jslint

How can I run jslint as a javascript compile tool in emacs for Windows?

I'm using GNU Emacs on Win32. I want to be able to run jslint as a compilation on .js files, and then step through the errors that jslint reports. I have jslint, the WScript version. ...

JsLint 'out of scope' error

function test(){ if(true){ var a = 5; } alert(a); } test(); I keep getting 'out of scope' errors in my JS code when I check with JsLint which make no sense to me.So I quickly created an example. Is there something actually wrong with this code piece, as the variable is eventually hoisted to the top of the function ...

jslint: why do this code result in a "Strict violation" error message?

Running the following simple code results in a "Strict violation." error message. I have been trying to find documentation on why, and how to fix it. Any input will be much appreciated. The error: Error: Problem at line 6 character 4: Strict violation. } (this)); The sample code: /*jslint browser: true, onevar: true, undef: true, ...

CSSTidy, HTMLTidy, JSlint pre-commit hooks(Hg) - automation tools

I am looking for a way to test/validate my html, css, js before they are committed to a repository. Is there any way to automate this process. Ideally, I would like to have the ability to exclude certain files (js libraries for example). ...

What does JSLint's "Bad Escapement" mean in this case?

I thougth "bad escapement" stands for wrong use escaping with slash. Why does JSLint bring up the message in this function on the 3d line (for...)? function splitTags(commaSeparated) { var tagArray = commaSeparated.split(','); for (var i=(tagArray.length) - 1; i>=0; i = i - 1 ){ tagArray[i] = f.trim(tagArray[i]); }...

A better JavaScript version of addslashes and stripslashes?

I am using these 2 functions: http://javascript.about.com/library/bladdslash.htm But JSLint complains 'Bad Escapement' on this line: str=str.replace(/\\0/g,'\0'); [Edit] I converted to 2 lines, and now the first line is the one that fails JLint: var rep = '\0'; str=str.replace(/\\0/g,rep); So it is the '\0' can you help? ...

How can I get JSLint.VS Addin to work with Visual Studio 2010?

I love the JSLint add-in - very useful. Having just upgraded to VS2010, I want it working in my new environment. The problem is, regardless of location/path, it does not show up in the Addin Manager (under Tools menu). Any ideas? ...

jslint eclipse plugin?

Can anyone point to a functioning JSLint plugin for eclipse (3.5)? thanks ...

Unescaped '^' with jslint

This is my code: /********************************************************** * remove non-standard characters to give a valid html id * **********************************************************/ function htmlid(s) { return s.gsub(/[^A-Z^a-z^0-9^\-^_^:^\.]/, "."); } Why does jslint throw this error? Lint at line 5 character 25:...

JSLint Error Report - Whats wrong with this?

I got this error and dont know what could be the cause. Any idea? Problem at line 2127 character 18: Bad for in variable 'sport'. for (sport in sugested_sports) // make array var sugested_sports = data.split(","); // pre build DIV var sporty_items = ''; for (sport in sugested_sports)...

The "unexpected ++" error in jslint

What is the best practice for that then? Jslint explains that it "adds confusion". I don't see it really... EDIT: The code, as requested: var all,l,elements,e; all = inElement.getElementsByTagName('*'); l = all.length; elements = []; for (e = 0; e < l; (e++)) { if (findIn) { if (all[e].className.indexOf(cla...

Does JSLint parse DOM functions?

I tried to use the parse() function of JSLint to parse three pieces of JavaScript code: function(b, c){var a = b + c; return a; } window.addEventListener('click', click_hanlder, true); document.documentElement.innerHTML; The output: returns a correct tree. returns a tree with only one node of "window". crashes the browser. I'm wo...

How to get around the jslint error 'Don't make functions within a loop.'

I am working on making all of our JS code pass through jslint, sometimes with a lot of tweaking with the options to get legacy code pass for now on with the intention to fix it properly later. There is one thing that jslint complains about that I do not have a workround for. That is when using constructs like this, we get the error 'Don...

JSLint reports "Unexpected dangling" character in an underscore prefixed variable name

I know that some people consider the presence of a leading underscore to imply that a variable is "private," that such privacy is a fiction, and assume this is why JSLint reports such names with an error message. I use Google Analytics on a Web site I am building. I make reference to GA's variables, such as "_gaq." I am trying to get m...

JSLint reports unexpected use of '&' and '|' -- I'd like to clean this

I'm trying to get my Javascript code 100% JSLint clean. I've got some JS code that I've lifted from elsewhere to create a UUID. That code has the following line: s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1); This line incites JSLint to generate two error messages: 1) Unexpected use of '&' 2) Unexpected use of '|' I don't under...

JSLint reports "Insecure ^" for my regex -- what does that mean?

I'm trying to get my Javascript code 100% JSLint clean. I've got a regular expression: linkRgx = /https?:\/\/[^\s;|\\*'"!,()<>]+/g; JSLint reports: Insecure '^' What makes the use of the negation of the character set "insecure" ? ...

How to JSLint in PSPad Editor?

Can you help me to use JSLint with this editor? I have put the JSLint script into the scripts/JScript folder. Now I should go to the scripts menu and recompile scripts. But I cannot find the script menu in pspad. I have installed the latest version. Can you help? ...

Problem with ADSafe and JSLint

I am using the JSLint plugin for Eclipse from Rockstarapps and JSLint multi 1.1 (Yahoo Widgets) On both I keep getting ADSafe warnigns, no matter if I check or uncheck the ADSafe checkbox in the JSLint settings. I am not using and I don't need any ADSafe functionality, how to get rid of the JSLint warnings in JSLint multi and Eclipse? ...

Issue with configuring external tool in Visual Studio

I have an issue setting up an external tool in Visual Studio. The tool is for JS Lint, which lints a javascript file. My setup is as follows: Title: &JSLint - http://www.jslint.com/ Command: C:\Users\XXXX\Documents\Visual Studio 2008\Tools\JsLint\jslint.cmd Arguments: $(ItemPath) Initial Directory: [blank] When I run the tool, I g...

jslint type tool for css

I am using JSLint to validate and inspect my javascript files. I find it very useful and helps me write better code. I have integrated it into Visual Studio through external tools. I am looking for a similar tool but this time for CSS? Any other there to look at, mostly to carry out same tasks as JSLint. ...