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.

Add silent flag to avoid default node error message on --fix

See original GitHub issue

Not clear how to run xo --fix in silent mode to avoid the exit code 1 error displayed. Please advice. Thanks 😃

18:19 $ npm run fix

> nodelib-2017@1.0.0 fix /Users/kristianmandrup/repos/node-libs/nodelib-2017
> xo --fix --quiet


  src/a.test.js:2:8
  ✖  2:8  goofy is defined but never used.  no-unused-vars

  1 error

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "fix"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! nodelib-2017@1.0.0 fix: `xo --fix --quiet`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nodelib-2017@1.0.0 fix script 'xo --fix --quiet'.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fridaycommented, Nov 6, 2016

You can add || true after the xo command. It would have the same effect as the -s flag

  "scripts": {
    "fix": "xo --fix || true"
  }
0reactions
fregantecommented, Aug 6, 2022

Closing as resolved. || true is the native way to do this and it’s shorter than any flag ever could.

Eslint doesn’t offer such a flag either https://eslint.org/docs/latest/user-guide/command-line-interface

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to suppress output when running npm scripts
All scripts: You can fix this by suppressing the output of npm overall, by setting the log level to silent in a couple...
Read more >
Command-line API | Node.js v19.3.0 Documentation
To prevent from an existing add-on from crashing the process, this flag is not enabled by default. In the future, this flag will...
Read more >
[BUG] npm ci can't resolve dependencies without --force, or ...
Fix the upstream dependency conflict, or retry npm ERR! this command ... May you can add any flags that work like "--force" before...
Read more >
Command Line Interface - 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 >
config | npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else...
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