From ecd516cd0a276b6c281ddf5a214044300775b5d2 Mon Sep 17 00:00:00 2001 From: Kunal Marwaha Date: Tue, 15 Sep 2020 01:20:04 -0700 Subject: [PATCH] Check # of monthsParse: configs per locale --- Gruntfile.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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', [ -- 2.47.2