-
Notifications
You must be signed in to change notification settings - Fork 2
add check-name input to review check #13
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
Conversation
src/post-review-status.ts
Outdated
| status = "failure"; | ||
| } | ||
| } | ||
| const contextName = checkName ? checkName : context.repo.repo; |
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.
🟠 Code Quality Violation
| const contextName = checkName ? checkName : context.repo.repo; | |
| const contextName = checkName || context.repo.repo; |
Avoid unnecessary ternary (...read more)
This rule advises against the use of unnecessary ternary operations that return a boolean value. In JavaScript, the ternary operator ? : is a shorthand way of writing an if-else statement. However, if the result of the ternary operation is a boolean (such as true or false), it is often unnecessary because the condition itself already produces a boolean value.
The use of unnecessary ternary operations can lead to code that is harder to read and understand. Furthermore, it can lead to potential bugs if the ternary operation is not correctly written or understood. To adhere to this rule, you should return the condition itself rather than using a ternary operation.
lib/post-review-status.js
Outdated
| status = "failure"; | ||
| } | ||
| } | ||
| const contextName = checkName ? checkName : github_1.context.repo.repo; |
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.
🟠 Code Quality Violation
| const contextName = checkName ? checkName : github_1.context.repo.repo; | |
| const contextName = checkName || github_1.context.repo.repo; |
Avoid unnecessary ternary (...read more)
This rule advises against the use of unnecessary ternary operations that return a boolean value. In JavaScript, the ternary operator ? : is a shorthand way of writing an if-else statement. However, if the result of the ternary operation is a boolean (such as true or false), it is often unnecessary because the condition itself already produces a boolean value.
The use of unnecessary ternary operations can lead to code that is harder to read and understand. Furthermore, it can lead to potential bugs if the ternary operation is not correctly written or understood. To adhere to this rule, you should return the condition itself rather than using a ternary operation.
gabepales
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.
lgtm
npx tsc --skipLibCheck