Closed
Description
Motivation
It is considered good practice to only throw the Error object itself or an object using the Error object as base objects for user-defined exceptions as described at https://eslint.org/docs/rules/no-throw-literal.
Proposed Solution
Instead of throw x;
use throw new Error(x);
(except for undefined
, null
and Symbol
as raised in #1734).