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-empty-function] Allow empty functions for overridden class functions #4919

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulegood first issueGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@anton-johansson

Description

@anton-johansson
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages. (as far asxo goes)
  • I haveread the FAQ and my problem is not listed.

Repro

I'm not exactly sure how my rule is configured, it comes from the XO package.

abstractclassAbstractThing{protectedreportStuff():void{console.log("This reports a lot of stuff...");}}classMyThing{protectedoverridereportStuff(){};}

Here is my tsconfig:

{"compilerOptions": {"target":"esnext","module":"esnext","jsx":"preserve","lib": ["dom","es2020"    ],"baseUrl":"./","moduleResolution":"node","strict":true,"allowJs":true,"noEmit":true,"allowSyntheticDefaultImports":true,"esModuleInterop":true,"skipLibCheck":true,"noUnusedLocals":true,"noUnusedParameters":true,"isolatedModules":true,"removeComments":false,"preserveConstEnums":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"experimentalDecorators":true,"emitDecoratorMetadata":true,"resolveJsonModule":true,"noImplicitOverride":true,"incremental":true  },"include": ["src/**/*","test/**/*"  ],"exclude": ["node_modules"  ]}

Expected Result

I expect the rule to not give me a warning, because itcan be an actual use case to "disable" base-class functionality.

Actual Result

I get the classic warning "Unexpected empty method 'reportStuff'. (@typescript-eslint/no-empty-function)XO(@typescript-eslint/no-empty-function)" because the function is obviously empty, but the rule does not consider the (relatively new)override keyword.

Additional Info

None.

Versions

packageversion
@typescript-eslint/eslint-plugin5.11.0
@typescript-eslint/parser5.11.0
TypeScript4.5.5
ESLint8.14.0
node16.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulegood first issueGood for newcomerspackage: 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