Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
exportclassHttpErrorResponseimplementsError{readonlyname="HttpErrorResponse";readonlymessage:string;readonlyerror:any|null;readonlyok=false;constructor(publicstatus:number){}}functiontest(){thrownewHttpErrorResponse(404);}test();
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/only-throw-error":"error"},};
tsconfig
{"compilerOptions": {"strictNullChecks":true }}
Expected Result
I would expect an error is not detected
Actual Result
Expected an error object to be thrown. 11:9 - 11:35
Additional Info
The code of the linked playgroung is copied from angular type declarations. It seems angular is implementing instead of extending the Error interface for their HttpErrorResponse and that eslint is not recognising this. AFAIK rule should not trigger an error as thrown object is implemeting the Error interface.