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

build/no-extraneous-dependencies #510

Merged
merged 2 commits into from Nov 8, 2022
Merged

Conversation

rhyslbw
Copy link
Member

@rhyslbw rhyslbw commented Nov 7, 2022

Context

We have quite a few issues with the package dependencies, which is not unexpected, given the lack of enforcement and this being such a tedious aspect of maintaining a monorepo with Node.js' inferred dependencies design.

Proposed Solution

This rule, with the configuration to specify test files, ensures packages used in src are listed in the package.json dependencies. It will fail if missing or if the dependency is included with devDependencies. Development dependencies are checked against the test directories.

Important Changes Introduced

There's a single disable as it's complaining about transitive dependency on @types/pg missing from dependencies. We can see if the feature added in import-js/eslint-plugin-import#2543 handles this scenario once released.
New similar imports may need to be overruled moving forward, but I only found one case in the whole workspace, so don't expect it to be a frequently occurring situation.

@rhyslbw rhyslbw requested review from mkazlauskas, mirceahasegan and a team and removed request for mirceahasegan November 7, 2022 15:09
mkazlauskas
mkazlauskas previously approved these changes Nov 7, 2022
Copy link
Member

@mkazlauskas mkazlauskas left a comment

Choose a reason for hiding this comment

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

Nice, quite a few missing deps added! 💪

I hope the new eslint rule didn't add too much to our lint time. How long did it take to commit?

mirceahasegan
mirceahasegan previously approved these changes Nov 7, 2022
Copy link
Contributor

@mirceahasegan mirceahasegan left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@rhyslbw
Copy link
Member Author

rhyslbw commented Nov 7, 2022

How long did it take to commit?

No noticeable difference 🧘

@rhyslbw rhyslbw force-pushed the build/no-extraneous-dependencies branch from 373c348 to 341b8f0 Compare November 7, 2022 15:28
@rhyslbw rhyslbw changed the title Build/no-extraneous-dependencies build/no-extraneous-dependencies Nov 7, 2022
mirceahasegan
mirceahasegan previously approved these changes Nov 7, 2022
@rhyslbw rhyslbw force-pushed the build/no-extraneous-dependencies branch 2 times, most recently from 75108d9 to 858dcf0 Compare November 8, 2022 04:30
…pendencies

This rule, with the configuration to specify test files, ensures packages used in `src` are listed
in the package.json `dependencies`. It will fail if missing or if the dependency is included with
`devDependencies`. Development dependencies are checked against the test directories.

There's a single disable as it's complaining about transitive dependency on `@types/pg` missing
from `dependencies`. We can see if the feature added in
import-js/eslint-plugin-import#2543 handles this scenario once released.
@rhyslbw rhyslbw force-pushed the build/no-extraneous-dependencies branch from 858dcf0 to 35f7fc9 Compare November 8, 2022 04:33
@rhyslbw rhyslbw merged commit 6d66d7a into master Nov 8, 2022
@rhyslbw rhyslbw deleted the build/no-extraneous-dependencies branch November 8, 2022 05:16
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.

None yet

4 participants