Skip to content

Commit 0264375

Browse files
committed
Fix indenting and add .editorconfig
1 parent f724dd6 commit 0264375

File tree

2 files changed

+88
-74
lines changed

2 files changed

+88
-74
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 4

Gruntfile.js

+77-74
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,85 @@
11
/*global module:false*/
22
module.exports = function(grunt) {
33

4-
// Project configuration.
5-
grunt.initConfig({
6-
// Metadata.
7-
pkg: grunt.file.readJSON('package.json'),
8-
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9-
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
10-
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
11-
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12-
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
13-
// Task configuration.
14-
concat: {
15-
options: {
16-
banner: '<%= banner %>',
17-
stripBanners: true
18-
},
19-
dist: {
20-
src: ['lib/<%= pkg.name %>.js'],
21-
dest: 'dist/<%= pkg.name %>.js'
22-
}
23-
},
24-
uglify: {
25-
options: {
26-
banner: '<%= banner %>'
27-
},
28-
dist: {
29-
src: '<%= concat.dist.dest %>',
30-
dest: 'dist/<%= pkg.name %>.min.js'
31-
}
32-
},
33-
jshint: {
34-
options: {
35-
curly: true,
36-
eqeqeq: true,
37-
immed: true,
38-
latedef: true,
39-
newcap: true,
40-
noarg: true,
41-
sub: true,
42-
undef: true,
43-
unused: true,
44-
boss: true,
45-
eqnull: true,
46-
globals: {
47-
jQuery: true
4+
// Project configuration.
5+
grunt.initConfig({
6+
// Metadata.
7+
pkg: grunt.file.readJSON('package.json'),
8+
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
10+
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
11+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12+
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
13+
// Task configuration.
14+
concat: {
15+
options: {
16+
banner: '<%= banner %>',
17+
stripBanners: true
18+
},
19+
dist: {
20+
src: ['lib/<%= pkg.name %>.js'],
21+
dest: 'dist/<%= pkg.name %>.js'
22+
}
23+
},
24+
uglify: {
25+
options: {
26+
banner: '<%= banner %>'
27+
},
28+
dist: {
29+
src: '<%= concat.dist.dest %>',
30+
dest: 'dist/<%= pkg.name %>.min.js'
31+
}
32+
},
33+
jshint: {
34+
options: {
35+
curly: true,
36+
eqeqeq: true,
37+
immed: true,
38+
latedef: true,
39+
newcap: true,
40+
noarg: true,
41+
sub: true,
42+
undef: true,
43+
unused: true,
44+
boss: true,
45+
eqnull: true,
46+
globals: {
47+
jQuery: true
48+
}
49+
},
50+
gruntfile: {
51+
src: 'Gruntfile.js'
52+
},
53+
all: {
54+
src: ['src/**/*.js']
55+
},
56+
tests: {
57+
src: ['lib/**/*.js', 'test/**/*.js']
58+
}
59+
},
60+
watch: {
61+
gruntfile: {
62+
files: '<%= jshint.gruntfile.src %>',
63+
tasks: ['jshint:gruntfile']
64+
},
65+
src: {
66+
files: '<%= jshint.all.src %>',
67+
tasks: ['jshint:all']
68+
},
69+
lib_test: {
70+
files: '<%= jshint.tests.src %>',
71+
tasks: ['jshint:tests']
72+
}
4873
}
49-
},
50-
gruntfile: {
51-
src: 'Gruntfile.js'
52-
},
53-
lib_test: {
54-
src: ['lib/**/*.js', 'test/**/*.js']
55-
}
56-
},
57-
nodeunit: {
58-
files: ['test/**/*_test.js']
59-
},
60-
watch: {
61-
gruntfile: {
62-
files: '<%= jshint.gruntfile.src %>',
63-
tasks: ['jshint:gruntfile']
64-
},
65-
lib_test: {
66-
files: '<%= jshint.lib_test.src %>',
67-
tasks: ['jshint:lib_test', 'nodeunit']
68-
}
69-
}
70-
});
74+
});
7175

72-
// These plugins provide necessary tasks.
73-
grunt.loadNpmTasks('grunt-contrib-concat');
74-
grunt.loadNpmTasks('grunt-contrib-uglify');
75-
grunt.loadNpmTasks('grunt-contrib-nodeunit');
76-
grunt.loadNpmTasks('grunt-contrib-jshint');
77-
grunt.loadNpmTasks('grunt-contrib-watch');
76+
// These plugins provide necessary tasks.
77+
grunt.loadNpmTasks('grunt-contrib-concat');
78+
grunt.loadNpmTasks('grunt-contrib-uglify');
79+
grunt.loadNpmTasks('grunt-contrib-jshint');
80+
grunt.loadNpmTasks('grunt-contrib-watch');
7881

79-
// Default task.
80-
grunt.registerTask('default', ['jshint', 'nodeunit', 'concat', 'uglify']);
82+
// Default task.
83+
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
8184

8285
};

0 commit comments

Comments
 (0)