Install the tool with:
npm install -g cordova-linter
Then lint a project with:
Things The Linter Flags
- absolute paths in
- protocol-less paths in
- omission of a script tag loading cordova.js
I'll be doing these as I get a chance, but you should totally fork the project and implement these yourself, yo.
- Find potentially problematic uses of load event when deviceReady is what is really needed.
- Issue #1: Flag techniques used to trigger deviceReady in the browser for testing if they should be removed from a production build.
- Detect CSS transitions that would benefit from hardware acceleration via the
- Detect use of click event handlers without FastClick loaded
- Detect loading of
- Detect when an app isn't a single-page app? Or is that overkill? I mean, that's not really a lint thing, that's a whole app architecture thing.
- What else?
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2013 Rich Trott Licensed under the Apache 2.0 license.