Skip to content

Commit cd03f03

Browse files
committed
no-unused: JsxFragment requires React
Fixes: #87
1 parent 558df30 commit cd03f03

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rules/noUnusedRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function containsJsx(node: ts.Node): boolean | undefined {
8989
switch (node.kind) {
9090
case ts.SyntaxKind.JsxElement:
9191
case ts.SyntaxKind.JsxSelfClosingElement:
92-
// TODO add JsxFragment
92+
case ts.SyntaxKind.JsxFragment:
9393
return true;
9494
default:
9595
return ts.forEachChild(node, containsJsx);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as React from 'react';
2+
3+
let foo = <></>;
4+
~~~ [Variable 'foo' is unused.]

0 commit comments

Comments
 (0)