refactor(cli-hooks): use optional chaining check to gather project dependencies#2548
refactor(cli-hooks): use optional chaining check to gather project dependencies#2548zimeg merged 3 commits intoslackapi:mainfrom
Conversation
🦋 Changeset detectedLatest commit: c96838e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
zimeg
left a comment
There was a problem hiding this comment.
👋 Hey @KirobotDev! Thanks for sharing this refactor 🙏
I'm closing this PR for now since it's not addressing an issue in current implementations but do let me know if issues are appearing due to package setups otherwise! 🎁
| async function getProjectPackageVersion(packageName) { | ||
| const stdout = await execWrapper(`npm list ${packageName} --depth=0 --json`); | ||
| const currentVersionOutput = JSON.parse(stdout); | ||
| if (!currentVersionOutput.dependencies || !currentVersionOutput.dependencies[packageName]) { |
There was a problem hiding this comment.
👁️🗨️ thought: IMHO the chained pattern is confusing in this statement and might make later changes more difficult.
|
🔭 I'm finding now the latest linter settings might be catching the change earlier of this PR - let's reopen this! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2548 +/- ##
=======================================
Coverage 87.42% 87.42%
=======================================
Files 62 62
Lines 10249 10249
Branches 415 415
=======================================
Hits 8960 8960
Misses 1268 1268
Partials 21 21
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
@KirobotDev Thanks for sharing these fixes with us! 🎁
I'm unsure that the line feeds are different in this PR so let's merge this with the fix to formatting preferences called out!
|
Thanks for merge my pr |
Summary
This PR applies Biome lint fixes to normalize code style across the monorepo and improve code readability.
Changes
getProjectPackageVersion()Files Modified
packages/cli-hooks/src/check-update.js— applied optional chaining syntaxMultiple packages (line ending normalization):
packages/web-apipackages/webhookpackages/typespackages/oauthpackages/socket-modeDetails
Line Endings Normalization
Configured Biome formatter (
lineEnding: "lf") to enforce consistent Unix-style line endings across all files.This improves cross-platform compatibility and avoids unnecessary diffs between environments.
Optional Chaining Refactor
Simplified conditional check using optional chaining:
Impact
Testing
Notes