airbnb / airbnb/javascript

React eslint not catching the use of underscore with internal methods

Open
#577 1 comment 0 reactions 0 assignees View on GitHub
pull request wanted
Dominant language
JavaScript
Stars
148k
Forks
26.6k
PR merge metrics
No merged PRs in 30d

Description

In the [React/JSX Styleguide 'Methods' section](https://github.com/airbnb/javascript/blob/master/react/README.md#methods) 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the React/JSX Styleguide Methods section in react/README.md and inspect the existing ESLint rules for React/JSX files. Review related issue #490 and determine whether the documented underscore convention should be enforced; done requires a decided policy and corresponding documentation or linting changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.