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

react-prefer-private-members should be typescript-only #110

Closed
BPScott opened this issue May 8, 2019 · 3 comments
Closed

react-prefer-private-members should be typescript-only #110

BPScott opened this issue May 8, 2019 · 3 comments
Assignees
Labels
bug Package: eslint-plugin stale Stale issue that hasn't received any attention in a while

Comments

@BPScott
Copy link
Member

BPScott commented May 8, 2019

Currently running this rule reports violations in JS files, where it is not possible to define private members.

Can we run it only on files where it can actually be fixed - i.e. only typescript files?

@cartogram
Copy link
Contributor

@BPScott You should be able to accomplish this with configuration in your project. https://eslint.org/docs/user-guide/configuring#example-configuration

Won't private properties be in JS eventually?

@BPScott
Copy link
Member Author

BPScott commented May 10, 2019

There's a spec for it, but it's not yet fully implemented in babel - it's close though.

See https://babeljs.io/blog/2019/03/19/7.4.0#static-private-methods-9446-https-githubcom-babel-babel-pull-9446 for what the syntax looks like and what work has been done.

I can prefix my method with # but it currently throws a parser error as babel-eslint isn't setup to handle that (which should be fixed in babel-eslint 11 when they start reading from your local babel config (except we'll have to do some work because we insist on disabling usage ob babel.config.js) but that's not released yet.

@alexandcote alexandcote transferred this issue from Shopify/eslint-plugin-shopify Mar 27, 2020
@stale
Copy link

stale bot commented Sep 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale issue that hasn't received any attention in a while label Sep 12, 2020
@stale stale bot closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Package: eslint-plugin stale Stale issue that hasn't received any attention in a while
Projects
None yet
Development

No branches or pull requests

3 participants