-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESLint only-throw-error complains on subclasses #31
Comments
Hi @unlight, Thanks for reporting this. TypeScript ESLint is using a TypeScript parser, which does not recognize modern-errors error classes as inheriting from The reason is because modern-errors types are not using the typical pattern for inheriting from modern-errors/src/subclass/create.d.ts Lines 62 to 99 in 72b9606
modern-errors initially relied on the more typical pattern for subclassing Therefore, until those TypeScript bugs are fixed, there's no real way forward. The only workaround at the moment is to disable this linting rule in your problem, unfortunately. |
Guidelines
Describe the bug
ESLint rule https://typescript-eslint.io/rules/only-throw-error/ complains about derived classes
Looks like typescript-eslint plugin thinks that variable is not inherited from Error
Steps to reproduce
See 'Describe the bug'
Environment
"@eslint/js": "^9.12.0"
"typescript-eslint": "^8.8.0"
Pull request (optional)
The text was updated successfully, but these errors were encountered: