From 6bdd7280ce4c90a8b99482bfaade5117f86626f6 Mon Sep 17 00:00:00 2001 From: Dayo Olutayo Date: Sat, 12 Oct 2024 19:54:19 +0100 Subject: [PATCH] Fixed #2078: Allow let to be used in the test flies. This allows referencing let variables in the files in the tests directory without causing linting errors. --- lib/rules/template-no-let-reference.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rules/template-no-let-reference.js b/lib/rules/template-no-let-reference.js index b264da6dcb..107027f8e9 100644 --- a/lib/rules/template-no-let-reference.js +++ b/lib/rules/template-no-let-reference.js @@ -18,8 +18,13 @@ module.exports = { create: (context) => { const sourceCode = context.sourceCode; + const pathname = context.physicalFilename; function checkIfWritableReferences(node, scope) { + // Return if the pathname starts with '/start/' + if (pathname.startsWith('/tests/')) { + return; + } const ref = scope.references.find((v) => v.identifier === node); if (!ref) { return;