Skip to content

Commit

Permalink
Updating jquery init template.
Browse files Browse the repository at this point in the history
* Removed in file JSHint comments in favor of .jshintrc files.
* Better parameterized watch task.
* Added .gitignore for node_modules folder.
  • Loading branch information
cowboy committed Jul 26, 2012
1 parent b6825d7 commit aa055c3
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 24 deletions.
1 change: 1 addition & 0 deletions tasks/init/jquery/root/.gitignore
@@ -0,0 +1 @@
/node_modules/
14 changes: 14 additions & 0 deletions tasks/init/jquery/root/.jshintrc
@@ -0,0 +1,14 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"node": true,
"es5": true
}
50 changes: 30 additions & 20 deletions tasks/init/jquery/root/Gruntfile.js
@@ -1,4 +1,5 @@
/*global module:false*/ 'use strict';

module.exports = function(grunt) { module.exports = function(grunt) {


// Project configuration. // Project configuration.
Expand All @@ -25,29 +26,38 @@ module.exports = function(grunt) {
files: ['test/**/*.html'] files: ['test/**/*.html']
}, },
lint: { lint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], gruntfile: {
options: {
options: { options: {
curly: true, jshintrc: '.jshintrc'
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
}, },
globals: { src: 'Gruntfile.js'
jQuery: true },
} src: {
} options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
}, },
watch: { watch: {
files: '<config:lint.files>', gruntfile: {
tasks: ['lint', 'qunit'] files: '<config:lint.gruntfile.src>',
tasks: ['lint:gruntfile']
},
src: {
files: '<config:lint.src.src>',
tasks: ['lint:src', 'qunit']
},
test: {
files: '<config:lint.test.src>',
tasks: ['lint:test', 'qunit']
},
} }
}); });


Expand Down
14 changes: 14 additions & 0 deletions tasks/init/jquery/root/src/.jshintrc
@@ -0,0 +1,14 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"browser": true,
"predef": ["jQuery"]
}
31 changes: 31 additions & 0 deletions tasks/init/jquery/root/test/.jshintrc
@@ -0,0 +1,31 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"browser": true,
"predef": [
"jQuery",
"QUnit",
"module",
"test",
"asyncTest",
"expect",
"start",
"stop",
"ok",
"equal",
"notEqual",
"deepEqual",
"notDeepEqual",
"strictEqual",
"notStrictEqual",
"raises"
]
}
4 changes: 0 additions & 4 deletions tasks/init/jquery/root/test/name_test.js
@@ -1,8 +1,4 @@
/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function($) { (function($) {

/* /*
======== A Handy Little QUnit Reference ======== ======== A Handy Little QUnit Reference ========
http://docs.jquery.com/QUnit http://docs.jquery.com/QUnit
Expand Down

0 comments on commit aa055c3

Please sign in to comment.