Skip to content

Commit e96d723

Browse files
authored
fix: use context.sourceCode in guard-define-call rule for eslint 9 compat (#143)
1 parent 25f62cc commit e96d723

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rules/guard-define-call.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const rule: Rule.RuleModule = {
2727

2828
create(context): Rule.RuleListener {
2929
const definedCustomElements = new Set<string>();
30-
30+
const source = context.sourceCode;
3131
//----------------------------------------------------------------------
3232
// Helpers
3333
//----------------------------------------------------------------------
@@ -63,8 +63,7 @@ const rule: Rule.RuleModule = {
6363
}
6464

6565
if (isGetCall(node) && tagName) {
66-
// TODO (43081j): use source.getAncestors(node)
67-
const ancestors = context.getAncestors();
66+
const ancestors = source.getAncestors(node);
6867
const isInsideIfStatement = ancestors.some(
6968
(ancestor): boolean =>
7069
ancestor.type === 'IfStatement' &&

0 commit comments

Comments
 (0)