Search code examples
lint-staged

Lint-staged aborts check with the first failing file; "Error: Unknown argument"


With "lint-staged": "^13.0.3" and the following .lintstagedrc config:

{
  "src/**/*.{ts,html}": [
    "ng lint"
  ],
  "src/**/*.scss": [
    "npx stylelint **/*.scss"
  ]
}

I'm trying to run npx lint-staged -q on the following files (all of them have lint problems that would come up with the individual lint command):

enter image description here

Running ng lint and npx stylelint **/*.scss directly will bring up the problems (detailed) and would not fail on the first file:

ng lint

enter image description here

npx stylelint **/*.scss

enter image description here

I'd like lint-staged's output to show all of the problems from the individual lint commands. What's wrong here?

Thanks


Solution

  • Ok, after further investigation;

    1. The partial output problems seem to be introduced to lint-staged on versions >= 12.2.0, see on github. I've downgraded to "lint-staged": "12.1.7" and the problem seems to be gone.

    2. Regarding the Unknown argument thing, it resolves by calling eslint instead of ng lint on the configuration file.