fix: remove unnecessary await from startPreview call
This PR resolves a SonarCloud code quality issue as part of the effort to fix SonarCloud issues reported in https://github.com/asyncapi/cli/issues/1881.
Description
- Removed unnecessary
awaitkeyword fromstartPreviewcall in the preview command - The
startPreviewfunction returnsvoid, not a Promise, so awaiting it was incorrect and triggered a linter error: "Unexpectedawaitof a non-Promise (non-"Thenable") value" - This change aligns the preview command with the pattern used in the studio command, where
startStudio(also returningvoid) is called withoutawaiton line 58 ofstudio.ts
Testing
The change is minimal and syntactically correct:
- Removed
awaitfrom line 40 insrc/apps/cli/commands/start/preview.ts - The function signature in
Preview.tsconfirmsstartPreviewreturnsvoid - The change matches the existing pattern in
studio.tswherestartStudiois called withoutawait - No functional changes - the preview command behavior remains the same, only the linter error is resolved
Documentation
No documentation updates required:
- The documentation in
docs/usage.mdis auto-generated from the command definitions - This is an internal code fix that doesn't change the user-facing API or behavior
- The command usage, flags, and descriptions remain unchanged
Related issue(s)
Fixes https://github.com/asyncapi/cli/issues/1881
🦋 Changeset detected
Latest commit: 8bfc87db096aa6de2e1c70a893d2117d2a5822ab
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @asyncapi/cli | Patch |
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
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code