Coder Social home page Coder Social logo

dependency-lint's People

Contributors

charlierudolph avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dependency-lint's Issues

Windows support

Dependency Lint appears to run some bash scripts that don't work on windows, is this reasonably easy to resolve?

C:\WORK\2017Q1\wdc-node-sdk\node_modules\.bin\dependency-lint:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\WORK\2017Q1\wdc-node-sdk\test\dependency-lint.js:4:3)
    at Module._compile (module.js:541:32)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] lint: `npm run compat-check && eslint . && node test/dependency-lint.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script 'npm run compat-check && eslint . && node test/dependency-lint.js

See watson-developer-cloud/node-sdk#394 (comment) for context

Ignore npm module

If you have npm is in your local node_modules and you have an npm run in one of your scripts, then npm is believed to be a dependency or devDependency.

npm is a top level module without which nothing would work anyway. Just ignore npm.

Always errors

Hi,
I'm using it on windows, installed globally.

D:\MyProject>npm install -g dependency-lint
C:\Users\<pcUser>\AppData\Roaming\npm\dependency-lint -> C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\bin\dependency-lint.js
+ [email protected]
added 45 packages from 35 contributors in 4.64s

D:\MyProject>dependency-lint --generate-config
Configuration file generated at "dependency-lint.yml"

D:\MyProject>dependency-lint
SyntaxError: index.js: 'return' outside of function (5:3)
    at Object.raise (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:6322:17)
    at Object.parseReturnStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10124:12)
    at Object.parseStatementContent (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9811:21)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9763:17)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:2019:26)
    at Object.parseBlockOrModuleBlockBody (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10340:25)
    at Object.parseBlockBody (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10327:10)
    at Object.parseBlock (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10311:10)
    at Object.parseStatementContent (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9839:21)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9763:17)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:2019:26)
    at Object.parseIfStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10117:28)
    at Object.parseStatementContent (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9808:21)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:9763:17)
    at Object.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:2019:26)
    at Object.parseBlockOrModuleBlockBody (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\@babel\parser\lib\index.js:10340:25)

D:\MyProject>cd webapp

D:\MyProject\webapp>dependency-lint
SyntaxError: myfolder/myfile.js: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
    at _class.pp$4.raise (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn\dist\acorn.js:2844:13)
    at _class.pp$1.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn\dist\acorn.js:859:16)
    at _class.parseStatement (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn-dynamic-import\lib\index.js:63:118)
    at _class.pp$1.parseTopLevel (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn\dist\acorn.js:749:23)
    at _class.parse (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn\dist\acorn.js:552:15)
    at Function.parse (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn\dist\acorn.js:575:35)
    at Object.parse (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\acorn-node\index.js:26:28)
    at parse (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:22:18)
    at Function.exports.find (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:47:15)
    at module.exports (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:26:20)
    at RequiredModuleFinder.findInFile (C:\Users\<pcUser>\AppData\Roaming\npm\node_modules\dependency-lint\dist\linter\used_module_finder\required_module_finder.js:94:53)

The proj works perfectly.
1st run is an electron proj
2nd a react proj

I don't understaand if i can set this plugin ignoring those errors and how.
Thanks

Recognize modules used in circle.yml

Some modules are only used on the CI server, for example coveralls. It would be nice if this is automatically recognized. Maybe this can be generalized into dependency-lint being able to recognize any binaries in YML files?

add option quite in CLI

I would like to have a possible output only when there are errors, i can do PR for this if accepted

Simpler dependency-lint.yml file

Some random ideas after reviewing this in one of my projects. Instead of adding so much explanation and type information into the documentation, maybe its better to provide a well documented example file in the documentation and link to that from here? This also makes upgrading this file easier, in case future versions of dependency-lint use more or different options.

# see https://github.com/charlierudolph/dependency-lint-example for an example

# modules that don't have to be used
allowUnused: []

# files only used in development
devFiles:
  - '{features,spec}/**/*'
  - '**/*_spec.coffee'
  - gulpfile.coffee
  - mycha.coffee

# scripts only used in development
devScripts:
  - build
  - lint
  - publish
  - test

# files to be linted
files: '**/*.coffee'

# don't lint these files
ignoreFilePatterns:
  - 'dist/**/*'
  - 'node_modules/**/*'

# ignore webpack loaders when evaluating requires
# example:
#   require('foo!bar!baz')
# is equivalent to:
#   require('baz')
stripLoaders: false


transpilers:
  - extension: .coffee
    module: coffee-script

Modules listed in transpilers should implicitly be allowUnsued

If I am building my project in a compile-to-js language, I'm probably going to want that package as a devDependency for my build script, but I'm most likely not going to be requiring it anywhere in my project.

I think dependency lint should automatically include any modules listed under transpilers in the allowUnused section.

Thoughts?

Version checking breaks private modules

Our project uses modules that we host in private Bitbucket repos. These dependencies appear in our package.json as

dependencies: {
    "api-entity": "git+ssh://[email protected]:username/repo-name.git#1.0.2"
}

When running dependency-lint for this project, the following error is thrown:

Error: The following modules listed in your `package.json` have issues:
  api-entity (installed: 1.0.2, listed: git+ssh://[email protected]:username/repo-name.git#1.0.2)
All modules need to be installed with the correct semantic version
to properly check for the usage of a module's executables.

plugin support

In order to reduce the number of modules that end up ignoreErrors - unused, I think it would be interesting to try allowing plugins.

A plugin could be something that exports a function that returns a promise which resolves to the an array of the modules it determines are used. The function will be passed in the file path to the project and can search through whatever files it would like

An examples: webpack - read the config file, look through the loaders list and determine the name of the modules that webpack is requiring

Most of these would hopefully be very small functions. @kevgo @alexdavid thoughts?

finding module executables

currently finding module executables by looking in the package.json files of whatever is a direct child of the node_modules folder. With npm 3 this will no longer be valid as the node_modules folder will be flat. Instead looking in the node_modules/.bin folder and follow the symlinks.

--auto-correct should not delete dependencies listed in ignoreErrors.unused

I have several things listed in my ignoreErrors.unused:

ignoreErrors:
  missing: []
  shouldBeDependency: []
  shouldBeDevDependency: []
  unused:
    # babel plugins
    - babel-plugin-add-module-exports
    - babel-plugin-transform-object-assign
    - babel-preset-es2015
    - babel-preset-react
    - babel-preset-stage-0

    # browserify plugins
    - babelify
    - browserify-global-shim
    - minifyify
    - uglifyify

    # eslint plugins
    - eslint-config-airbnb
    - eslint-plugin-import
    - eslint-plugin-jsx-a11y
    - eslint-plugin-react

    # css dependencies
    - watson-ui-component

When I run dependency-lint these are ignored as expected. However, when I run dependency-lint --auto-correct they are again reported as ignored, but are actually "fixed" (deleted from package.json). This, of course, actually breaks things.

Ignore hidden folders in node_modules

Alternative package managers like ied or pnpm create hidden folders in node_modules, comparable to Git's file-based object storage in .git. These folders should be ignored by dependency-lint, since they are referenced via symlinks as needed (see issue #29).

In real life, this causes a false positive error:

devDependencies:
    ✖ .cas (missing)
        used in files:
          bin/spec
          bin/tests

Dependency-lint finds binaries in node_modules/.cas, which it also finds being used, and assumes .cas is an unused NPM module. The solution is to ignore folders in node_modules whose name begins with a period.

-bash: dependency: command not found

Hi, I am trying to use this module. I installed it via npm install dependency-lint --save-dev but when I use in my terminal I get -bash: dependency: command not found

--autocorrect

Add --autocorrect option which

  • installs missing dependencies
  • moves mislabeled dependencies
  • prompts the user for what to do with each unused dependency (remove or allow unused)

support es6

Needs the ability to recognize import statements

webpack and dependency-lint

I am use context option for webpack, it is allow use require('shared/js/polyfills'), but i if run dependency-lint i get error:

devDependencies:
  ✖ shared (missing)
      used in files:
        src/containers/app/app.js

Perhaps it is worth adding an option to avoid such situations and right interpretation require paths.

Make --auto-correct only return an error code if uncorrected errors remain

I can see an argument for the current behavior, but I think that dependency-lint --auto-correct should work similar to eslint . --fix in that fixed errors do not count against the total errors, and if all errors were successfully fixed, then it should return 0 (no error).

Rather then ending with "✖ 1 error", it could say

✓ 1 correction
✓ 0 errors

For the moment, I'm currently putting dependency-lint --auto-correct || dependency-lint in my npm script.

BTW, this is a great tool either way, and I'm definitely going to be using it in more projects.

Error throwed when linting webpack project

This was output when trying to lint React.js project built with webpack (thus using a lot of import even for resources like scss files).

C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:1747
  throw err;
        ^
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2:0)
  at Parser.pp.raise (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:1745:13)
  at Parser.pp.parseStatement (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:2450:34)
  at Parser.pp.parseTopLevel (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:2379:21)
  at Object.parse (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:101:12)
  at parse (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:10:18)
  at Function.exports.find (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:45:15)
  at module.exports (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\detective\index.js:24:20)
  at RequiredModuleFinder.findInContent (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\src\linter\used_module_finder\required_module_finder.coffee:53:19)
  at C:\****\AppData\Roaming\npm\node_modules\dependency-lint\src\linter\used_module_finder\required_module_finder.coffee:32:21
  at fn (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:717:34)
  at C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:1170:16
  at C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:172:37
  at C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:677:43
  at C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:173:37
  at Object._onImmediate (C:\****\AppData\Roaming\npm\node_modules\dependency-lint\node_modules\async\lib\async.js:1163:34)
  at processImmediate [as _immediateCallback] (timers.js:345:15)

Incorrectly assumes missing "rc" dependency

My project has "rc" as a dependency, which exports an "rc" binary. Dependency-lint finds "rc" in many of my scripts, wrongfully assuming "rc" is used. The regex dependency-lint uses to find occurrences of binaries should wrap the binary name in word boundaries (\b) to make this search more robust.

Validate package versions

Say that I have a package.json like the following:

{
  "dependencies": {
    "lodash": "^4.3.0"
  }
}

But in my node_modules directory, I have version 3.10.1 of lodash installed.

When I require('lodash') in a program, Node does not warn me that version of the package fails to satisfy my semver requirements. This can cause confusing errors, e.g. when one works on a Node.js project and switches to a branch which requires an updated version of a library, but forgets to run npm install.

Therefore, I think it'd be valuable if this package would check for failures to satisfy semver requirements.

Search shell scripts for module executables

Sometimes module executables are just used in executable shell scripts. Look for executable files with a shebang that is either sh or bash. Will need to add a configuration option for devExecutables as well

Support for NPM modules used via CLI *and* JS API

I am using a tool that provides both a CLI as well as a JS API for running Node code bases. It is called Exoservice. Here is how it is used:

  • in production, you run exo-js on the command line in the current directory to boot up the app
  • during testing, my tests require the exoservice module and create a new Exoservice instance to run the code base. This has the advantage that it is much faster since no new subshell and Node process has to be forked, and I have more control over the instance this way.

Repo to reproduce the issue: https://github.com/Originate/exosphere-tweets-service

All NPM modules that expose CLIs (Mocha, NPM, Cucumber, etc) do - or should - behave this way.

In this situation, dependency-lint thinks that exoservice should be a devDependency, because it is only required in dev code (my tests). It doesn't know that I am also using it on the command line in production.

The most ideal scenario would be to teach dependency-lint to also parse shell scripts in the code base, so that it knows what is really going on.

The second best solution would be a config option that allows me to overrule/ignore any dependency-lint warning if I have to. Having a little AI that tries to help me by reasoning about my code is nice, but there are a whole range of situations that are more complex than it can understand, so dependency-lint (or any other tool) should never have the last word in something. That should always be the human user.

*-sass in unused causes errors

Hi,

I added a - *-sass line under unused: in my config file, and suddenly it couldn't load at all. This might be a bug in the dependencies, but I figured I'd report it here first.

The codebase I'm working on uses eyeglass to enabling loading sass modules via npm. Most of these are named things like modularscale-sass or breakpoint-sass, etc. I tried just adding a wildcard rule, but it fails like so:

Error
    at generateError (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
    at throwError (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
    at readAlias (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1248:5)
    at composeNode (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1340:20)
    at readBlockMapping (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1008:16)
    at composeNode (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readBlockSequence (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:927:5)
    at composeNode (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1330:12)
    at readBlockMapping (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1061:11)
    at composeNode (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readBlockMapping (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1061:11)
    at composeNode (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readDocument (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1493:3)
    at loadDocuments (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1549:5)
    at load (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1566:19)
    at Object.safeLoad (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/js-yaml/lib/js-yaml/loader.js:1584:10)

I also tried adding it in quotes: - '*-sass' and that got me a different error:

SyntaxError: Invalid regular expression: /*-sass/: Nothing to repeat
    at String.match (native)
    at /Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/dependency_linter.js:83:21
    at arraySome (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/lodash/lodash.js:747:11)
    at Function.some (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/lodash/lodash.js:9914:14)
    at DependencyLinter.isErrorIgnored (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/dependency_linter.js:82:16)
    at /Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/dependency_linter.js:69:39
    at Array.forEach (native)
    at DependencyLinter.lint (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/dependency_linter.js:67:17)
    at DependencyLinter.lint (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/dependency_linter.js:3:59)
    at Linter.<anonymous> (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/dist/linter/index.js:41:36)
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/bluebird/js/release/generators.js:97:49)
    at Promise._settlePromise (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/nfriedly/.nvm/versions/node/v7.1.0/lib/node_modules/dependency-lint/node_modules/bluebird/js/release/promise.js:691:18)

dependency-lint fails ONLY when run from npm run script

I've encountered a problem. After installing dependency-lint into my project I can run it just fine from
./node_modules/.bin/dependency-lint
...but if I put it inside an npm script is will run but error out at the very end.

EXAMPLE package.json:
{ "name": "DLINT'", "description": "dependency-lint NOT WORKING from 'npm run dependency-lint", "scripts": { "dependency-lint": "dependency-lint" }, "dependencies": { "webpack": "^2.3.2" }, "devDependencies": { "dependency-lint": "^5.0.1" } }

NPM RUN SCRIPT:
$ npm run dependency-lint

RESULTS IN OUTPUT (WITH ERROR):
`
[email protected] pretest /Users/user/workspace/dlint
dependency-lint

