Skip to content

Commit

Permalink
Update Grunt tasks, add .editorconfig and .jshintrc configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
i-like-robots committed Apr 24, 2014
1 parent dfa2a63 commit 83fa585
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 49 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{*.js, *.json}]
indent_style = space
indent_size = 4

[*.css]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
36 changes: 36 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// strict
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": false,
"freeze": false,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": false,
"plusplus": false,
"quotmark": true,
"undef": true,
"strict": true,
"trailing": true,
"maxparams": 4,
"maxdepth": 5,
"maxstatements": 20,
"maxlen": 120,

// environment
"browser": true,

// globals
"globals": {
"jQuery": true,
"module": true,
"define": false
}
}
74 changes: 32 additions & 42 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,38 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('image-zoom.jquery.json'),
uglify: {
options: {
banner: [
'/*!',
' * @name <%= pkg.name %>',
' * @author <%= pkg.author.name %> <<%= pkg.author.url %>>',
' * @modified <%= grunt.template.today("dddd, mmmm dS, yyyy") %>',
' * @version <%= pkg.version %>',
' */'
].join('\n')
},
dist: {
files: [
{
src: 'src/easyzoom.js',
dest: 'dist/easyzoom.js'
}
]
}
},
jshint: {
all: ['src/**/*.js'],
options: {
maxdepth: 4,
curly: true,
newcap: true,
eqeqeq: true,
browser: true,
trailing: true,
globals: {
jquery: true,
define: false,
exports: true
grunt.initConfig({
pkg: grunt.file.readJSON('image-zoom.jquery.json'),
uglify: {
options: {
banner: [
'/*!',
' * @name <%= pkg.name %>',
' * @author <%= pkg.author.name %> <<%= pkg.author.url %>>',
' * @modified <%= grunt.template.today("dddd, mmmm dS, yyyy") %>',
' * @version <%= pkg.version %>',
' */'
].join('\n')
},
dist: {
files: [
{
src: 'src/easyzoom.js',
dest: 'dist/easyzoom.js'
}
]
}
},
jshint: {
all: ['src/**/*.js'],
options: {
jshintrc: true
}
}
}
}
});
});

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

grunt.registerTask('default', ['jshint', 'uglify']);
grunt.registerTask('default', ['jshint', 'uglify']);

};
};
6 changes: 3 additions & 3 deletions dist/easyzoom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.1.0",
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-jshint": "0.1.x",
"grunt-contrib-uglify": "0.2.x"
"grunt-contrib-jshint": "0.9.x",
"grunt-contrib-uglify": "0.4.x"
}
}
}
4 changes: 3 additions & 1 deletion src/easyzoom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(function ($) {
(function ($) {

'use strict';

var dw, dh, rw, rh, lx, ly;

Expand Down

0 comments on commit 83fa585

Please sign in to comment.