eslint-import-resolver-parcel
Advanced tools
Comparing version 1.10.5 to 1.10.6
@@ -7,3 +7,3 @@ 'use strict'; | ||
var path = require('path'); | ||
var path = _interopDefault(require('path')); | ||
var fs = _interopDefault(require('fs')); | ||
@@ -65,8 +65,8 @@ var resolve$1 = require('resolve'); | ||
function findAliases() { | ||
let currentPath = path.posix.resolve(); | ||
let packagePath = path.posix.resolve(currentPath, 'package.json'); | ||
let currentPath = path.resolve(); | ||
let packagePath = path.resolve(currentPath, 'package.json'); | ||
while (!fs.existsSync(packagePath)) { | ||
currentPath = path.posix.resolve(currentPath, '..'); | ||
packagePath = path.posix.resolve(currentPath, 'package.json'); | ||
currentPath = path.resolve(currentPath, '..'); | ||
packagePath = path.resolve(currentPath, 'package.json'); | ||
} | ||
@@ -79,9 +79,9 @@ | ||
function resolvePackageLevel(source, file, rootDirectory) { | ||
let packageDirectory = path.posix.dirname(file); | ||
let packageDirectory = path.dirname(file); | ||
for (;;) { | ||
if (fs.existsSync(path.posix.resolve(packageDirectory, 'node_modules'))) { | ||
if (fs.existsSync(path.resolve(packageDirectory, 'node_modules'))) { | ||
// found node_modules | ||
break; | ||
} else if (path.posix.parse(packageDirectory).root === packageDirectory) { | ||
} else if (path.parse(packageDirectory).root === packageDirectory) { | ||
// reached the drive root, just return null | ||
@@ -91,6 +91,6 @@ return null; | ||
packageDirectory = path.posix.resolve(packageDirectory, '..'); | ||
packageDirectory = path.resolve(packageDirectory, '..'); | ||
} | ||
return path.posix.join( // return rootDirectory if it is nested inside the packageDirectory | ||
return path.join( // return rootDirectory if it is nested inside the packageDirectory | ||
rootDirectory.startsWith(packageDirectory) ? rootDirectory : packageDirectory, // Get rid of the tilde | ||
@@ -115,7 +115,7 @@ source.slice(1)); | ||
let newSource = source.replace(foundAlias, aliases[foundAlias]); | ||
const rootDirectory = path.posix.resolve(config.rootDir); | ||
const rootDirectory = path.resolve(config.rootDir); | ||
switch (newSource[0]) { | ||
case '.': | ||
newSource = path.posix.resolve(path.posix.dirname(file), newSource); | ||
newSource = path.resolve(path.dirname(file), newSource); | ||
break; | ||
@@ -128,3 +128,3 @@ | ||
case '/': | ||
newSource = path.posix.join(rootDirectory, newSource); | ||
newSource = path.join(rootDirectory, newSource); | ||
break; | ||
@@ -138,3 +138,3 @@ // no default | ||
path: resolve$1.sync(newSource, { | ||
basedir: path.posix.resolve(), | ||
basedir: path.resolve(), | ||
extensions: [...defaultExtensions, ...config.extensions] | ||
@@ -141,0 +141,0 @@ }) |
@@ -1,2 +0,2 @@ | ||
import { posix as path } from 'path'; | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
@@ -3,0 +3,0 @@ import { isCore, sync as resolveSync } from 'resolve'; |
{ | ||
"name": "eslint-import-resolver-parcel", | ||
"description": "Parcel import resolution plugin for eslint-plugin-import.", | ||
"version": "1.10.5", | ||
"version": "1.10.6", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16142