2021-10-07 13:18:56 +00:00
|
|
|
'use strict';
|
2019-10-10 13:25:11 +00:00
|
|
|
|
|
|
|
module.exports = function ( grunt ) {
|
2021-10-07 13:18:56 +00:00
|
|
|
const conf = grunt.file.readJSON( 'extension.json' );
|
2019-10-10 13:25:11 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2024-03-27 12:45:21 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-tyops' );
|
2019-10-10 13:25:11 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
eslint: {
|
|
|
|
options: {
|
2020-06-09 18:42:05 +00:00
|
|
|
cache: true,
|
|
|
|
fix: grunt.option( 'fix' )
|
2019-10-10 13:25:11 +00:00
|
|
|
},
|
2021-03-04 18:09:34 +00:00
|
|
|
all: '.'
|
2019-10-10 13:25:11 +00:00
|
|
|
},
|
|
|
|
stylelint: {
|
|
|
|
all: [
|
|
|
|
'*.{css,less}',
|
|
|
|
'modules/**/*.{css,less}'
|
|
|
|
]
|
|
|
|
},
|
2024-03-27 12:45:21 +00:00
|
|
|
tyops: {
|
|
|
|
options: {
|
|
|
|
typos: 'typos.json'
|
|
|
|
},
|
|
|
|
src: [
|
|
|
|
'**/*.{js,json,less,css,txt,php,md,sh}',
|
|
|
|
'!package-lock.json',
|
|
|
|
'!typos.json',
|
|
|
|
'!i18n/**',
|
|
|
|
'i18n/en.json',
|
|
|
|
'i18n/qqq.json',
|
|
|
|
'!lib/**',
|
|
|
|
'!{docs,node_modules,vendor}/**',
|
|
|
|
'!.git/**'
|
|
|
|
]
|
|
|
|
},
|
2019-10-10 13:25:11 +00:00
|
|
|
banana: conf.MessagesDirs
|
|
|
|
} );
|
|
|
|
|
2024-03-27 12:45:21 +00:00
|
|
|
grunt.registerTask( 'test', [ 'tyops', 'eslint', 'stylelint', 'banana' ] );
|
2019-10-10 13:25:11 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|