Thinkmill / manypkg

☔️ An umbrella for your monorepo
MIT License
884 stars 48 forks source link

feature request: some way to ignore warnings. #80

Closed threepointone closed 3 years ago

threepointone commented 3 years ago

Great package, thank you. Conceptually I like to think of this as an analogue to eslint, but for monorepos. However, there are times when I want to be able to ignore warnings and not have them show up, much like // eslint-ignore. Specific usecase - I'm working on a codebase that needs to load multiple versions of react/react-dom on a page. (very similar to as described in https://reactjs.org/blog/2020/08/10/react-v17-rc.html#gradual-upgrades / https://github.com/reactjs/react-gradual-upgrade-demo/). As you can imagine, @manypkg/cli check gives an error in this circumstance, because it expects only a single version of a package to be used in a monrepo. I'd like to somehow silence this warning on a case by case basis. I'm not sure what this exception would look like. Maybe a field in that workspace's package.json like -

"manypkg-ignore: {
  "ignore": ["react", "react-dom"]
}

Please and thank you!

emmatown commented 3 years ago

We've been wanting a way to generically ignore errors but haven't got one yet though for the specific rule you're talking about, you can use anything that isn't a valid range such as npm:pkg-name@range and Manypkg will ignore it but package managers will install the package at the range specified.

{
  "dependencies": {
    "react": "npm:react@17"
  }
}
threepointone commented 3 years ago

Sorry I missed this, thanks, that's a great tip! Closing this issue.