Skip to content

Commit

Permalink
Add Gruntfile, strict mode, fixes for jshint - shouldn't break anythi…
Browse files Browse the repository at this point in the history
…ng, but test properly
  • Loading branch information
Rycochet committed Aug 13, 2016
1 parent efe5795 commit c3b9f01
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 113 deletions.
45 changes: 45 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['velocity.js', 'velocity.ui.js'],
options: {
browser: true,
curly: true,
eqeqeq: true,
eqnull: true,
esversion: 3, // Velocity 1.*
forin: false, // Should really be true
freeze: true,
funcscope: true,
futurehostile: true,
loopfunc: true, // Velocity 1.*
nocomma: true,
nonbsp: true,
notypeof: true,
strict: true,
globals: {
jQuery: true
}
}
},
uglify: {
my_target: {
options: {
preserveComments: /^!/,
screwIE8: false // Velocity 1.*
},
files: {
'velocity.min.js': ['velocity.js'],
'velocity.ui.min.js': ['velocity.ui.js']
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('default', ['jshint', 'uglify']);
};
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "velocity-animate",
"version": "1.2.3",
"version": "1.3.0",
"description": "Accelerated JavaScript animation.",
"keywords": [
"velocity",
Expand All @@ -21,6 +21,10 @@
{
"name": "Julian Shapiro",
"url": "http://julian.com/"
},
{
"name": "Ryc O'Chet",
"url": "https://github.com/Rycochet"
}
],
"main": "velocity.js",
Expand All @@ -32,11 +36,8 @@
"velocity.ui.min.js"
],
"devDependencies": {
"grunt": "^0.4.4",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-requirejs": "~0.4.4",
"grunt-contrib-uglify": "~0.2.2"
"grunt": "^1.0.1",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~2.0.0"
}
}
Loading

1 comment on commit c3b9f01

@julianshapiro
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

Please sign in to comment.