Help us understand the problem. What is going on with this article?

Atomのgit-controlでPushができないと思ったら、pre-commitでeslintにより弾かれていた件

これはTOWN Advent Calendar 2019 23日目のエントリーです。

Atomのgit-controlプラグインを使ってGitの操作をしているのですが、コミットはできるもののプッシュができない(ボタンが選択可能にならない)現象が発生しました。
(よくよく見ると画面の下の方にエラーが出ていたのですが最初気がつかづ。。。)

こういうときには面倒ですがTerminalからコマンドを直接入力して確認をしてみます。

% git commit
husky > pre-commit (node v13.5.0)
  ✔ Stashing changes...
  ❯ Running linters...
    ❯ Running tasks for *.{js,vue}
      ✖ eslint
  ↓ Updating stash... [skipped]
    → Skipping stash update since some tasks exited with errors
  ✔ Restoring local changes...



✖ eslint found some errors. Please fix them and try committing again.

/project/plugins/firestore.js
  1:28  error  Delete `;`  prettier/prettier
  2:42  error  Delete `;`  prettier/prettier
  4:32  error  Delete `;`  prettier/prettier
  7:18  error  Delete `;`  prettier/prettier

✖ 4 problems (4 errors, 0 warnings)
  4 errors and 0 warnings potentially fixable with the `--fix` option.

husky > pre-commit hook failed (add --no-verify to bypass)

どうやらpre-commit時にeslintが効いてコミットが弾かれている、ということがわかります。

該当するファイルを修正して再度コミットすることでPushができるようになりました。

スクリーンショット 2019-12-23 22.57.49.png

git-controlは画面上のウィンドウサイズをを変更できないので長いログが出たときに見落としがちなので注意です。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした