From de331693613c5a13b6f624367b4b90ba3b454072 Mon Sep 17 00:00:00 2001 From: AdriAt360 Date: Thu, 16 Jun 2022 10:23:33 +0200 Subject: [PATCH] [FIX]: resolve properly the current file name, even on Windows --- src/rules/no-restricted-paths.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rules/no-restricted-paths.js b/src/rules/no-restricted-paths.js index 9b17975b5c..d8f281c9ee 100644 --- a/src/rules/no-restricted-paths.js +++ b/src/rules/no-restricted-paths.js @@ -74,7 +74,8 @@ module.exports = { const options = context.options[0] || {}; const restrictedPaths = options.zones || []; const basePath = options.basePath || process.cwd(); - const currentFilename = context.getPhysicalFilename ? context.getPhysicalFilename() : context.getFilename(); + const currentFilenameRaw = context.getPhysicalFilename ? context.getPhysicalFilename() : context.getFilename(); + const currentFilename = resolve(currentFilenameRaw, context); const matchingZones = restrictedPaths.filter((zone) => { return [].concat(zone.target) .map(target => path.resolve(basePath, target))