Skip to content
Permalink
Browse files

Build: Add jscs for checking any js files for style

  • Loading branch information
arschmitz committed Nov 28, 2014
1 parent 8ef5494 commit b4e714b3de6493d9916d17e946f7d0dc8c0373f9
Showing with 9 additions and 4 deletions.
  1. +3 −0 .jscsrc
  2. +4 −3 Gruntfile.js
  3. +2 −1 package.json
@@ -0,0 +1,3 @@
{
"preset": "jquery"
}
@@ -2,6 +2,7 @@ module.exports = function( grunt ) {

grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-jscs" );

This comment has been minimized.

Copy link
@arthurvr

arthurvr Dec 10, 2014

Member

Does not make that much sense at this point, but why don't you go for grunt-load-tasks? Similar to https://github.com/jquery/jquery/blob/master/Gruntfile.js#L153

This comment has been minimized.

Copy link
@scottgonzalez

scottgonzalez Dec 10, 2014

Member

That saves us one line per grunt module at the cost of adding another dependency (which itself adds another dependency). I've never thought load-grunt-tasks made sense.

This comment has been minimized.

Copy link
@arthurvr

arthurvr Dec 10, 2014

Member

It will save effort and pain in the future. Also, it just keeps the file clean 🎉. But as I've said, doesn't make that much sense at the time.


grunt.initConfig({
jshint: {
@@ -10,8 +11,8 @@ grunt.initConfig({
jshintrc: ".jshintrc"
}
},
htmllint: {
all: [ "*.html", "demos/*.html" ]
jscs: {
all: [ "*.js" ]
}
});

@@ -32,6 +33,6 @@ grunt.registerTask( "update-authors", function() {
});
});

grunt.registerTask( "default", "jshint", "htmllint" );
grunt.registerTask( "default", [ "jshint", "jscs" ] );

};
@@ -41,7 +41,8 @@
"commitplease": "2.0.0",
"grunt": "0.4.2",
"grunt-contrib-jshint": "0.10.0",
"grunt-git-authors": "2.0.0"
"grunt-git-authors": "2.0.0",
"grunt-jscs": "0.6.2"
},
"keywords": []
}

0 comments on commit b4e714b

Please sign in to comment.
You can’t perform that action at this time.