Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/util/props.js
rd565449 r0c6b92a 10 10 * Checks if the Identifier node passed in looks like a propTypes declaration. 11 11 * @param {ASTNode} node The node to check. Must be an Identifier node. 12 * @returns { Boolean} `true` if the node is a propTypes declaration, `false` if not12 * @returns {boolean} `true` if the node is a propTypes declaration, `false` if not 13 13 */ 14 14 function isPropTypesDeclaration(node) { … … 25 25 * Checks if the node passed in looks like a contextTypes declaration. 26 26 * @param {ASTNode} node The node to check. 27 * @returns { Boolean} `true` if the node is a contextTypes declaration, `false` if not27 * @returns {boolean} `true` if the node is a contextTypes declaration, `false` if not 28 28 */ 29 29 function isContextTypesDeclaration(node) { … … 40 40 * Checks if the node passed in looks like a contextType declaration. 41 41 * @param {ASTNode} node The node to check. 42 * @returns { Boolean} `true` if the node is a contextType declaration, `false` if not42 * @returns {boolean} `true` if the node is a contextType declaration, `false` if not 43 43 */ 44 44 function isContextTypeDeclaration(node) { … … 49 49 * Checks if the node passed in looks like a childContextTypes declaration. 50 50 * @param {ASTNode} node The node to check. 51 * @returns { Boolean} `true` if the node is a childContextTypes declaration, `false` if not51 * @returns {boolean} `true` if the node is a childContextTypes declaration, `false` if not 52 52 */ 53 53 function isChildContextTypesDeclaration(node) { … … 58 58 * Checks if the Identifier node passed in looks like a defaultProps declaration. 59 59 * @param {ASTNode} node The node to check. Must be an Identifier node. 60 * @returns { Boolean} `true` if the node is a defaultProps declaration, `false` if not60 * @returns {boolean} `true` if the node is a defaultProps declaration, `false` if not 61 61 */ 62 62 function isDefaultPropsDeclaration(node) { … … 68 68 * Checks if we are declaring a display name 69 69 * @param {ASTNode} node The AST node being checked. 70 * @returns { Boolean} True if we are declaring a display name, false if not.70 * @returns {boolean} True if we are declaring a display name, false if not. 71 71 */ 72 72 function isDisplayNameDeclaration(node) { … … 87 87 * Checks if the PropTypes MemberExpression node passed in declares a required propType. 88 88 * @param {ASTNode} propTypeExpression node to check. Must be a `PropTypes` MemberExpression. 89 * @returns { Boolean} `true` if this PropType is required, `false` if not.89 * @returns {boolean} `true` if this PropType is required, `false` if not. 90 90 */ 91 91 function isRequiredPropType(propTypeExpression) { 92 return propTypeExpression.type === 'MemberExpression' && propTypeExpression.property.name === 'isRequired'; 92 return propTypeExpression.type === 'MemberExpression' 93 && propTypeExpression.property.name === 'isRequired'; 94 } 95 96 /** 97 * Returns the type arguments of a node or type parameters if type arguments are not available. 98 * @param {ASTNode} node The node to get the type arguments from. 99 * @returns {ASTNode} The type arguments or type parameters of the node. 100 */ 101 function getTypeArguments(node) { 102 if ('typeArguments' in node) { 103 return node.typeArguments; 104 } 105 return node.typeParameters; 106 } 107 108 /** 109 * Returns the super type arguments of a node or super type parameters if type arguments are not available. 110 * @param {ASTNode} node The node to get the super type arguments from. 111 * @returns {ASTNode} The super type arguments or parameters of the node. 112 */ 113 function getSuperTypeArguments(node) { 114 if ('superTypeArguments' in node) { 115 return node.superTypeArguments; 116 } 117 return node.superTypeParameters; 93 118 } 94 119 … … 101 126 isDisplayNameDeclaration, 102 127 isRequiredPropType, 128 getTypeArguments, 129 getSuperTypeArguments, 103 130 };
Note:
See TracChangeset
for help on using the changeset viewer.