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 eslint not catching the use of underscore with internal methods #577

Open
Ganonside opened this issue Nov 11, 2015 · 1 comment
Open

Comments

@Ganonside
Copy link

In the React/JSX Styleguide 'Methods' section it says you shouldn't use _ to prefix internal methods. However, some of my code contains this convention and it isn't being caught by the linter. I double-checked the eslint rules for react/jsx files and there doesn't seem to be a rule defined for this convention.

Is this intentional? If so, why specify the rule in your documentation? I found a related issue (#490), but it wasn't clearly stated whether or not this rule should definitely be adhered to but rather that it's more or less up to the programmer.

Any clarification would be greatly appreciated.

@ljharb
Copy link
Collaborator

ljharb commented Dec 23, 2015

Our style guide does have many rules and recommendations that aren't enforced by linting rules. Sometimes this is an oversight, but sometimes the linter rule doesn't exist for it. I'm not sure off the top of my head which it is.

However, the guide should be discouraging _-prefixed methods in all cases, and if possible, we should locate or create a linter rule to enforce that.

My thoughts are summarized here as well.

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

No branches or pull requests

2 participants