Browse Source

+ jshint

pull/126/merge
RubaXa 10 years ago
parent
commit
48aa1fc3b4
  1. 41
      Gruntfile.js
  2. 1
      package.json

41
Gruntfile.js

@ -1,6 +1,6 @@
'use strict';
module.exports = function (grunt) {
'use strict';
module.exports = function (grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@ -8,24 +8,53 @@ module.exports = function (grunt){
src: ['<%= pkg.exportName %>.js', '*.json']
},
jshint: {
all: ['*.js', '!*.min.js'],
options: {
strict: true,
newcap: false, // "Tolerate uncapitalized constructors"
node: true,
expr: true, // - true && call() "Expected an assignment or function call and instead saw an expression."
supernew: true, // - "Missing '()' invoking a constructor."
laxbreak: true,
white: true,
globals: {
define: true,
test: true,
expect: true,
module: true,
asyncTest: true,
start: true,
ok: true,
equal: true,
notEqual: true,
deepEqual: true,
window: true,
document: true,
performance: true
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.exportName %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n'
},
dist: {
files: {
'<%= pkg.exportName %>.min.js': ['<%= pkg.exportName %>.js']
'<%= pkg.exportName %>.min.js': ['<%= pkg.exportName %>.js']
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-version');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task.
grunt.registerTask('default', ['version', 'uglify']);
grunt.registerTask('tests', ['jshint']);
grunt.registerTask('default', ['tests', 'version', 'uglify']);
};

1
package.json

@ -5,6 +5,7 @@
"devDependencies": {
"grunt": "*",
"grunt-version": "*",
"grunt-contrib-jshint": "0.9.2",
"grunt-contrib-uglify": "*"
},
"description": "Minimalist library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery.",

Loading…
Cancel
Save