2022-03-17 23:04:22 +00:00
|
|
|
'use strict';
|
2015-05-29 14:52:06 +00:00
|
|
|
|
|
|
|
module.exports = function ( grunt ) {
|
2022-03-17 23:04:22 +00:00
|
|
|
const conf = grunt.file.readJSON( 'extension.json' );
|
2017-01-23 14:10:18 +00:00
|
|
|
|
2015-05-29 14:52:06 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-11-19 13:56:05 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2016-05-18 13:28:55 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-05-29 14:52:06 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-11-19 13:56:05 +00:00
|
|
|
eslint: {
|
2019-02-10 16:56:10 +00:00
|
|
|
options: {
|
2020-07-07 21:04:53 +00:00
|
|
|
cache: true,
|
|
|
|
fix: grunt.option( 'fix' )
|
2019-02-10 16:56:10 +00:00
|
|
|
},
|
2015-05-29 14:52:06 +00:00
|
|
|
all: [
|
2019-07-31 15:44:08 +00:00
|
|
|
'**/*.{js,json}',
|
2019-05-07 17:47:46 +00:00
|
|
|
'!{vendor,node_modules}/**'
|
2015-05-29 14:52:06 +00:00
|
|
|
]
|
|
|
|
},
|
2016-05-18 13:28:55 +00:00
|
|
|
stylelint: {
|
2016-05-20 12:58:01 +00:00
|
|
|
all: [
|
2021-01-10 12:40:20 +00:00
|
|
|
'**/*.{css,less}',
|
2016-05-18 13:28:55 +00:00
|
|
|
'!**/*.generated.css',
|
|
|
|
'!vendor/**',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2015-05-27 16:15:00 +00:00
|
|
|
},
|
2017-01-23 14:10:18 +00:00
|
|
|
banana: conf.MessagesDirs,
|
2015-05-29 14:52:06 +00:00
|
|
|
watch: {
|
|
|
|
files: [
|
2016-11-19 13:56:05 +00:00
|
|
|
'<%= eslint.all %>',
|
2016-05-18 13:28:55 +00:00
|
|
|
'<%= stylelint.all %>'
|
2015-05-29 14:52:06 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-05-07 17:47:46 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2015-05-29 14:52:06 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|