sbjstar / mobile-web-development-with-phonegap

Automatically exported from code.google.com/p/mobile-web-development-with-phonegap
0 stars 0 forks source link

JSLint4Java: Add option to disable out of scope warning #94

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open a JS file in Eclipse with the JSLint4Java plug-in
2. Declare a variable inside an if block (which is *perfectly legitimate JS)
3. Get an warning because Crockford is old school and was way too used to Java
4. Go in to the preferences and find no way to disable that warning

What is the expected output? What do you see instead?
I'd expect to see an option for disabling out of scope warnings (I think the 
JSLint code would be "ascope").  Instead I see none.

What version of the product are you using? On what operating system?
Eclipse Indigo SR2, JSLint4Java 1.0.1.201207042009, on Linux

Please provide any additional information below.
It would be REALLY nice if JSLint4Java had a way that you could disable any of 
JSLint's features simply by entering the appropriate code (instead of needing 
the devs to add a new checkbox for each one).  That may well be too much to ask 
though.

Original issue reported on code.google.com by jer...@syapse.com on 16 Nov 2012 at 1:43

GoogleCodeExporter commented 8 years ago
The varsattop option does some of what you're looking for, but probably not 
enough.

Original comment by paul.beu...@gmail.com on 16 Nov 2012 at 6:01

GoogleCodeExporter commented 8 years ago
Thanks for the response, but I'm afraid I didn't explain well: I'm trying to 
get rid of (specious) warnings, not add more ;-)  Enabling varsattop would just 
give me more of exactly the type of warnings I want to get rid of (the 
"Crockford hates on X because he forgets what language he's in and it'd be 
wrong in C/C++/Java/etc." warnings).

As a Javascript developer I find these "false positives" to be very misleading; 
there is nothing wrong with declaring a variable inside a "for" (varsattop) or 
"if" (ascope?) block.  However, despite flagging these false positives, JSLint 
also flags some very helpful cases, and I don't want to throw the baby out with 
the bath water.  In other words, I'm hoping there's some way to just disable 
this class of Crockford's craziness while preserving the rest of his genius :-)

Original comment by jer...@syapse.com on 16 Nov 2012 at 6:38

GoogleCodeExporter commented 8 years ago
I understood. Turning off varsattop is not possible in Crockford's jslint. I 
added it and made it the default.

Original comment by paul.beu...@gmail.com on 16 Nov 2012 at 6:54

GoogleCodeExporter commented 8 years ago
Ahhhh, I understand now; in that case kudos for doing that much at least!

Original comment by jer...@syapse.com on 16 Nov 2012 at 9:46