Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Jun 24, 2015 · 4 comments
Open

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

GoogleCodeExporter opened this issue Jun 24, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 16 Nov 2012 at 1:43

@GoogleCodeExporter
Copy link
Author

The varsattop option does some of what you're looking for, but probably not 
enough.

Original comment by [email protected] on 16 Nov 2012 at 6:01

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 16 Nov 2012 at 6:38

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 16 Nov 2012 at 6:54

@GoogleCodeExporter
Copy link
Author

Ahhhh, I understand now; in that case kudos for doing that much at least!

Original comment by [email protected] on 16 Nov 2012 at 9:46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant