2017-01-18 12:52:44 +00:00
|
|
|
/* eslint-env node */
|
2015-10-13 21:11:33 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2023-09-19 21:47:32 +00:00
|
|
|
const messagesDirs = require( './extension.json' ).MessagesDirs;
|
|
|
|
for ( const subExtension of [
|
2023-09-18 18:44:07 +00:00
|
|
|
'QuestyCaptcha',
|
|
|
|
'ReCaptchaNoCaptcha',
|
|
|
|
'FancyCaptcha',
|
|
|
|
'hCaptcha'
|
2023-09-19 21:47:32 +00:00
|
|
|
] ) {
|
2024-01-12 18:19:25 +00:00
|
|
|
// eslint-disable-next-line security/detect-non-literal-require
|
2023-09-19 21:47:32 +00:00
|
|
|
messagesDirs[ subExtension ] = require( './' + subExtension + '/extension.json' )
|
|
|
|
.MessagesDirs[ subExtension ]
|
2024-06-07 03:55:13 +00:00
|
|
|
.map( ( path ) => subExtension + '/' + path );
|
2023-09-19 21:47:32 +00:00
|
|
|
}
|
2023-09-18 18:44:07 +00:00
|
|
|
|
2015-10-13 21:11:33 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2017-01-18 12:52:44 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-10-13 21:11:33 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2017-01-18 12:52:44 +00:00
|
|
|
eslint: {
|
2019-02-10 15:44:37 +00:00
|
|
|
options: {
|
2020-06-26 10:08:39 +00:00
|
|
|
cache: true,
|
|
|
|
fix: grunt.option( 'fix' )
|
2019-02-10 15:44:37 +00:00
|
|
|
},
|
2015-10-13 21:11:33 +00:00
|
|
|
all: [
|
2019-11-15 16:46:40 +00:00
|
|
|
'**/*.{js,json}',
|
2019-05-06 22:31:16 +00:00
|
|
|
'!{vendor,node_modules}/**'
|
2015-10-13 21:11:33 +00:00
|
|
|
]
|
|
|
|
},
|
2017-01-18 12:52:44 +00:00
|
|
|
stylelint: {
|
|
|
|
all: [
|
2020-06-26 10:08:39 +00:00
|
|
|
'**/*.{css,less}',
|
2017-08-19 07:42:18 +00:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2017-01-18 12:52:44 +00:00
|
|
|
]
|
2015-10-28 19:51:13 +00:00
|
|
|
},
|
2023-09-18 18:44:07 +00:00
|
|
|
banana: messagesDirs
|
2015-10-13 21:11:33 +00:00
|
|
|
} );
|
|
|
|
|
2019-05-06 22:31:16 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2015-10-13 21:11:33 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|