Skip to content

refactor: fix Yoda conditions - #30

Open
deepsource-dev-autofix[bot] wants to merge 2 commits into
masterfrom
deepsource-autofix-52e6502c
Open

refactor: fix Yoda conditions#30
deepsource-dev-autofix[bot] wants to merge 2 commits into
masterfrom
deepsource-autofix-52e6502c

Conversation

@deepsource-dev-autofix

Copy link
Copy Markdown

Yoda conditions are named so because the literal value of the condition comes first while the variable comes second.

For instance,

if ("red" === color) {
    // ...
}

Yoda condition is fixed by switching the literal and variable.

Yoda conditions are named so because the literal value of the condition comes first while the variable comes second.

For instance,

```js
if ("red" === color) {
    // ...
}
```

Yoda condition is fixed by switching the literal and variable.
This commit fixes the style issues introduced in f399268 according to the output
from Prettier.

Details: #30
@deepsource-development

deepsource-development Bot commented Apr 25, 2025

Copy link
Copy Markdown

Here's the code health analysis summary for commits 3bfce7d..873af20. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript❌ FailureView Check ↗
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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.

1 participant