Skip to content

Commit

Permalink
[FIX]: resolve properly the current file name, even on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriAt360 committed Jun 16, 2022
1 parent 55621d8 commit de33169
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/no-restricted-paths.js
Expand Up @@ -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))
Expand Down

0 comments on commit de33169

Please sign in to comment.