Skip to content

Commit debb20e

Browse files
committed
[Refactor]: prop-types: avoid using an underscore to mean "internal"
1 parent 14fd70d commit debb20e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rules/prop-types.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = {
8484
* @param {String[]} keyList Dot separated name of the prop to check.
8585
* @returns {Boolean} True if the prop is declared, false if not.
8686
*/
87-
function _isDeclaredInComponent(declaredPropTypes, keyList) {
87+
function internalIsDeclaredInComponent(declaredPropTypes, keyList) {
8888
for (let i = 0, j = keyList.length; i < j; i++) {
8989
const key = keyList[i];
9090
const propType = (
@@ -120,7 +120,7 @@ module.exports = {
120120
const unionPropType = {};
121121
for (let k = 0, z = unionTypes.length; k < z; k++) {
122122
unionPropType[key] = unionTypes[k];
123-
const isValid = _isDeclaredInComponent(
123+
const isValid = internalIsDeclaredInComponent(
124124
unionPropType,
125125
keyList.slice(i)
126126
);
@@ -148,7 +148,7 @@ module.exports = {
148148
const component = components.get(node);
149149

150150
const isDeclared = component && component.confidence === 2 &&
151-
_isDeclaredInComponent(component.declaredPropTypes || {}, names);
151+
internalIsDeclaredInComponent(component.declaredPropTypes || {}, names);
152152
if (isDeclared) {
153153
return true;
154154
}

0 commit comments

Comments
 (0)