views:

185

answers:

3

I have a lot of Expected '{' and instead saw 'blah' errors that spit out when I run my scripts through jslint. Is there an option that ignores this error?

A: 

Didn't understand well your question. But if you have an error, why not correct it before writing more code?

Omar Abid
because it is not an error. it is a style choice that douglas crockford forces on people who don't have the chops to patch jslint. There are many of these hardcoded style issues that make the output simply too noisy to be of benefit. for instance, visual studio formats js in such a way as to generate reams of 'errors' making it a losing battle. are you picking up what i am putting down? ;-)
Sky Sanders
You can configure VS to format code the way you want it.
Chetan Sastry
@chetan - if you can provide an example of telling VS to stop putting a space between func() and { I would be interested in seeing it.
Sky Sanders
+2  A: 

no. crocky is a curmudgeon js nazi.;-) there is a vs addin on codeplex that i added an ignore feature to though. the addin is still kinda buggy but works well enough. I haven't been able to get contact with the owner to get on the project so havent put a lot more time into it. anyway see here and get the patch from the patches tab

Sky Sanders
+2  A: 

There are no options to ignore this unless you edit the source of jslint and remove this particular warning. However, it is highly recommended not to ignore this rule.

Chetan Sastry
I know it's not recommended, but this particular coding style actually reduces your file size, and still maintains readability, regardless of what crock says. I ended just hacking the source myself, thanks for the confirmation.
Corey Hart