跳至內容

oxc/missing-throw 正確性

此規則預設為開啟。
💡 此規則提供建議。

功能

檢查 new 表達式前面是否缺少 throw 關鍵字。

範例

javascript
function foo() {
  throw Error();
}
const foo = () => {
  new Error();
};

參考資料

以 MIT 許可證發佈。