From: Kunal Marwaha Date: Tue, 15 Sep 2020 20:08:55 +0000 (-0700) Subject: [misc] check monthsParse configs on lint (#5716) X-Git-Tag: 2.29.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aca41841feababe6b0314abe30baf43bea58c5b5;p=thirdparty%2Fmoment.git [misc] check monthsParse configs on lint (#5716) --- diff --git a/Gruntfile.js b/Gruntfile.js index 455929450..d6e013e8a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -156,6 +156,11 @@ module.exports = function (grunt) { eslint: { command: 'npm run eslint', }, + checkMonthsParseIssue: { + // Each locale should have all (3) or none (0) of monthsParse: configs. + command: + 'if [ $(ls src/locale/* | while read -r line; do grep -i "monthsParse:" $line | wc -l; done | sort | uniq | wc -l) -ne 2 ]; then echo "Months parse issue: see https://github.com/moment/moment/issues/2754"; exit 1; fi', + }, 'prettier-fmt': { command: function () { var nodeMajor = parseInt( @@ -192,7 +197,11 @@ module.exports = function (grunt) { grunt.registerTask('default', ['lint', 'test']); // linting - grunt.registerTask('lint', ['exec:eslint', 'exec:prettier-check']); + grunt.registerTask('lint', [ + 'exec:eslint', + 'exec:prettier-check', + 'exec:checkMonthsParseIssue', + ]); // test tasks grunt.registerTask('test', [