-
Notifications
You must be signed in to change notification settings - Fork 42
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
Refactoring across the repo #33
base: develop
Are you sure you want to change the base?
Refactoring across the repo #33
Conversation
The [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) operator can be used to perform null checks before accessing a property, or calling a function.
refactor: convert logical operator to optional chainining
ci: add .deepsource.toml
In contexts such as an `if` statement's test where the result of the expression will already be coerced to a `Boolean`, casting to a `Boolean` via double negation (`!!`) or a `Boolean` call is unnecessary.
refactor: remove unnecessary boolean casts
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.
I think that these changes help more people to start contributing because they don’t have to deal with !!!
or !!
anymore
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.
There are lots of unneeded parentheses now, mostly where double negation was removed, this should be fixed before merging.
@@ -244,7 +244,7 @@ export default defineComponent({ | |||
} | |||
} | |||
|
|||
if (!!!date.value) isValid = false; | |||
if (!date.value) isValid = false; | |||
if (!!!time.value || time.value == '00:00:00') isValid = false; |
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.
What about this one?
function setExpand(index) { | ||
for (let i = 0; i < faqs.value.length; i++) { | ||
// invert expand-state for clicked item, close all others | ||
faqs.value[i].expand = i == index ? !faqs.value[i].expand : false; | ||
function setExpand(index, value) { | ||
if (value) { | ||
for (let i = 0; i < faqs.value.length; i++) { | ||
faqs.value[i].expand = i == index; | ||
} |
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.
This was fixed in a previous pr, why did you change this back?
@@ -45,7 +45,7 @@ export default defineComponent({ | |||
"chip-color-12", | |||
]; | |||
|
|||
return !!props.color | |||
return (props.color) |
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.
- These parentheses are useless.
- I think, you can use the
??
operator here.
Preview deployed to https://e3a11daa.academy-preview.pages.dev (total size: 11M) |
Hi @SpotlightForBugs, are you still working on this? |
@Defelo yes, I am |
Description
used Deepsource AutofixType of change
Refactored two things:
My Bootstrap Academy username: SFB