MDS 1.2 Released - Now with JSLint/JSHint

posted Feb 22, 2011, 8:48 AM by Paul Beusterien   [ updated Feb 23, 2011, 9:08 AM ]
The MDS 1.2 Eclipse plugin for developing Web Apps with PhoneGap for Android released today. MDS now includes a JSLint integration to help developers follow the practices recommended by "JavaScript - the Good Parts" by Douglas Crockford.

Download
Install to an Eclipse Helios with the Android Development Tools with Help -> Install New Software -> http://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download. Complete installation instructions here.

Release Highlights
  • JSLint (tempered with JSHint-like additions) built in
  • PhoneGap 0.9.4 is now built in
    • It's no longer required to download PhoneGap separately
  • Support for all Eclipse Helios variations (Classic or Java still recommended)
  • JSDT parsing bug fixes and usability improvements
  • Example projects now include map and networking samples
  • Full defect and enhancement list here
Using JSLint
  • Right click on a project in the left-side project view
  • Select enable jslint4java
  • Select Project -> Clean
  • View updated results in Problems view on bottom
    • If not visible, Window -> Show View -> Problems
  • View results in any JavaScript file while editing and clicking on yellow markers on right
  • Configure JSLint with Preferences -> jslint4java
    • Choose Options
    • Disable JSLint on directories or files in bottom right of Preferences
    • Do Project -> Clean for new preferences to take effect
JSHint

To better support progressive enhancement and working with legacy code, the MDS tools follow JSHint's mellow philosophy.  JSLint's more rigid approach is achievable with options. Currently the nonew option comes from JSHint. More are likely to follow. Create and vote on enhancement requests.  MDS 1.2 provides five extensions to JSLint:
  • Option to disable === requirement
  • Option to disable curly brace requirement for one-line blocks
  • Option to disable semicolon requirement
  • Option to allow var declarations in 'for' initializers
  • Option to allow side-effects from 'new'

JSLint Preferences Screen Shot (click to expand)


Acknowledgements
Links
Comments