dependencies:
✖ webpack (unused)

✖ 1 error

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] pretest: dependency-lint
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] pretest script 'dependency-lint'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the DLINT package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! dependency-lint
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs DLINT
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls DLINT
npm ERR! There is likely additional logging output above.
`

dependency-lint error

Hi,

Hi,

We have tested the dependency-lint package with a sample todo react app. Can you guys tell me why this error is happening.

D:\todomvc>.\node_modules.bin\dependency-lint
D:\todomvc\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:1747
throw err;
^
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
at Parser.pp.raise (D:\todomvc\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:1745:13)
at Parser.pp.parseStatement (D:\todomvc\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:2450:34)
at Parser.pp.parseTopLevel (D:\todomvc\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:2379:21)
at Object.parse (D:\todomvc\node_modules\dependency-lint\node_modules\detective\node_modules\acorn\dist\acorn.js:101:12)
at parse (D:\todomvc\node_modules\dependency-lint\node_modules\detective\index.js:10:18)
at Function.exports.find (D:\todomvc\node_modules\dependency-lint\node_modules\detective\index.js:45:15)
at module.exports (D:\todomvc\node_modules\dependency-lint\node_modules\detective\index.js:24:20)
at RequiredModuleFinder.findInContent (D:\todomvc\node_modules\dependency-lint\src\linter\used_module_finder\required_module_finder.coffee:53:19)
at D:\todomvc\node_modules\dependency-lint\src\linter\used_module_finder\required_module_finder.coffee:32:21
at fn (D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:717:34)
at D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:1170:16
at D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:172:37
at D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:677:43
at D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:173:37
at Immediate._onImmediate (D:\todomvc\node_modules\dependency-lint\node_modules\async\lib\async.js:1163:34)
at processImmediate as _immediateCallback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.