Skip to content

Commit 94b7bda

Browse files
committed
exclude tagged template literals from js/superfluous-trailing-arguments
1 parent 525f271 commit 94b7bda

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

javascript/ql/src/LanguageFeatures/SpuriousArguments.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class SpuriousArguments extends Expr {
4646

4747
SpuriousArguments() {
4848
this = invk.getArgument(maxArity(invk)).asExpr() and
49-
not invk.isIncomplete()
49+
not invk.isIncomplete() and
50+
not invk.getAstNode() instanceof TaggedTemplateExpr
5051
}
5152

5253
/**

javascript/ql/test/query-tests/LanguageFeatures/SpuriousArguments/tst.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,13 @@ function sum2() {
129129
}
130130

131131
// OK
132-
sum2(1, 2, 3);
132+
sum2(1, 2, 3);
133+
134+
const $ = function (x, arr) {
135+
console.log(x, arr);
136+
};
137+
138+
// OK
139+
async function tagThing(repoUrl, directory) {
140+
await $`git clone ${repoUrl} ${directory}`;
141+
}

0 commit comments

Comments
 (0)