2015-05-02 03:31:16 +00:00
|
|
|
|
/*jshint node:true */
|
|
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2015-06-12 04:32:18 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-jscs' );
|
2016-10-05 00:11:41 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
|
jshint: {
|
|
|
|
|
options: {
|
2015-10-31 12:35:06 +00:00
|
|
|
|
jshintrc: true,
|
|
|
|
|
ignores: [
|
|
|
|
|
'tests/externals/**'
|
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
|
},
|
|
|
|
|
all: [
|
2015-10-31 12:35:06 +00:00
|
|
|
|
'**/*.js',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!node_modules/**',
|
|
|
|
|
'!docs/**'
|
2015-05-02 03:31:16 +00:00
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
jscs: {
|
2015-10-31 12:35:06 +00:00
|
|
|
|
src: [
|
|
|
|
|
'<%= jshint.all %>',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!tests/externals/**',
|
|
|
|
|
'!docs/**'
|
2015-10-31 12:35:06 +00:00
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
|
},
|
2016-10-05 00:11:41 +00:00
|
|
|
|
// Lint – Styling
|
|
|
|
|
stylelint: {
|
|
|
|
|
options: {
|
|
|
|
|
syntax: 'less'
|
|
|
|
|
},
|
|
|
|
|
all: [
|
|
|
|
|
'modules/**/*.css',
|
|
|
|
|
'modules/**/*.less'
|
|
|
|
|
]
|
|
|
|
|
},
|
2015-05-02 03:31:16 +00:00
|
|
|
|
banana: {
|
|
|
|
|
all: 'i18n/'
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
files: [
|
|
|
|
|
'.{csslintrc,jscsrc,jshintignore,jshintrc}',
|
|
|
|
|
'<%= jshint.all %>',
|
|
|
|
|
'<%= csslint.all %>'
|
|
|
|
|
],
|
|
|
|
|
tasks: 'test'
|
2015-06-12 04:32:18 +00:00
|
|
|
|
},
|
|
|
|
|
jsonlint: {
|
|
|
|
|
all: [
|
|
|
|
|
'**/*.json',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!node_modules/**',
|
|
|
|
|
'!docs/**'
|
2015-06-12 04:32:18 +00:00
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
|
2016-10-05 00:11:41 +00:00
|
|
|
|
grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'stylelint', 'jsonlint', 'banana' ] );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
grunt.registerTask( 'test', 'lint' );
|
|
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
|
};
|