views:

100

answers:

2

How best does the developer who's decided he likes semicolons at the end of his Javascript statements enforce that expectation technically for himself?

I'm using Visual Studio (ASP.NET webapps), but I'd love to hear about solutions for any environment.

+2  A: 

You could somehow integrate Javascript Lint into the IDE.

kgiannakakis
Or JSLint: http://www.jslint.com/
Roman Nurik
I didn't know about JSLint. Thank you. This gets me close to what I wanted.
lance
A: 

I sometimes run my JS through a handler that strips all new lines, comments, tabs, and extra whitespace automatically. If my JS statements don't end with a semi-colon I'll get an error (in most cases)...doing it this way is a PAIN to debug though (e.g., error on line 1 character 2654).

The other way I use is Firebug + YSlow. You can check it's built in JSLint every once in a while.

Maybe there is a file in Visual Studio for checking javascript syntax you may be able to modify like there is for (X)HTML and XML.

David Murdoch
How/where does Firebug/YSlow report on this?
lance