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

[Question] why the redundant rules? #122

Closed
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginquestionQuestions! (i.e. not a bug / enhancment / documentation)
@43081j

Description

@43081j

Today I updated to the newly scoped package as opposed to the old unscoped/non-monorepo one, and I also inherited the recommended config.

First thing I noticed by enabling all your recommended rules is that you have some redundant ones:

  • @typescript-eslint/explicit-function-return-type
  • @typescript-eslint/no-unused-vars

Why do these rules exist? There are already compiler options for them:

  • noImplicitReturns
  • noUnusedLocals
  • noUnusedParameters

In fact, the rules do a much worse job and seem to be very flaky. Why would we recommend these instead of built-in compiler features?

For example, the unused-vars rule doesn't detect the usage of types in interface generics:

interfaceFooextendsSomeType<AnotherType>{

SomeType is marked as unused.

Another example, the return type rule has no clue about inheritance. It will error if you don't specify the return type of a method even if the method it overrides has a return type on it. TypeScript allows this.

Are these rules just here for legacy reasons or is there a reason to prefer them?

I would ask you at least remove them from the recommended config and start recommending the much more stable, much stronger compiler features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginquestionQuestions! (i.e. not a bug / enhancment / documentation)

    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