Below throw code giving lint error Expected an object to be thrown no-throw-literal
throw { code : 403, message : myMessage };
if i try throw new Error, i am not getting eslint but it gives [Object Object] in the response.
throw new Error({ code : 403, message : myMessage });
Could someone tell me how to fix Expected an object to be thrown error ? without removing eslint config/rules
throw new Error(myMessage);
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… – Nervous