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.

eslint --init messes up binaries for projects using yarn

See original GitHub issue

eslint --init uses npm which messes up the binaries installed by yarn. This issue will affect any project using yarn.

Even worse, it also runs some packages uninstall scripts, which in the case you’re using husky will remove the installed git hooks.

An asciinema recording of the steps to reproduce the issue, and its effects, can be found here:

https://asciinema.org/a/T200B8Qgg7QepzHw5w1TbtuoC

  • eslint@4.19.1
  • Node version 10.0.0
  • npm version 5.6.0
  • yarn version 1.6.0

No eslint configuration needed to reproduce this issue.

Steps to reproduce

The following steps reproduce the issue in a test project:

mkdir eslint-init-with-yarn
cd eslint-init-with-yarn
git init .
ls -ltr .git/hooks
yarn init .
yarn add husky eslint --dev
# Check that husky created the hooks
ls -ltr .git/hooks
# Check the binaries added by yarn in the node_modules dir
ls node_modules/.bin
yarn eslint --init
# Answer with predefined AirBNB style guide, no react, using a JSON configuration file

# Check that the hooks disappeared
ls .git/hooks
# Also the binaries
ls node_modules/.bin

What did you expect to happen?

Previously binaries installed by yarn to keep existing, and the git hooks not being removed.

What actually happened? Please include the actual, raw output from ESLint.

The binaries previously installed by yarn were deleted, and the commit hooks created when installing husky also were removed (the uninstall script for husky was run).

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
elyalvaradocommented, May 1, 2018

A work around for those affected by this issue is removing your node_modules folder and running yarn install again

0reactions
not-an-aardvarkcommented, Jul 31, 2018

Thanks for confirming. Closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plug'n'Play | Yarn - Package Manager
An overview of Plug'n'Play, a powerful and innovative installation strategy for Node.
Read more >
Error: EACCES: permission denied when trying to install ...
I'm trying to install ESLint with npm ...
Read more >
Problem with creating new project , dev not running
Hi all , i made installation ,see bellow, if i run dev nothing happend. Please help , im newcomer in quasar . Installation...
Read more >
pact-js
the pact binary uses --version but I can't with the CLI in node since it messes up the CLI and thing --version is...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
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