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] / [no-empty-function] with mixed JS & TS codebase #48

Closed
Assignees
armano2
Labels
bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@scottohara

Description

@scottohara

(This issue was originally raised ineslint/typescript-eslint-parser#418; and it was suggested that it would be more appropriately logged here, as it is not something that the parser can handle)

What version of TypeScript are you using?
2.6.2

What version oftypescript-eslint-parser are you using?
9.0.0

What code were you trying to parse?

exportdefaultclassFoo{constructor(privatename:string){}getgreeting() :string{return`Hello${this.name}`;}}

What did you expect to happen?
No errors/warnings about empty constructor.

What happened?

  2:2   error  Useless constructor           no-useless-constructor  2:36  error  Unexpected empty constructor  no-empty-function

For now, I have turned off these two rules in my.ts projects; but for projects that mix*.ts and*.js code, it would be nice to be able to have these rules enabled to catch any useless constructors/empty functions in*.js code without it also warning about valid*.ts constructors.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp