Skip to content

Commit 5348909

Browse files
committed
refactor(no-use-context): minor improvements
1 parent abb9166 commit 5348909

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-use-context.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ export default createRule<[], MessageID>({
3232
},
3333
name: RULE_NAME,
3434
create(context) {
35+
if (!context.sourceCode.text.includes("useContext")) return {};
3536
const settings = getSettingsFromContext(context);
3637
const useContextAlias = new Set<string>();
37-
38-
if (!context.sourceCode.text.includes("useContext")) {
39-
return {};
40-
}
4138
if (compare(settings.version, "19.0.0", "<")) {
4239
return {};
4340
}

0 commit comments

Comments
 (0)