See #15. Remove shelljs dependency and fixed typos.
This commit is contained in:
parent
eacf2329da
commit
a2dc4bd7db
|
@ -10,7 +10,6 @@ var path = require('path');
|
|||
var nopt = require('nopt');
|
||||
var extend = require('extend');
|
||||
var _ = require('lodash');
|
||||
var shjs = require('shelljs');
|
||||
|
||||
// TODO: Copied from jsbeautify, please update it from time to time
|
||||
var knownOpts = {
|
||||
|
@ -82,6 +81,10 @@ function setCursors(editor, posArray) {
|
|||
}
|
||||
}
|
||||
|
||||
function verifyExists(fullPath) {
|
||||
return fs.existsSync(fullPath) ? fullPath : null;
|
||||
}
|
||||
|
||||
// Storage for memoized results from find file
|
||||
// Should prevent lots of directory traversal &
|
||||
// lookups when liniting an entire project
|
||||
|
@ -108,7 +111,7 @@ function findFile(name, dir) {
|
|||
|
||||
var parent = path.resolve(dir, '../');
|
||||
|
||||
if (shjs.test('-e', filename)) {
|
||||
if (verifyExists(filename)) {
|
||||
findFileResults[filename] = filename;
|
||||
return filename;
|
||||
}
|
||||
|
@ -124,7 +127,7 @@ function findFile(name, dir) {
|
|||
/**
|
||||
* Tries to find a configuration file in either project directory
|
||||
* or in the home directory. Configuration files are named
|
||||
* '.jshintrc'.
|
||||
* '.jsbeautifyrc'.
|
||||
*
|
||||
* @param {string} config name of the configuration file
|
||||
* @param {string} file path to the file to be linted
|
||||
|
@ -140,7 +143,7 @@ function findConfig(config, file) {
|
|||
return proj;
|
||||
}
|
||||
|
||||
if (shjs.test('-e', home)) {
|
||||
if (verifyExists(home)) {
|
||||
return home;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
"js-beautify": "~1.5.1",
|
||||
"nopt": "^3.0.0",
|
||||
"lodash": "2.4.1",
|
||||
"shelljs": "^0.3.0",
|
||||
"strip-json-comments": "^0.1.3"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue