Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/eslint-plugin-react/lib/rules/require-optimization.js

    rd565449 r0c6b92a  
    5151     * Checks to see if our component is decorated by PureRenderMixin via reactMixin
    5252     * @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.
    5454     */
    5555    function hasPureRenderDecorator(node) {
     
    7878     * Checks to see if our component is custom decorated
    7979     * @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.
    8181     */
    8282    function hasCustomDecorator(node) {
     
    8686        for (let i = 0; i < allowLength; i++) {
    8787          for (let j = 0, l = node.decorators.length; j < l; j++) {
     88            const expression = node.decorators[j].expression;
    8889            if (
    89               node.decorators[j].expression
    90               && node.decorators[j].expression.name === allowDecorators[i]
     90              expression
     91              && expression.name === allowDecorators[i]
    9192            ) {
    9293              return true;
     
    102103     * Checks if we are declaring a shouldComponentUpdate method
    103104     * @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.
    105106     */
    106107    function isSCUDeclared(node) {
    107       return Boolean(
    108         node
    109         && node.name === 'shouldComponentUpdate'
    110       );
     108      return !!node && node.name === 'shouldComponentUpdate';
    111109    }
    112110
     
    114112     * Checks if we are declaring a PureRenderMixin mixin
    115113     * @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.
    117115     */
    118116    function isPureRenderDeclared(node) {
     
    127125      }
    128126
    129       return Boolean(
    130         node
     127      return (
     128        !!node
    131129        && node.key.name === 'mixins'
    132130        && hasPR
Note: See TracChangeset for help on using the changeset viewer.