-
Notifications
You must be signed in to change notification settings - Fork 213
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
Enforce braces for if
-else
and switch
-case
#3474
Conversation
api/Pipfile.lock
Outdated
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.
Awesome start, @bhavik001. So many changes!
Could you revert the unrelated changes to the Pipfile.lock
files?
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 removed all of the unrelated changes (Pipfile.lock and pnpm lock file).
Thank you for your contribution, @bhavik001!
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! Thanks for the quick follow up 🙏
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
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.
Changes LGTM, thanks for the contribution @bhavik001 and thanks @obulat for pushing this over the finish line!
@@ -33,6 +33,8 @@ export const project: TSESLint.Linter.Config = { | |||
semi: ["error", "never"], | |||
"no-console": "off", | |||
"unicorn/filename-case": ["error", { case: "kebabCase" }], | |||
"unicorn/switch-case-braces": ["error"], |
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.
TIL about unicorn
🤦. This turned out to be quite straightforward.
if
-else
and switch
-case
Fixes
Fixes #3386 by @dhruvkb
This PR incorporates changes to the ESLint configuration to enforce the use of braces in one-line if-else statements and case blocks inside switch statements. This update aims to enhance code readability and prevent potential issues in the future. The specific ESLint rules added are:
Testing Instructions
pnpm run eslint
pnpm run eslint --fix
Checklist