-
Notifications
You must be signed in to change notification settings - Fork 667
Disable no-underscore-dangle rule #1873
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
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rawagner The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@rawagner: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
I'm in favor of this rule to enforce use of typescript private vs underscore naming convention. I'm not sure if there's a way to allow ending a name with underscore while preventing the prefix. I think a better convention would be to name classes according to their hoc enhancement rather than adding an underscore suffix to the base component. |
|
We might be able to use https://eslint.org/docs/rules/no-underscore-dangle#enforceinmethodnames
Agree. It would be good to come up with a consistent naming convention for connected components. |
|
If we adopt the convention of exposing a single default component per file, then this problem goes away as the hoc enhanced component is default exported inline and didn't require a name. |
|
👍 on using TypeScript However, this doesn't apply to React (function or class) component declarations, where a trailing underscore was used to denote that the given component is internal / inner / part of another component.
Sadly, the no-underscore-dangle rule doesn't seem to support configuration that only allows single trailing underscore for function or class declarations.
This reminds me of some projects using e.g.
Yes, but that only covers object property names, not declared variable names themselves.
I agree with that. Code under If some package isn't ready to follow that convention, it can add e.g. If we decide to follow some convention, we should apply it consistently to all code under |
|
TL;DR version
|
|
@vojtechszocs well put. Override for the particular rules only within the particular package. This should be seen as a temporary fix and teams should then work towards adopting the primary rule set. |
|
Ok, thank you all for discussion :) Lets keep the rule enabled and follow convention of exposing a single default component per file. If some plugin isn't ready to do that they could disable the rule in their Closing. |
The rule does not allow underscore in plugin components but is widely used in console. I'd like to disable it to allow plugin components use the same convention as rest of console's code.
See #1803 (comment)
@vojtechszocs @spadgett @christianvogt any objections ?