-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
{
"rules": {
"@typescript-eslint/no-useless-constructor": [2]
}
}import { INTERNAL_SERVER_ERROR } from './constants'
import type { ApiError, ApiErrorOptions } from 'shared'
export class ResponseError extends Error implements ApiError {
declare code: string
declare reason: string
declare extra: object | undefined
declare details: unknown[] | undefined
constructor(optionOrMsg: Partial<ApiErrorOptions> | string) {
const options =
typeof optionOrMsg === 'string' ? { message: optionOrMsg } : optionOrMsg
super(options.message)
this.code = options.code || String(INTERNAL_SERVER_ERROR)
this.reason = options.reason || 'Internal Server Error'
this.extra = options.extra
this.details = options.details
}
}
export class RedirectError extends ResponseError {
constructor(url: string) { // error reported, unexpected, it changes the constructor type
super(url)
}
}Expected Result
No error
Actual Result
error
Additional Info
Versions
| package | version |
|---|---|
@typescript-eslint/eslint-plugin |
4.29.3 |
@typescript-eslint/parser |
4.29.3 |
TypeScript |
4.4.2 |
ESLint |
7.32.0 |
node |
12.22.5 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended