Skip to content

Commit 52bad1d

Browse files
authored
fix: fixed no-useless-fragment false positive when using  , closes #1035 (#1036)
1 parent efee62f commit 52bad1d

File tree

10 files changed

+195
-228
lines changed

10 files changed

+195
-228
lines changed

packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml-with-children.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { RuleContext, RuleFeature } from "@eslint-react/kit";
22
import type { TSESTree } from "@typescript-eslint/types";
33
import type { RuleListener } from "@typescript-eslint/utils/ts-eslint";
44
import type { CamelCase } from "string-ts";
5+
import * as AST from "@eslint-react/ast";
56
import * as JSX from "@eslint-react/jsx";
67

78
import { createRule } from "../utils";
@@ -51,5 +52,5 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
5152
function hasChildrenWithin(node: TSESTree.JSXElement): boolean {
5253
return node.children.length > 0
5354
&& node.children[0] != null
54-
&& !JSX.isLineBreak(node.children[0]);
55+
&& !AST.isLineBreak(node.children[0]);
5556
}

0 commit comments

Comments
 (0)