2014-06-04 02:34:04 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package TemplateData
|
|
|
|
*/
|
|
|
|
|
2022-03-13 17:17:03 +00:00
|
|
|
'use strict';
|
2014-06-04 02:34:04 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2022-03-13 17:17:03 +00:00
|
|
|
const conf = grunt.file.readJSON( 'extension.json' );
|
2015-09-17 20:10:33 +00:00
|
|
|
|
2016-05-24 14:25:25 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-12-02 22:05:13 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2016-05-19 19:17:39 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2014-06-04 02:34:04 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-12-02 22:05:13 +00:00
|
|
|
eslint: {
|
2019-02-10 17:06:49 +00:00
|
|
|
options: {
|
2020-07-08 12:08:35 +00:00
|
|
|
cache: true,
|
|
|
|
fix: grunt.option( 'fix' )
|
2019-02-10 17:06:49 +00:00
|
|
|
},
|
2023-10-26 12:31:59 +00:00
|
|
|
all: [ '.' ]
|
2014-06-04 02:34:04 +00:00
|
|
|
},
|
2016-05-19 19:17:39 +00:00
|
|
|
stylelint: {
|
2014-06-04 02:34:04 +00:00
|
|
|
all: [
|
2022-08-08 09:22:55 +00:00
|
|
|
'modules/**/*.{css,less}'
|
2014-06-04 02:34:04 +00:00
|
|
|
]
|
|
|
|
},
|
2019-12-16 15:12:24 +00:00
|
|
|
banana: {
|
|
|
|
options: {
|
|
|
|
requireLowerCase: false
|
|
|
|
},
|
|
|
|
all: conf.MessagesDirs.TemplateData
|
|
|
|
},
|
2014-06-04 02:34:04 +00:00
|
|
|
watch: {
|
|
|
|
files: [
|
2017-08-19 08:35:07 +00:00
|
|
|
'.{stylelintrc,eslintrc}.json',
|
2023-10-26 12:31:59 +00:00
|
|
|
'**/*.{js,json}',
|
|
|
|
'!{lib,vendor,node_modules,docs}/**',
|
2016-05-19 19:17:39 +00:00
|
|
|
'<%= stylelint.all %>'
|
2014-06-04 02:34:04 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-05-07 17:50:20 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|