How to be comfortable with the JSLint validator?

Using JSLint from some month, I wonder how comfortable with it?

IMO official website is too simple. There is no line number in the code editor, there are no links between the error and the code, poor performance ...

And use in the CLI is also not a more convenient way.

So the question is: "How do you use JSLint?". What are your practices and recommendations for using JSLint? Are there alternative online checkers that are more powerful? Or maybe an advanced online editor that includes JSLint authentication?

+4
source share
5 answers

Have you tried JSHint?

Jshint

This is a JSLinl fork with some updates, such as a line number.

In any case, there is a plugin that you can add to your favorite text editor.

+2
source

If you are using Visual Studio, I highly recommend the JSLint.VS2010 extension . It integrates directly with the IDE. I really like some features:

  • Choosing JSLint or JSHint (I prefer JSHint)
  • Granular control of test parameters to enable / disable exactly what is being tested.
  • Automatically check files when building a project
  • Ability to exclude files from scanning (useful for external libraries such as jQuery)
  • Right-click in the IDE window to immediately confirm the current file.
  • Ability to comment on individual lines or blocks of code to prevent validation. Useful when you want to break the rules intentionally occasionally
  • Clicking on a warning brings me directly to a line with a code violation
+3
source

Do not be afraid of the plug. JSLint is based on Crockford's personal code quality ideas, and you might think differently.

I am using JSLint (the "enhanced" version) as the pre-commit binding in git. This requires some installation of Node or Rhino, and it saves me having to run it manually.

Remember:

JSLint will hurt your feelings

+2
source

You can get JSLint plugins for your preferred IDE. I use the JSLint validator with Resharper 6 in Visual Studio, which gives me everything you mention (I click on the warning, it displays me on a line of code).

On the JS Lint website, you should get the line number and character along with a code snippet for any error in the warning message:

Problem with line character 10 13: The constructor name 'myObject' should start with a capital letter.

var x = new myObject ();

0
source

If you want to make part of the JSLint build process, run jslint4java . It works great for Java projects, but can also be applied to non-Java projects.

0
source

All Articles