rubocoplint-staged

Lintstaged process is stuck when running rubocop command


I try to lint my .rb files while committing.

Here is my .lintstagedrc file:

{
    "*.rb": [
      "bundle exec rubocop --require rubocop-airbnb",
    ]
}

Lint-staged is setup with husky.

When I change a .rb file, it tries to run the command but it is stuck. I tried to run the command with the debug flags on, but I did not see any useful information:

lint-staged:bin Running `lint-staged@15.2.0` on Node.js v18.19.0 (darwin) 
....
....
....
....
[COMPLETED] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] .lintstagedrc — 3 files
[STARTED] *.rb — 1 file
[STARTED] *.erb — 0 files
[SKIPPED] *.erb — no files
[STARTED] bundle exec rubocop --version
=> Froze

What can be the root cause?

Env


Solution

  • This problem was fixed by v15.2.1. Try to update lint-staged.