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?
views:
185answers:
3
A:
Didn't understand well your question. But if you have an error, why not correct it before writing more code?
Omar Abid
2010-02-11 03:15:47
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
2010-02-11 03:23:39
You can configure VS to format code the way you want it.
Chetan Sastry
2010-02-11 03:32:47
@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
2010-06-04 00:57:30
+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
2010-02-11 03:20:47
+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
2010-02-11 03:30:54
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
2010-02-11 03:58:36