Skip to content

Commit

Permalink
Use sourceCode.getAncestors
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Apr 9, 2023
1 parent bee88c9 commit 35526b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"c8": "^7.13.0",
"chalk": "^5.2.0",
"enquirer": "^2.3.6",
"eslint": "^8.37.0",
"eslint": "^8.38.0",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-doc-generator": "^1.4.3",
"eslint-plugin-eslint-plugin": "^5.0.8",
Expand All @@ -94,7 +94,7 @@
"yaml": "^2.2.1"
},
"peerDependencies": {
"eslint": ">=8.37.0"
"eslint": ">=8.38.0"
},
"ava": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions rules/template-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const create = context => {
}
}

const ancestry = context.getAncestors().reverse();
const shouldIndent = selectors.some(selector => esquery.matches(node, esquery.parse(selector), ancestry));
const ancestors = sourceCode.getAncestors(node).reverse();
const shouldIndent = selectors.some(selector => esquery.matches(node, esquery.parse(selector), ancestors));

if (shouldIndent) {
indentTemplateLiteralNode(node);
Expand Down

0 comments on commit 35526b8

Please sign in to comment.