stenciljs/eslint-plugin

bug: own-methods-must-be-private enforces `private` accessor on `#name` while typescript disallowes it

Open

#125 建立於 2024年11月27日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)TypeScript (37 fork)auto 404
Help Wanted

倉庫指標

Star
 (71 star)
PR 合併指標
 (PR 指標待抓取)

描述

Prerequisites

Stencil ESLint Version

0.8.0

Current Behavior

When using fields and methods marked with private identifier # like #methodName we get warning from eslint, triggering the rule ESLint: Own class methods cannot be public(@stencil-community/ own-methods-must-be-private), the fix is to add the private modifier. This on the other hand fails with typescript TS18010: An accessibility modifier cannot be used with a private identifier.

Expected Behavior

Have eslint recognize names starting with # as being private, and don't report violation.

Steps to Reproduce

Have a simple component like:

@Component({/*...*/})
class foo{
#someName(){ /*...*/ }
}

Eslint will try to add the private keyword, but then typescript reports invalid syntax.

Code Reproduction URL

no url

Additional Information

No response

貢獻者指南