MCPcopy Index your code
hub / github.com/nodejs/node / checkJsxFragment

Function checkJsxFragment

test/fixtures/snapshot/typescript.js:73755–73768  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

73753 return getJsxElementTypeAt(node) || anyType;
73754 }
73755 function checkJsxFragment(node) {
73756 checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
73757 // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment
73758 // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too
73759 var nodeSourceFile = ts.getSourceFileOfNode(node);
73760 if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx"))
73761 && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) {
73762 error(node, compilerOptions.jsxFactory
73763 ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option
73764 : ts.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments);
73765 }
73766 checkJsxChildren(node);
73767 return getJsxElementTypeAt(node) || anyType;
73768 }
73769 function isHyphenatedJsxName(name) {
73770 return ts.stringContains(name, "-");
73771 }

Callers 1

checkExpressionWorkerFunction · 0.85

Calls 5

checkJsxChildrenFunction · 0.85
getJsxElementTypeAtFunction · 0.85
errorFunction · 0.70
hasMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…