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/function-component-definition.js

    rd565449 r0c6b92a  
    1111const reportC = require('../util/report');
    1212const getText = require('../util/eslint').getText;
     13const propsUtil = require('../util/props');
    1314
    1415// ------------------------------------------------------------------------------
     
    3536
    3637function hasOneUnconstrainedTypeParam(node) {
    37   const nodeTypeParams = node.typeParameters;
    38 
    39   return nodeTypeParams
    40     && nodeTypeParams.params
    41     && nodeTypeParams.params.length === 1
    42     && !nodeTypeParams.params[0].constraint;
     38  const nodeTypeArguments = propsUtil.getTypeArguments(node);
     39
     40  return nodeTypeArguments
     41    && nodeTypeArguments.params
     42    && nodeTypeArguments.params.length === 1
     43    && !nodeTypeArguments.params[0].constraint;
    4344}
    4445
     
    203204      }
    204205
     206      const nodeTypeArguments = propsUtil.getTypeArguments(node);
    205207      return (fixer) => fixer.replaceTextRange(
    206208        options.range,
    207209        buildFunction(options.template, {
    208210          typeAnnotation,
    209           typeParams: getNodeText(node.typeParameters, source),
     211          typeParams: getNodeText(nodeTypeArguments, source),
    210212          params: getParams(node, source),
    211213          returnType: getNodeText(node.returnType, source),
Note: See TracChangeset for help on using the changeset viewer.