build: Clean up Gruntfile
* Sort jshintrc a-z and section it.
* Remove grunt.js from jshintignore (file no longer exists).
* Simplify jshint config by using globstar. The jshintignore
file still applies (to skip jquery.uls.data.js).
* Update jshint config to also validate Gruntfile.js
* Update listed dependency on 'grunt' and 'grunt-cli' to the
versions they currently expand to already. We don't know if
we're compatible with older versions. '^x.y' means, equal or
higher (within the same major release). Similar to '~x.y',
except that tilde tolerates older versions.
* Update grunt-contrib-jshint and grunt-contrib-qunit to their
latest versions.
* Remove obsolete jshintrc parsing hack, use built-in 'jshintrc'
option as of v0.8.0.
* Remove unused 'pgk' property in grunt config.
* Remove unused grunt-contrib-jasmine and grunt-contrib-copy
from devDependencies (unused as of ab9b01444f).
This commit is contained in:
@@ -1,2 +1 @@
|
|||||||
grunt.js
|
src/jquery.uls.data.js
|
||||||
src\jquery.uls.data.js
|
|
||||||
|
|||||||
18
.jshintrc
18
.jshintrc
@@ -1,26 +1,32 @@
|
|||||||
{
|
{
|
||||||
|
// Enforcing
|
||||||
|
"bitwise": true,
|
||||||
"camelcase": true,
|
"camelcase": true,
|
||||||
"curly": true,
|
"curly": true,
|
||||||
"eqeqeq": true,
|
"eqeqeq": true,
|
||||||
|
"forin": false,
|
||||||
"immed": true,
|
"immed": true,
|
||||||
"latedef": true,
|
"latedef": true,
|
||||||
"newcap": true,
|
"newcap": true,
|
||||||
"noarg": true,
|
"noarg": true,
|
||||||
"noempty": true,
|
"noempty": true,
|
||||||
"nonew": true,
|
"nonew": true,
|
||||||
|
"onevar": true,
|
||||||
"quotmark": "single",
|
"quotmark": "single",
|
||||||
|
"regexp": false,
|
||||||
|
"strict": true,
|
||||||
"trailing": true,
|
"trailing": true,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": true,
|
||||||
"onevar": true,
|
|
||||||
"bitwise": true,
|
// Relax
|
||||||
"forin": false,
|
|
||||||
"regexp": false,
|
|
||||||
"strict": true,
|
|
||||||
"laxbreak": true,
|
"laxbreak": true,
|
||||||
"smarttabs": true,
|
|
||||||
"multistr": true,
|
"multistr": true,
|
||||||
|
"smarttabs": true,
|
||||||
|
|
||||||
|
// Environment
|
||||||
"browser": true,
|
"browser": true,
|
||||||
|
|
||||||
"predef": [
|
"predef": [
|
||||||
"_",
|
"_",
|
||||||
"jQuery",
|
"jQuery",
|
||||||
|
|||||||
28
Gruntfile.js
28
Gruntfile.js
@@ -1,32 +1,22 @@
|
|||||||
/*!
|
|
||||||
* Grunt file
|
|
||||||
*
|
|
||||||
* @package jquery.i18n
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
/*jshint node:true */
|
/*jshint node:true */
|
||||||
|
'use strict';
|
||||||
module.exports = function ( grunt ) {
|
module.exports = function ( grunt ) {
|
||||||
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
||||||
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
|
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
|
||||||
|
|
||||||
grunt.initConfig( {
|
grunt.initConfig( {
|
||||||
pkg: grunt.file.readJSON( 'package.json' ),
|
|
||||||
jshint: {
|
jshint: {
|
||||||
options: JSON.parse( grunt.file.read( '.jshintrc' )
|
options: {
|
||||||
.replace( /\/\*(?:(?!\*\/)[\s\S])*\*\//g, '' ).replace( /\/\/[^\n\r]*/g, '' ) ),
|
jshintrc: true
|
||||||
all: ['src/jquery.uls.core.js',
|
},
|
||||||
'src/jquery.uls.lcd.js',
|
all: ['*.js', 'src/*.js']
|
||||||
'src/jquery.uls.data.utils.js',
|
|
||||||
'src/jquery.uls.languagefilter.js',
|
|
||||||
'src/jquery.uls.regionfilter.js' ]
|
|
||||||
},
|
},
|
||||||
qunit: {
|
qunit: {
|
||||||
all: ['test/index.html']
|
all: 'test/index.html'
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
grunt.registerTask( 'lint', ['jshint'] );
|
grunt.registerTask( 'lint', 'jshint' );
|
||||||
grunt.registerTask( 'unit', ['qunit'] );
|
grunt.registerTask( 'test', ['lint', 'qunit'] );
|
||||||
grunt.registerTask( 'test', ['lint', 'unit'] );
|
grunt.registerTask( 'default', 'test' );
|
||||||
grunt.registerTask( 'default', ['test'] );
|
|
||||||
};
|
};
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -25,12 +25,10 @@
|
|||||||
"Siebrand Mazeland"
|
"Siebrand Mazeland"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.1",
|
"grunt": "^0.4.5",
|
||||||
"grunt-cli": "~0.1",
|
"grunt-cli": "^0.1.13",
|
||||||
"grunt-contrib-jshint": "~0.5.4",
|
"grunt-contrib-jshint": "^0.8.0",
|
||||||
"grunt-contrib-qunit": "~0.2.1",
|
"grunt-contrib-qunit": "^0.5.2"
|
||||||
"grunt-contrib-jasmine": "~0.4",
|
|
||||||
"grunt-contrib-copy": ">0.0.0"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user