admin管理员组文章数量:1429891
Using JSLint since some month, I wonder how to be fortable with it?
IMO the official website is too basic. No line number in the code editor, no links between error and code, poor presentation...
And using in CLI, is also not the more fortable way.
So the question is: "How do you use JSLint?". What are your practices and remendation to perform using JSLint? Is there any alternative online checker that are more powerful? Or maybe advanced online editor that include JSLint validator?
Using JSLint since some month, I wonder how to be fortable with it?
IMO the official website is too basic. No line number in the code editor, no links between error and code, poor presentation...
And using in CLI, is also not the more fortable way.
So the question is: "How do you use JSLint?". What are your practices and remendation to perform using JSLint? Is there any alternative online checker that are more powerful? Or maybe advanced online editor that include JSLint validator?
Share Improve this question edited Oct 30, 2011 at 0:56 bmargulies 100k40 gold badges194 silver badges325 bronze badges asked Sep 23, 2011 at 7:06 jeanmonodjeanmonod 3152 silver badges7 bronze badges 1- what scripting language are you using?? – Baz1nga Commented Sep 23, 2011 at 7:10
5 Answers
Reset to default 3If you are using Visual Studio I highly remend the JSLint.VS2010 Extension. It integrates directly into the IDE. A few features I really like:
- Choice of JSLint or JSHint (I prefer JSHint)
- Granular control of check options to enable/disable exactly what gets validated
- Automatically check files on project build
- Ability to exclude files from check (useful for external libraries such as JQuery)
- Right-click in IDE window to validate current file instantly
- Ability to ment individual lines or code blocks to prevent validation. Useful when you want to break the rules deliberately occasionally
- Click on warning message takes me directly to the offending line of code
Have you tried JSHint?
JSHint
It's a fork of JSLinl with some upgrades, for example like line number.
Anyway there're some plugin that you could add to your favorite text editor.
Don't be afraid to fork. JSLint is based on Crockford's personal ideas of code quality, and you might think different.
I use JSLint ("improved" version) as a pre-mit hook in git. This requires some Node or rhino installation, and saves me the trouble of running it manually.
Remember:
JSLint will hurt your feelings
You can get JSLint plugins for your preferred IDE. I use a JSLint validator along with Resharper 6 in Visual Studio, which gives me all of the things that you mention (I click on a warning, it takes me to the 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 at line 10 character 13: A constructor name 'myObject' should start with an uppercase letter.
var x = new myObject();
If you want to make JSLint part of your build process, do check out jslint4java. It works great for Java projects, but can also be applied to non-Java projects.
本文标签: javascriptHow to be comfortable with JSLint validatorStack Overflow
版权声明:本文标题:javascript - How to be comfortable with JSLint validator? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745500177a2660994.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论