Skip to content

Instantly share code, notes, and snippets.

@ctoestreich
Last active December 16, 2015 09:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctoestreich/5413680 to your computer and use it in GitHub Desktop.
Save ctoestreich/5413680 to your computer and use it in GitHub Desktop.
Gruntfile coffeescript
gruntFunction = (grunt) ->
gruntConfig =
coffee:
app:
src: ["js/**/*.coffee"]
options:
bare: true
preserve_dirs: true
testjs:
src: ["test-js/**/*.coffee"]
options:
bare: true
preserve_dirs: true
watch:
files: ["<config:coffee.app.src>", "<config:coffee.testjs.src>"]
tasks: ["coffee:app", "coffee:testjs"]
coffeeLint:
app:
src: "<config:coffee.app.src>"
indentation:
value: 2
level: "warn"
no_trailing_whitespace:
level: "error"
no_trailing_semicolons:
level: "error"
no_plusplus:
level: "warn"
no_implicit_parens:
level: "ignore"
max_line_length:
level: "ignore"
testjs:
src: "<config:coffee.testjs.src>"
indentation:
value: 2
level: "warn"
no_trailing_whitespace:
level: "error"
no_trailing_semicolons:
level: "error"
no_plusplus:
level: "warn"
no_implicit_parens:
level: "ignore"
max_line_length:
level: "ignore"
grunt.initConfig gruntConfig
grunt.loadNpmTasks 'grunt-hustler'
grunt.loadTasks 'tasks'
grunt.registerTask 'default', 'coffee watch'
grunt.registerTask 'cw', 'coffee watch'
grunt.registerTask 'c', 'coffee'
grunt.registerTask 'lint', 'coffeeLint'
null
#debug : call with a dummy 'grunt', that spits params on console.log
#gruntFunction
# initConfig: (cfg)-> console.log 'grunt: initConfig\n', JSON.stringify cfg, null, ' '
# loadNpmTasks: (tsk)-> console.log 'grunt: registerTask: ', tsk
# registerTask: (shortCut, task)-> console.log 'grunt: registerTask:', shortCut, task
module.exports = gruntFunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment