2022-02-07 16:35:42 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-06-20 04:54:10 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2022-02-07 16:35:42 +00:00
|
|
|
const conf = grunt.file.readJSON( 'extension.json' );
|
2017-01-23 13:48:11 +00:00
|
|
|
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2016-10-28 18:11:26 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2015-09-14 18:46:13 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-05-19 17:06:34 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-06-20 04:54:10 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2017-01-23 13:48:11 +00:00
|
|
|
banana: conf.MessagesDirs,
|
2016-05-19 17:06:34 +00:00
|
|
|
stylelint: {
|
2017-04-28 16:33:25 +00:00
|
|
|
all: [
|
2024-04-01 23:28:03 +00:00
|
|
|
'**/*.{css,less}',
|
2020-06-16 14:45:59 +00:00
|
|
|
'!{vendor,node_modules,modules/ve-math/tools/node_modules}/**'
|
2017-04-28 16:33:25 +00:00
|
|
|
]
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: [
|
2024-04-01 23:28:03 +00:00
|
|
|
'.{stylelintrc,eslintrc}.json',
|
2017-04-28 16:33:08 +00:00
|
|
|
'<%= eslint.all %>',
|
2017-04-28 16:33:25 +00:00
|
|
|
'<%= stylelint.all %>'
|
2015-09-14 18:46:13 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
},
|
2016-10-28 18:11:26 +00:00
|
|
|
eslint: {
|
2019-04-03 22:29:36 +00:00
|
|
|
options: {
|
2020-06-16 14:45:59 +00:00
|
|
|
cache: true,
|
|
|
|
fix: grunt.option( 'fix' )
|
2019-04-03 22:29:36 +00:00
|
|
|
},
|
2023-09-21 13:33:46 +00:00
|
|
|
all: [ '.' ]
|
2015-06-20 04:54:10 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-05-06 23:35:47 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|