Merge pull request #15523 from erik-krogh/exclude-tagged

JS: exclude tagged template literals from `js/superfluous-trailing-arguments`
This commit is contained in:
Erik Krogh Kristensen
2024-02-12 11:31:18 +01:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -46,7 +46,8 @@ class SpuriousArguments extends Expr {
SpuriousArguments() {
this = invk.getArgument(maxArity(invk)).asExpr() and
not invk.isIncomplete()
not invk.isIncomplete() and
not invk.getAstNode() instanceof TaggedTemplateExpr
}
/**

View File

@@ -129,4 +129,13 @@ function sum2() {
}
// OK
sum2(1, 2, 3);
sum2(1, 2, 3);
const $ = function (x, arr) {
console.log(x, arr);
};
// OK
async function tagThing(repoUrl, directory) {
await $`git clone ${repoUrl} ${directory}`;
}