forked from web-scrobbler/web-scrobbler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
67 lines (61 loc) · 1.52 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
/* global module, require */
module.exports = function(grunt) {
var jsConnectorFiles = ['connectors/v2/*.js', 'connectors/22tracks.js']; // intentionally does not contain all files yet
var jsCoreFiles = ['Gruntfile.js', 'core/**/*.js', 'options/options.js', 'popups/*.js'];
var jsonFiles = ['*.json', '.jshintrc'];
var htmlFiles = ['options/*.html', 'popups/*.html', 'dialogs/**/*.html'];
var cssFiles = ['options/options.css', 'popups/base.css', 'dialogs/base.css'];
grunt.initConfig({
jshint: {
all: [jsCoreFiles, jsConnectorFiles],
options: {
jshintrc: true,
reporter: require('jshint-stylish')
}
},
compress: {
main: {
options: {
archive: 'web-scrobbler.zip',
pretty: true
},
expand: true,
src: ['*.*', 'connectors/**', 'options/**', 'vendor/**']
}
},
lintspaces: {
all: {
src: [
jsCoreFiles, jsConnectorFiles, cssFiles, htmlFiles
],
options: {
editorconfig: '.editorconfig',
ignores: [
'js-comments'
]
}
}
},
jsonlint: {
sample: {
src: [ jsonFiles ]
}
},
csslint: {
options: {
csslintrc: '.csslintrc'
},
strict: {
src: [cssFiles]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-lintspaces');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.registerTask('lint', ['jshint', 'csslint']);
grunt.registerTask('default', ['lint', 'lintspaces', 'jsonlint']);
};