From c69f3e3103c10a791a434d81da6212ef50951042 Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 11 Jul 2019 08:54:44 -0700 Subject: [PATCH] Disallow throwing non-error objects Summary: It's annoying to have to treat things like they might not be errors, inside catch blocks. This should stop that. Reviewed By: passy Differential Revision: D16201509 fbshipit-source-id: b028ea3a1e0766763fcf2659d80456f4dd281c40 --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 2cbf93753..acb35a35a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,6 +30,7 @@ module.exports = { 'no-console': 0, // we're setting window.console in App.js 'no-multi-spaces': 2, 'prefer-promise-reject-errors': 1, + 'no-throw-literal': 'error', 'no-extra-boolean-cast': 2, 'no-extra-semi': 2, 'no-unsafe-negation': 2,