question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline script commands in package.json are ignored

See original GitHub issue

Reopening #257

When a dependency is only used inside parenthesis of another command in package.json scripts, depcheck marks this dependency as unused. e.g.:

  "scripts": {
    "start": "concurrently \"cross-env BROWSER=none yarn browser\" \"wait-on http://localhost:3000 && electron .\""
  },
  "devDependencies": {
    "concurrently": "^3.5.1",
    "cross-env": "^5.1.6",
    "wait-on": "^2.1.0"
  }

Here, cross-env and wait-on are marked as unused.

This problem also happens with husky and jest

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rauno56commented, Apr 21, 2021

Using cross-env in scripts is a common usecase depcheck doesn’t catch so the parentheses real or imaginary, do not seem to matter. Somewhat more simple example for a script:

...
  "scripts": {
    "run": "cross-env PORT=8080 node ./server.js"
  },
...
0reactions
stale[bot]commented, Aug 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline script commands in package.json are ignored · Issue #672 ...
Reopening #584 and #257 When a dependency is only used inside parenthesis of another command in package.json scripts, depcheck marks this dependency as ......
Read more >
Sending command line arguments to npm script - Stack Overflow
Sending a command line argument to an npm script ... having them appended to the end, then inline environment variables seem to work...
Read more >
npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >
Configuring ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Configuration options | Yarn - Package Manager
Files matching the following patterns (in terms of relative paths compared to the root of the project) will be ignored by the yarn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found