From ceebed3709f9a7d22c0013ff267c5f22eb8a331e Mon Sep 17 00:00:00 2001 From: Stromwerk Date: Thu, 11 Aug 2022 21:43:36 +0300 Subject: [PATCH 1/2] Add no-throw-literal rule to eslintrc --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 5c1c881c9..9cf304d99 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,6 +42,7 @@ module.exports = { 'indent': ['error', 4, { 'SwitchCase': 1 }], 'jsx-quotes': ['error', 'prefer-single'], 'keyword-spacing': ['error'], + 'no-throw-literal': ['error'], 'max-statements-per-line': ['error'], 'no-duplicate-imports': ['error'], 'no-empty-function': ['error'], From 9a585ffd7c29f6e44558c223923eda99f505d679 Mon Sep 17 00:00:00 2001 From: Stromwerk Date: Thu, 11 Aug 2022 21:43:54 +0300 Subject: [PATCH 2/2] Fix throwing string in datetime.js --- src/scripts/datetime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/datetime.js b/src/scripts/datetime.js index 0a014b1de..796ec3a6d 100644 --- a/src/scripts/datetime.js +++ b/src/scripts/datetime.js @@ -19,7 +19,7 @@ import globalize from './globalize'; // "00", "00", ".000", "Z", undefined, undefined, undefined] if (!d) { - throw "Couldn't parse ISO 8601 date string '" + s + "'"; + throw new Error("Couldn't parse ISO 8601 date string '" + s + "'"); } // parse strings, leading zeros into proper ints