Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
mt3o opened this issue Nov 27, 2024 · 1 comment

Comments

@mt3o
Copy link

mt3o commented Nov 27, 2024

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

@james-nash
Copy link

Just encountered this exact issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants