File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed
test/function-declaration Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,9 @@ export function parseFromProgram(
259259 return (
260260 name === 'global.JSX.Element' ||
261261 name === 'React.ReactElement' ||
262- name === 'React.JSX.Element'
262+ name === 'React.JSX.Element' ||
263+ name . endsWith ( '@types/react/jsx-runtime".JSX.Element' ) || // when `"jsx": "react-jsx"` in tsconfig
264+ name . endsWith ( '@types/react/jsx-dev-runtime".JSX.Element' ) // when `"jsx": "react-jsxdev"` in tsconfig
263265 ) ;
264266 }
265267
Original file line number Diff line number Diff line change 1+ export function Component ( props : Props ) {
2+ return < div { ...props } /> ;
3+ }
4+
5+ interface Props {
6+ className ?: string ;
7+ }
Original file line number Diff line number Diff line change 1+ {
2+ "nodeType" : " program" ,
3+ "body" : [
4+ {
5+ "nodeType" : " component" ,
6+ "name" : " Component" ,
7+ "props" : [
8+ {
9+ "nodeType" : " prop" ,
10+ "name" : " className" ,
11+ "propType" : {
12+ "nodeType" : " union" ,
13+ "types" : [
14+ {
15+ "nodeType" : " simpleType" ,
16+ "typeName" : " undefined"
17+ },
18+ {
19+ "nodeType" : " simpleType" ,
20+ "typeName" : " string"
21+ }
22+ ]
23+ },
24+ "optional" : true ,
25+ "filenames" : {}
26+ }
27+ ]
28+ }
29+ ]
30+ }
You can’t perform that action at this time.
0 commit comments