2017-04-11 02:30:17 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
var conf = grunt.file.readJSON( 'skin.json' );
|
|
|
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-notify' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
eslint: {
|
2018-09-13 15:39:05 +00:00
|
|
|
options: {
|
|
|
|
cache: true,
|
2019-05-06 20:52:00 +00:00
|
|
|
extensions: [ '.js', '.json' ],
|
2018-09-13 15:39:05 +00:00
|
|
|
maxWarnings: 0,
|
|
|
|
reportUnusedDisableDirectives: true
|
|
|
|
},
|
2017-04-11 02:30:17 +00:00
|
|
|
all: [
|
2019-05-06 20:52:00 +00:00
|
|
|
'**/*.js{,on}',
|
2017-04-11 02:30:17 +00:00
|
|
|
'!docs/**',
|
2017-10-31 21:41:23 +00:00
|
|
|
'!libs/**',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2017-04-11 02:30:17 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
stylelint: {
|
|
|
|
options: {
|
|
|
|
syntax: 'less'
|
|
|
|
},
|
|
|
|
all: [
|
2019-02-16 14:28:41 +00:00
|
|
|
'**/*.css',
|
2017-10-31 21:41:23 +00:00
|
|
|
'**/*.less',
|
2018-09-11 13:13:41 +00:00
|
|
|
// TODO: Nested imports cause stylelint to crash
|
|
|
|
'!resources/skins.minerva.base.styles/print/styles.less',
|
2017-10-31 21:41:23 +00:00
|
|
|
'!docs/**',
|
|
|
|
'!libs/**',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
banana: conf.MessagesDirs,
|
2017-04-11 02:30:17 +00:00
|
|
|
watch: {
|
|
|
|
lint: {
|
2017-10-31 21:41:23 +00:00
|
|
|
files: [ '{resources,tests/qunit}/**/*.{js,less}' ],
|
2017-04-11 02:30:17 +00:00
|
|
|
tasks: [ 'lint' ]
|
|
|
|
},
|
|
|
|
scripts: {
|
2017-10-31 21:41:23 +00:00
|
|
|
files: [ '{resources,tests/qunit}/**/*.js' ],
|
2017-04-11 02:30:17 +00:00
|
|
|
tasks: [ 'test' ]
|
|
|
|
},
|
|
|
|
configFiles: {
|
|
|
|
files: [ 'Gruntfile.js' ],
|
|
|
|
options: {
|
|
|
|
reload: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-05-06 20:52:00 +00:00
|
|
|
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'banana' ] );
|
2017-04-11 02:30:17 +00:00
|
|
|
grunt.registerTask( 'test', [ 'lint' ] );
|
|
|
|
|
|
|
|
grunt.registerTask( 'default', [ 'test' ] );
|
|
|
|
};
|