Add grunt-contrib-jshint to npm

Change-Id: I6bcf5c2b98e918f675181c2fe283416f07cce982
This commit is contained in:
Paladox 2016-01-19 22:21:07 +00:00 committed by Florianschmidtwelzow
parent a161c3122c
commit 41b9f5d2e7
6 changed files with 48 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
.svn
*~
*.kate-swp
.*.swp
node_modules/
vendor/

View file

@ -1 +1,3 @@
modules/qrcode.js
node_modules/**
vendor/**

View file

@ -1 +1,25 @@
{}
{
// Enforcing
"bitwise": true,
"eqeqeq": true,
"freeze": true,
"latedef": true,
"noarg": true,
"nonew": true,
"undef": true,
"unused": true,
"strict": false,
// Relaxing
"es5": false,
// Environment
"browser": true,
"jquery": true,
"globals": {
"mediaWiki": false,
"QRCode": false,
"QRErrorCorrectLevel": false
}
}

View file

@ -1,9 +1,20 @@
/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.initConfig( {
jshint: {
options: {
jshintrc: true
},
all: [
'**/*.js',
'!modules/qrcode.js',
'!node_modules/**'
]
},
banana: {
all: 'i18n/'
},
@ -15,6 +26,6 @@ module.exports = function ( grunt ) {
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -1,7 +1,7 @@
(function( $ ){
$.fn.qrcode = function(options) {
( function ( $ ) {
$.fn.qrcode = function ( options ) {
// if options is string,
if( typeof options === 'string' ){
if ( typeof options === 'string' ){
options = { text: options };
}
@ -81,8 +81,8 @@
};
return this.each(function(){
var element = options.render == "canvas" ? createCanvas() : createTable();
jQuery(element).appendTo(this);
});
var element = options.render === "canvas" ? createCanvas() : createTable();
$(element).appendTo(this);
} );
};
})( jQuery );
}( jQuery ) );

View file

@ -6,6 +6,7 @@
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-jshint": "0.12.0",
"grunt-banana-checker": "0.4.0",
"grunt-jsonlint": "1.0.7"
}