-
Notifications
You must be signed in to change notification settings - Fork 90
build: add missing test dependencies to package workspaces to fix lint warnings #1461
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
base: master
Are you sure you want to change the base?
build: add missing test dependencies to package workspaces to fix lint warnings #1461
Conversation
danielpeintner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 👍
There is a CI consistency check that fails, see https://github.com/eclipse-thingweb/node-wot/actions/runs/20891164482/job/60048975528?pr=1461
eslint.config.mjs
Outdated
|
|
||
| // *************** Ensure that only used dependencies are imported *************** | ||
| "extraneous-dependencies/no-extraneous-dependencies": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430 | ||
| "extraneous-dependencies/no-extraneous-dependencies": "warn", // https://github.com/eclipse-thingweb/node-wot/issues/1430 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "extraneous-dependencies/no-extraneous-dependencies": "warn", // https://github.com/eclipse-thingweb/node-wot/issues/1430 | |
| "extraneous-dependencies/no-extraneous-dependencies": "warn", |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1461 +/- ##
==========================================
- Coverage 77.44% 77.42% -0.02%
==========================================
Files 83 83
Lines 15826 15826
Branches 1506 1503 -3
==========================================
- Hits 12256 12253 -3
- Misses 3545 3549 +4
+ Partials 25 24 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const packageDirs = [__dirname]; | ||
| const packagesRoot = path.join(__dirname, "packages"); | ||
| if (fs.existsSync(packagesRoot)) { | ||
| fs.readdirSync(packagesRoot).forEach((dir) => { | ||
| const pkgPath = path.join(packagesRoot, dir, "package.json"); | ||
| if (fs.existsSync(pkgPath)) { | ||
| packageDirs.push(path.join(packagesRoot, dir)); | ||
| } | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reasons why we are collecting all the package directories?
| "extraneous-dependencies/no-extraneous-dependencies": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430 | ||
| // Default rule for root files | ||
| "extraneous-dependencies/no-extraneous-dependencies": [ | ||
| "warn", | ||
| { | ||
| packageDir: [__dirname], | ||
| }, | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we don't simply apply it to all?
Summary
This PR fixes
extraneous-dependencies/no-extraneous-dependencieswarnings while preserving the monorepo’s single-source-of-truth policy for shared dependencies.closes #1442
Test libraries remain declared only in the root
package.json. ESLint is updated to be monorepo-aware so workspace packages can correctly resolve hoisted dependencies.Changes
package.jsonfileseslint.config.mjsto validate dependencies against both root and workspace manifestsResult
npm run lintpassesnpm run check:versionspasses