Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[no-useless-constructor] should not report on different constructor type #3820

Closed
Assignees
JoshuaKGoldberg
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended
@JounQin

Description

@JounQin
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I haveread the FAQ and my problem is not listed.

Repro

{"rules": {"@typescript-eslint/no-useless-constructor": [2]  }}
import{INTERNAL_SERVER_ERROR}from'./constants'importtype{ApiError,ApiErrorOptions}from'shared'exportclassResponseErrorextendsErrorimplementsApiError{declarecode:stringdeclarereason:stringdeclareextra:object|undefineddeclaredetails:unknown[]|undefinedconstructor(optionOrMsg:Partial<ApiErrorOptions>|string){constoptions=typeofoptionOrMsg==='string' ?{message:optionOrMsg} :optionOrMsgsuper(options.message)this.code=options.code||String(INTERNAL_SERVER_ERROR)this.reason=options.reason||'Internal Server Error'this.extra=options.extrathis.details=options.details}}exportclassRedirectErrorextendsResponseError{constructor(url:string){// error reported, unexpected, it changes the constructor typesuper(url)}}

Expected Result

No error

Actual Result

error

Additional Info

Versions

packageversion
@typescript-eslint/eslint-plugin4.29.3
@typescript-eslint/parser4.29.3
TypeScript4.4.2
ESLint7.32.0
node12.22.5

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp