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-09-17 13:20:57 +00:00
|
|
|
'**/*.{js,json}',
|
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: {
|
|
|
|
all: [
|
2019-09-17 13:20:57 +00:00
|
|
|
'**/*.{css,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/**'
|
|
|
|
]
|
|
|
|
},
|
2019-09-17 13:20:57 +00:00
|
|
|
banana: Object.assign( {
|
|
|
|
options: { requireLowerCase: false }
|
|
|
|
}, 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' ] );
|
|
|
|
};
|