User:Legoktm/templatized Gruntfile dot js

From MediaWiki.org
Jump to navigation Jump to search

Gruntfile.js is arbitrary JavaScript, meaning that programmatically adding new grunt checks (e.g. jshint/jscs) to existing gruntfiles is very difficult.

With a few exceptions, most extensions will want to have banana-checker, jsonlint, and if they have JavaScript, jshint and jscs. Here's what I propose:

  • We create copies of Gruntfiles that contain the combinations we support (jsonlint-only, jsonlint+banana-checker, jsonlint+banana-checker+jshint, jsonlint+banana-checker+jshint+jscs, etc.)
  • Each copy has an easily readable comment at the top like # jsonlint, banana, jshint, jscs that indicates which template is in use.
  • Develop a script that allows swapping between templates, and manages updating package.json.
  •  ???
  • Win!