Skip to content

Commit 93a2094

Browse files
committed
test(plugins/x): add test case for function component with 'createElement'
1 parent 64a2128 commit 93a2094

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,25 @@ ruleTester.run(RULE_NAME, rule, {
15001500
},
15011501
],
15021502
},
1503+
{
1504+
code: /* tsx */ `
1505+
function App() {
1506+
return createElement("div", null, <div></div>);
1507+
}
1508+
`,
1509+
errors: [
1510+
{
1511+
messageId: "functionComponent",
1512+
data: {
1513+
name: "App",
1514+
displayName: "none",
1515+
forwardRef: false,
1516+
hookCalls: 0,
1517+
memo: false,
1518+
},
1519+
},
1520+
],
1521+
},
15031522
],
15041523
valid: [
15051524
...allFunctions,

0 commit comments

Comments
 (0)