Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Chore: remove path-is-absolute in favor of the built-in (fixes #6598) (
  • Loading branch information
shinnn authored and gyandeeps committed Jul 4, 2016
1 parent 7a63717 commit 8308c0b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lib/cli-engine.js
Expand Up @@ -20,7 +20,6 @@ var fs = require("fs"),

lodash = require("lodash"),
debug = require("debug"),
isAbsolute = require("path-is-absolute"),

rules = require("./rules"),
eslint = require("./eslint"),
Expand Down Expand Up @@ -740,7 +739,7 @@ CLIEngine.prototype = {
ignoredPaths = new IgnoredPaths(options);

// resolve filename based on options.cwd (for reporting, ignoredPaths also resolves)
if (filename && !isAbsolute(filename)) {
if (filename && !path.isAbsolute(filename)) {
filename = path.resolve(options.cwd, filename);
}
if (filename && warnIgnored && ignoredPaths.contains(filename)) {
Expand Down
5 changes: 2 additions & 3 deletions lib/config/config-file.js
Expand Up @@ -23,7 +23,6 @@ var debug = require("debug"),
stripBom = require("strip-bom"),
stripComments = require("strip-json-comments"),
stringify = require("json-stable-stringify"),
isAbsolutePath = require("path-is-absolute"),
defaultOptions = require("../../conf/eslint.json"),
requireUncached = require("require-uncached");

Expand Down Expand Up @@ -81,7 +80,7 @@ function readFile(filePath) {
* @private
*/
function isFilePath(filePath) {
return isAbsolutePath(filePath) || !/\w|@/.test(filePath.charAt(0));
return path.isAbsolute(filePath) || !/\w|@/.test(filePath.charAt(0));
}

/**
Expand Down Expand Up @@ -382,7 +381,7 @@ function applyExtends(config, filePath, relativeTo) {
* If the `extends` path is relative, use the directory of the current configuration
* file as the reference point. Otherwise, use as-is.
*/
parentPath = (!isAbsolutePath(parentPath) ?
parentPath = (!path.isAbsolute(parentPath) ?
path.join(relativeTo || path.dirname(filePath), parentPath) :
parentPath
);
Expand Down
7 changes: 3 additions & 4 deletions lib/util/path-util.js
Expand Up @@ -8,8 +8,7 @@
// Requirements
//------------------------------------------------------------------------------

var path = require("path"),
isAbsolute = require("path-is-absolute");
var path = require("path");

//------------------------------------------------------------------------------
// Private
Expand Down Expand Up @@ -51,11 +50,11 @@ function convertPathToPosix(filepath) {
function getRelativePath(filepath, baseDir) {
var relativePath;

if (!isAbsolute(filepath)) {
if (!path.isAbsolute(filepath)) {
filepath = path.resolve(filepath);
}
if (baseDir) {
if (!isAbsolute(baseDir)) {
if (!path.isAbsolute(baseDir)) {
throw new Error("baseDir should be an absolute path");
}
relativePath = path.relative(baseDir, filepath);
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -59,7 +59,6 @@
"lodash": "^4.0.0",
"mkdirp": "^0.5.0",
"optionator": "^0.8.1",
"path-is-absolute": "^1.0.0",
"path-is-inside": "^1.0.1",
"pluralize": "^1.2.1",
"progress": "^1.1.8",
Expand Down

0 comments on commit 8308c0b

Please sign in to comment.