diff --git a/.eslintrc.js b/.eslintrc.js index 7bade7be4b..b42920ef95 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'], diff --git a/src/scripts/datetime.js b/src/scripts/datetime.js index 0a014b1de4..796ec3a6d7 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