Comparing version 0.6.4 to 0.6.5
@@ -11,3 +11,3 @@ 'use strict'; | ||
exports.check = check; | ||
exports.default = check; | ||
@@ -224,6 +224,6 @@ var _fs = require('fs'); | ||
.map(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
file = _ref2[0], | ||
dep = _ref2[1]; | ||
var file = _ref2[0]; | ||
var dep = _ref2[1]; | ||
return [dep, _lodash2.default.times(dep.length, function () { | ||
@@ -241,5 +241,5 @@ return file; | ||
.groupBy(function (_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 1); | ||
var _ref4 = _slicedToArray(_ref3, 1), | ||
dep = _ref4[0]; | ||
var dep = _ref4[0]; | ||
return dep; | ||
@@ -273,10 +273,10 @@ }) | ||
function check(_ref5) { | ||
var rootDir = _ref5.rootDir; | ||
var ignoreDirs = _ref5.ignoreDirs; | ||
var deps = _ref5.deps; | ||
var devDeps = _ref5.devDeps; | ||
var peerDeps = _ref5.peerDeps; | ||
var optionalDeps = _ref5.optionalDeps; | ||
var parsers = _ref5.parsers; | ||
var detectors = _ref5.detectors; | ||
var rootDir = _ref5.rootDir, | ||
ignoreDirs = _ref5.ignoreDirs, | ||
deps = _ref5.deps, | ||
devDeps = _ref5.devDeps, | ||
peerDeps = _ref5.peerDeps, | ||
optionalDeps = _ref5.optionalDeps, | ||
parsers = _ref5.parsers, | ||
detectors = _ref5.detectors; | ||
@@ -287,2 +287,3 @@ var allDeps = _lodash2.default.union(deps, devDeps); | ||
}); | ||
} | ||
} | ||
module.exports = exports['default']; |
@@ -127,5 +127,5 @@ 'use strict'; | ||
}).then(function (_ref) { | ||
var deps = _ref.dependencies; | ||
var devDeps = _ref.devDependencies; | ||
return exit(opt.argv.json || deps.length === 0 && devDeps.length === 0 ? 0 : -1); | ||
var deps = _ref.dependencies, | ||
devDeps = _ref.devDependencies; | ||
return exit(opt.argv.json || (deps.length === 0 && devDeps.length) === 0 ? 0 : -1); | ||
}).catch(function (errorMessage) { | ||
@@ -132,0 +132,0 @@ error(errorMessage); |
@@ -16,3 +16,3 @@ 'use strict'; | ||
var _component = require('./component'); | ||
var _component = require('./component.json'); | ||
@@ -19,0 +19,0 @@ var _component2 = _interopRequireDefault(_component); |
@@ -22,2 +22,4 @@ 'use strict'; | ||
var _check2 = _interopRequireDefault(_check); | ||
var _utils = require('./utils'); | ||
@@ -37,3 +39,3 @@ | ||
var metadata = (0, _utils.readJSON)(_path2.default.join(rootDir, 'node_modules', dependency, 'package.json')); | ||
return metadata.hasOwnProperty('bin'); | ||
return {}.hasOwnProperty.call(metadata, 'bin'); | ||
} catch (error) { | ||
@@ -73,3 +75,3 @@ return false; | ||
return (0, _check.check)({ | ||
return (0, _check2.default)({ | ||
rootDir: rootDir, | ||
@@ -76,0 +78,0 @@ ignoreDirs: ignoreDirs, |
@@ -30,7 +30,5 @@ 'use strict'; | ||
includePaths: [_path2.default.dirname(filePath)] | ||
}); | ||
}), | ||
stats = _sass$renderSync.stats; | ||
var stats = _sass$renderSync.stats; | ||
var result = (0, _lodash2.default)(stats.includedFiles).map(function (file) { | ||
@@ -37,0 +35,0 @@ return _path2.default.relative(rootDir, file); |
@@ -57,5 +57,5 @@ 'use strict'; | ||
}).map(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
plugin = _ref2[1]; | ||
var plugin = _ref2[1]; | ||
return plugin.transforms.map(function (_ref3) { | ||
@@ -85,3 +85,3 @@ var transform = _ref3.transform; | ||
function checkOptions(deps) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -88,0 +88,0 @@ var optDeps = filter(deps, options); |
@@ -45,7 +45,6 @@ 'use strict'; | ||
function getBinaryFeatures(dep, _ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
key = _ref2[0], | ||
value = _ref2[1]; | ||
var key = _ref2[0]; | ||
var value = _ref2[1]; | ||
var binPath = _path2.default.join('node_modules', dep, value).replace(/\\/g, '/'); | ||
@@ -52,0 +51,0 @@ |
@@ -61,17 +61,39 @@ 'use strict'; | ||
function isEslintConfigAnAbsolutePath(specifier) { | ||
return _path2.default.isAbsolute(specifier); | ||
} | ||
function isEslintConfigARelativePath(specifier) { | ||
return _lodash2.default.startsWith(specifier, './') || _lodash2.default.startsWith(specifier, '../'); | ||
} | ||
function isEslintConfigAScopedModule(specifier) { | ||
return _lodash2.default.startsWith(specifier, '@'); | ||
} | ||
function isEslintConfigAFullyQualifiedModuleName(specifier) { | ||
return _lodash2.default.startsWith(specifier, 'eslint-config-'); | ||
} | ||
function resolvePresetPackage(preset, rootDir) { | ||
// inspired from https://github.com/eslint/eslint/blob/5b4a94e26d0ef247fe222dacab5749805d9780dd/lib/config/config-file.js#L347 | ||
if (_path2.default.isAbsolute(preset)) { | ||
if (isEslintConfigAnAbsolutePath(preset)) { | ||
return preset; | ||
} else if (!/\w|@/.test(preset.charAt(0))) { | ||
// first letter is not letter or '@' | ||
} | ||
if (isEslintConfigARelativePath(preset)) { | ||
return _path2.default.resolve(rootDir, preset); | ||
} else if (preset.charAt(0) === '@') { | ||
throw new Error('Not support scoped package in ESLint config.'); // TODO implementation | ||
} else if (preset.indexOf('eslint-config-') === 0) { | ||
} | ||
if (isEslintConfigAScopedModule(preset)) { | ||
var scope = preset.substring(0, preset.indexOf('/')); | ||
var module = preset.substring(preset.indexOf('/') + 1); | ||
if (isEslintConfigAFullyQualifiedModuleName(module)) { | ||
return preset; | ||
} | ||
return scope + '/eslint-config-' + module; | ||
} | ||
if (isEslintConfigAFullyQualifiedModuleName(preset)) { | ||
return preset; | ||
} else { | ||
// eslint-disable-line no-else-return | ||
return 'eslint-config-' + preset; | ||
} | ||
return 'eslint-config-' + preset; | ||
} | ||
@@ -116,3 +138,3 @@ | ||
var basename = _path2.default.basename(filename); | ||
if (basename === '.eslintrc') { | ||
if (/^\.eslintrc(\.json|\.js|\.yml|\.yaml)?$/.test(basename)) { | ||
var config = parse(content); | ||
@@ -119,0 +141,0 @@ return checkConfig(config, rootDir); |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -48,3 +48,3 @@ exports.default = getScripts; | ||
function getScripts(filepath) { | ||
var content = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
@@ -51,0 +51,0 @@ return getCacheOrFile(filepath, function () { |
@@ -11,1 +11,7 @@ /** | ||
import 'typescript'; | ||
/** | ||
* Explicitly declare istanbul at version 0.4.4, otherwise isparta is not collecting coverage data. | ||
* See https://github.com/douglasduteil/isparta/issues/126 | ||
*/ | ||
import 'istanbul'; |
{ | ||
"name": "depcheck", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "Check dependencies in your node module", | ||
@@ -23,9 +23,15 @@ "main": "dist/index.js", | ||
"prepublish": "npm run compile && npm run component", | ||
"lint": "eslint ./src ./test ./build", | ||
"lint": "node-version-gte-4 && eslint ./src ./test ./build || node-version-lt-4", | ||
"test": "babel-node node_modules/mocha/bin/_mocha ./test ./test/special --timeout 10000", | ||
"test-coverage": "babel-node node_modules/isparta/bin/isparta cover node_modules/mocha/bin/_mocha -- ./test ./test/special --timeout 10000" | ||
}, | ||
"author": [ | ||
"Djordje Lukic <lukic.djordje@gmail.com>", | ||
"Junle Li <lijunle@gmail.com>" | ||
"author": { | ||
"name": "Djordje Lukic", | ||
"email": "lukic.djordje@gmail.com" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Junle Li", | ||
"email": "lijunle@gmail.com" | ||
} | ||
], | ||
@@ -48,3 +54,3 @@ "keywords": [ | ||
"builtin-modules": "^1.1.1", | ||
"deprecate": "^0.1.0", | ||
"deprecate": "^1.0.0", | ||
"deps-regex": "^0.1.4", | ||
@@ -56,7 +62,7 @@ "js-yaml": "^3.4.2", | ||
"walkdir": "0.0.11", | ||
"yargs": "^4.0.0" | ||
"yargs": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.1.1", | ||
"babel-eslint": "^6.0.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
@@ -68,15 +74,17 @@ "babel-plugin-transform-object-assign": "^6.1.18", | ||
"depcheck-web": "^0.1.0", | ||
"eslint": "^2.4.0", | ||
"eslint-config-airbnb": "^9.0.0", | ||
"eslint-plugin-import": "^1.8.1", | ||
"eslint-plugin-jsx-a11y": "^1.5.3", | ||
"eslint-plugin-react": "^5.2.2", | ||
"fs-promise": "^0.5.0", | ||
"eslint": "^3.10.1", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.7.0", | ||
"fs-promise": "^1.0.0", | ||
"isparta": "^4.0.0", | ||
"mocha": "^2.1.0", | ||
"istanbul": "0.4.4", | ||
"mocha": "^3.0.0", | ||
"node-sass": "^3.4.0", | ||
"node-version-check": "^2.1.1", | ||
"patch-version": "^0.1.1", | ||
"should": "^9.0.0", | ||
"should": "^11.0.0", | ||
"typescript": "^1.8.0" | ||
} | ||
} |
@@ -10,3 +10,2 @@ # depcheck | ||
[![codecov.io](https://codecov.io/github/depcheck/depcheck/coverage.svg?branch=master)](https://codecov.io/github/depcheck/depcheck?branch=master) | ||
[![depcheck](https://depcheck.tk/github/depcheck/depcheck/master.svg)](https://github.com/depcheck/depcheck) | ||
@@ -13,0 +12,0 @@ [![Dependency Status](https://david-dm.org/depcheck/depcheck.svg)](https://david-dm.org/depcheck/depcheck) |
Sorry, the diff of this file is not supported yet
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
68716
1246
1
22
205
+ Addeddeprecate@1.1.1(transitive)
+ Addedyargs@6.6.0(transitive)
+ Addedyargs-parser@4.2.1(transitive)
- Removeddeprecate@0.1.0(transitive)
- Removedlodash.assign@4.2.0(transitive)
- Removedwindow-size@0.2.0(transitive)
- Removedyargs@4.8.1(transitive)
- Removedyargs-parser@2.4.1(transitive)
Updateddeprecate@^1.0.0
Updatedyargs@^6.0.0