Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yarn and eslint warnings #1597

Merged
merged 6 commits into from
Mar 18, 2024
Merged

Fix yarn and eslint warnings #1597

merged 6 commits into from
Mar 18, 2024

Conversation

robknight
Copy link
Member

@robknight robknight commented Mar 17, 2024

Closes https://linear.app/0xparc-pcd/issue/0XP-238
Closes https://linear.app/0xparc-pcd/issue/0XP-239

We have various warnings on yarn install, mostly relating to missing or incorrect peer dependencies. Some of these were because of mismatches between expected package versions and the installed versions, and were solved by upgrading the dependant packages so that the dependencies match their expected version ranges (mostly upgrading eslint to 8.x).

In addition, various @opentelemetry packages had mismatches in their dependency versions, which has been solved by pinning to specific compatible versions rather than allowing yarn to install newer but potentially incompatible dependencies.

In other cases, it was necessary to install packages as devDependencies so that the peer package would stop complaining about a missing peerDependency. This is odd, as no functional issues seemed to arise from this, but it seems like the correct thing to do is to install the missing dependency.

As a result of upgrading eslint, the fact that anon-message-client lacks an eslintrc.js or equivalent config file became a problem, as yarn lint would hang while prompting the user to decide what to do about this. So, I added a configuration file, which means that yarn lint now actually runs for anon-message-client. This threw up some simple linting issues (e.g. missing function return types) which I fixed.

Finally, I took the opportunity to make the version number explicit on the @pcd/eslint-config-custom and @pcd/tsconfig dependencies throughout the codebase. Previously we were generally using '*' as the version number, but this was flagged as an issue here.

The result is that most of the warnings have gone away. The following ones remain:

warning "workspace-aggregator-e02a239c-4952-405a-abbd-87259c138f94 > passport-client > [email protected]" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-e02a239c-4952-405a-abbd-87259c138f94 > passport-client > [email protected]" has incorrect peer dependency "react-dom@^16.8.0 || ^17.0.0".

The incorrect peer dependency for react-qr-reader comes from the fact that react-qr-reader expects a maximum React version of ^17.0.0, and we are on 18.2.x. There is an unmerged PR for this in the react-qr-reader repo from November, which looks like it would resolve the issue if merged: JodusNodus/react-qr-reader#361

@robknight robknight mentioned this pull request Mar 17, 2024
@robknight robknight changed the title [wip] Fix yarn warnings Fix yarn warnings Mar 17, 2024
@robknight robknight changed the title Fix yarn warnings Fix yarn and eslint warnings Mar 17, 2024
@robknight robknight requested a review from ichub March 18, 2024 10:29
artwyman added a commit that referenced this pull request Mar 18, 2024
This should make sure these new packages don't get missed in the bulk update in #1597.
Copy link
Contributor

@ichub ichub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing 🤩

@robknight robknight added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit db6d1dc Mar 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants