Changeset 0c6b92a for imaps-frontend/node_modules/eslint-plugin-react/lib/rules/require-optimization.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/require-optimization.js
rd565449 r0c6b92a 51 51 * Checks to see if our component is decorated by PureRenderMixin via reactMixin 52 52 * @param {ASTNode} node The AST node being checked. 53 * @returns { Boolean} True if node is decorated with a PureRenderMixin, false if not.53 * @returns {boolean} True if node is decorated with a PureRenderMixin, false if not. 54 54 */ 55 55 function hasPureRenderDecorator(node) { … … 78 78 * Checks to see if our component is custom decorated 79 79 * @param {ASTNode} node The AST node being checked. 80 * @returns { Boolean} True if node is decorated name with a custom decorated, false if not.80 * @returns {boolean} True if node is decorated name with a custom decorated, false if not. 81 81 */ 82 82 function hasCustomDecorator(node) { … … 86 86 for (let i = 0; i < allowLength; i++) { 87 87 for (let j = 0, l = node.decorators.length; j < l; j++) { 88 const expression = node.decorators[j].expression; 88 89 if ( 89 node.decorators[j].expression90 && node.decorators[j].expression.name === allowDecorators[i]90 expression 91 && expression.name === allowDecorators[i] 91 92 ) { 92 93 return true; … … 102 103 * Checks if we are declaring a shouldComponentUpdate method 103 104 * @param {ASTNode} node The AST node being checked. 104 * @returns { Boolean} True if we are declaring a shouldComponentUpdate method, false if not.105 * @returns {boolean} True if we are declaring a shouldComponentUpdate method, false if not. 105 106 */ 106 107 function isSCUDeclared(node) { 107 return Boolean( 108 node 109 && node.name === 'shouldComponentUpdate' 110 ); 108 return !!node && node.name === 'shouldComponentUpdate'; 111 109 } 112 110 … … 114 112 * Checks if we are declaring a PureRenderMixin mixin 115 113 * @param {ASTNode} node The AST node being checked. 116 * @returns { Boolean} True if we are declaring a PureRenderMixin method, false if not.114 * @returns {boolean} True if we are declaring a PureRenderMixin method, false if not. 117 115 */ 118 116 function isPureRenderDeclared(node) { … … 127 125 } 128 126 129 return Boolean(130 node127 return ( 128 !!node 131 129 && node.key.name === 'mixins' 132 130 && hasPR
Note:
See TracChangeset
for help on using the changeset viewer.