Skip to content

Commit de19972

Browse files
committed
refactor: clean up redundant code
1 parent 4849949 commit de19972

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

plugins/eslint-plugin-react-debug/src/rules/jsx/jsx.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import type { TSESTreeJSXElementLike } from "@eslint-react/ast";
44
import * as core from "@eslint-react/core";
55
import { type RuleContext, type RuleFeature, type RuleListener } from "@eslint-react/eslint";
66
import { getElementFullType, isFragmentElement } from "@eslint-react/jsx";
7-
import { flow } from "@local/eff";
87
import { AST_NODE_TYPES as AST } from "@typescript-eslint/types";
98
import { P, match } from "ts-pattern";
109
import ts from "typescript";
11-
import { report } from "./lib";
1210

1311
export const RULE_NAME = "jsx";
1412

@@ -36,9 +34,8 @@ export default createRule<[], MessageID>({
3634

3735
export function create(context: RuleContext<MessageID, []>): RuleListener {
3836
const jsxConfig = core.getJsxConfig(context);
39-
4037
function visit(node: TSESTreeJSXElementLike) {
41-
return {
38+
context.report({
4239
data: {
4340
json: stringify({
4441
kind: match(node)
@@ -64,9 +61,7 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
6461
},
6562
messageId: "default",
6663
node,
67-
} as const;
64+
});
6865
}
69-
return {
70-
"JSXElement, JSXFragment": flow(visit, report(context)),
71-
};
66+
return { JSXElement: visit, JSXFragment: visit };
7267
}

plugins/eslint-plugin-react-debug/src/rules/jsx/lib.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)