Skip to content

Commit

Permalink
- Corrected several of JSHint errors/warnings
Browse files Browse the repository at this point in the history
- Added JSCS code style validation.
- Corrected hundreds of JSCS warnings.
- Fixed unwanted global variables.
- Fixed closeAll method not working at all.

-Version bump
  • Loading branch information
ceilino committed Jun 2, 2015
1 parent 1f20dc5 commit 02c22a0
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 236 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="1.1.2"></a>

# 1.1.2 (2015-01-June)

- Corrected hundreds of JSHint errors/warnings
- Added JSCS code style validation.
- Corrected hundreds of JSCS warnings.
- Fixed unwanted global variables.
- Fixed closeAll method not working at all.

<a name="1.1.1"></a>

# 1.1.1 (2015-01-June)
Expand Down
144 changes: 78 additions & 66 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,79 +1,91 @@
module.exports = function(grunt) {
module.exports = function (grunt) {

grunt.initConfig({
grunt.initConfig({

// Import package manifest
pkg: grunt.file.readJSON("package.json"),
// Import package manifest
pkg: grunt.file.readJSON('package.json'),

// Banner definitions
meta: {
banner: "/*\n" +
" * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" +
" * <%= pkg.description %>\n" +
" * <%= pkg.homepage %>\n" +
" *\n" +
" * Made by <%= pkg.author.name %>\n" +
" * Under <%= pkg.license %> License\n" +
" */\n"
},
// Banner definitions
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Made by <%= pkg.author.name %>\n' +
' * Under <%= pkg.license %> License\n' +
' */\n'
},

// Concat definitions
concat: {
options: {
banner: "<%= meta.banner %>"
},
dist: {
src: ["src/jquery.ez-plus.js"],
dest: "dist/jquery.ez-plus.js"
}
},
// Concat definitions
concat: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
src: ['src/jquery.ez-plus.js'],
dest: 'dist/jquery.ez-plus.js'
}
},

// Lint definitions
jshint: {
files: ["src/jquery.ez-plus.js"],
options: {
jshintrc: ".jshintrc"
}
},
// Lint definitions
jshint: {
files: ['src/jquery.ez-plus.js'],
options: {
jshintrc: '.jshintrc'
}
},

// Minify definitions
uglify: {
my_target: {
src: ["dist/jquery.ez-plus"],
dest: "dist/jquery.ez-plus.min.js"
},
options: {
banner: "<%= meta.banner %>"
}
},
// JSCS definitions
jscs: {
src: 'src/*.js',
options: {
config: '.jscsrc',
esnext: true, // If you use ES6 http://jscs.info/overview.html#esnext
verbose: true, // If you need output with rule names http://jscs.info/overview.html#verbose
requireCurlyBraces: ['if']
}
},

// CoffeeScript compilation
coffee: {
compile: {
files: {
"dist/jquery.ez-plus.js": "src/jquery.ez-plus.coffee"
}
}
},
// Minify definitions
uglify: {
my_target: {
src: ['dist/jquery.ez-plus'],
dest: 'dist/jquery.ez-plus.min.js'
},
options: {
banner: '<%= meta.banner %>'
}
},

// watch for changes to source
// Better than calling grunt a million times
// (call 'grunt watch')
watch: {
files: ['src/*'],
tasks: ['default']
}
// CoffeeScript compilation
coffee: {
compile: {
files: {
'dist/jquery.ez-plus.js': 'src/jquery.ez-plus.coffee'
}
}
},

});
// watch for changes to source
// Better than calling grunt a million times
// (call 'grunt watch')
watch: {
files: ['src/*'],
tasks: ['default']
}

grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-coffee");
grunt.loadNpmTasks("grunt-contrib-watch");
});

grunt.registerTask("build", ["concat", "uglify"]);
grunt.registerTask("default", ["jshint", "build"]);
grunt.registerTask("travis", ["default"]);
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('default', ['jshint', 'jscs', 'build']);
grunt.registerTask('travis', ['default']);

};
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ez-plus",
"title": "EZ Plus",
"version": "1.1.1",
"version": "1.1.2",
"description": "A jQuery image zoom plug-in, with tints, easing and gallery integration.",
"author": {
"name": "Igor Lino",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ez-plus",
"title": "EZ Plus",
"version": "1.1.1",
"version": "1.1.2",
"description": "A jQuery image zoom plug-in, with tints, easing and gallery integration.",
"keywords": [
"zoom",
Expand Down Expand Up @@ -39,7 +39,8 @@
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1"
"grunt-contrib-watch": "^0.6.1",
"grunt-jscs": "^1.8.0"
},
"scripts": {
"test": "grunt travis --verbose"
Expand Down
Loading

0 comments on commit 02c22a0

Please sign in to comment.