Berry: [Bug] lint-staged is not compatible

Created on 22 Jan 2020  Â·  4Comments  Â·  Source: yarnpkg/berry

  • [ ] I'd be willing to implement a fix

Describe the bug

I tried out yarn v2 last night, and found that my prettier pre-commit hooks using husky and lint-staged were broken. As far as I can tell, it is because of an issue in a sub-dependency, listr: https://github.com/SamVerschueren/listr/pull/127

I don't think any action is necessarily required by yarn, but wanted to at least document a problem I had when trying out berry.

As a workaround, I was able to explicitly add rxjs@6 to my devDependencies.

bug external bug

Most helpful comment

This should be fixed in master as of #733 (which adds support for builtin package extensions, as an experiment).

All 4 comments

We actually use both lint-staged (9.2.5) and Husky (^4) at work so I'm surprised 🤔

I'm using lint-staged@10, so that could be the difference. ¯\_(ツ)_/¯

Ah! We had rxjs in our dependencies too, hence why I couldn't reproduce it. As a workaround for anyone finding this, the right fix is to add the following into your .yarnrc.yml:

packageExtensions:
  "@samverschueren/stream-to-observable@*":
    peerDependenciesMeta:
      rxjs:
        optional: true
      zen-observable:
        optional: true
  "any-observable@*":
    peerDependenciesMeta:
      rxjs:
        optional: true
      zen-observable:
        optional: true

This should be fixed in master as of #733 (which adds support for builtin package extensions, as an experiment).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisands picture chrisands  Â·  3Comments

benwainwright picture benwainwright  Â·  3Comments

tiansijie picture tiansijie  Â·  4Comments

milichev picture milichev  Â·  3Comments

janicduplessis picture janicduplessis  Â·  4Comments