Catching dangling commas in Aptana

Aptana can be configured to catch one of the most common Javascript programming errors: the dreaded “dangling comma”, an extra comma left trailing after the last property in an object literal. This problem can be fiendishly difficult to spot, particularly if you have a complex, nested arrangement of object literals.

Aptana can point you at these bugs right there in your source editor. To set this up, go to the Window menu and select Preferences, then navigate to Aptana -> Editors -> Javascript -> Validation. Your screen now looks like this:

Ensure that the “JSLint Javascript Validator” box is checked. And that’s it – dangling commas will now be reported as you type, like this: