Changeset 0c6b92a for imaps-frontend/node_modules/eslint-plugin-react/lib/rules/function-component-definition.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/function-component-definition.js
rd565449 r0c6b92a 11 11 const reportC = require('../util/report'); 12 12 const getText = require('../util/eslint').getText; 13 const propsUtil = require('../util/props'); 13 14 14 15 // ------------------------------------------------------------------------------ … … 35 36 36 37 function hasOneUnconstrainedTypeParam(node) { 37 const nodeType Params = node.typeParameters;38 39 return nodeType Params40 && nodeType Params.params41 && nodeType Params.params.length === 142 && !nodeType Params.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; 43 44 } 44 45 … … 203 204 } 204 205 206 const nodeTypeArguments = propsUtil.getTypeArguments(node); 205 207 return (fixer) => fixer.replaceTextRange( 206 208 options.range, 207 209 buildFunction(options.template, { 208 210 typeAnnotation, 209 typeParams: getNodeText(node .typeParameters, source),211 typeParams: getNodeText(nodeTypeArguments, source), 210 212 params: getParams(node, source), 211 213 returnType: getNodeText(node.returnType, source),
Note:
See TracChangeset
for help on using the changeset viewer.