style: 💄 Update curly brace eslint rule #3023
Open
+51
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added a rule for eslint to enforce multi-line for control statements. My personal preference is enforcing braces for all statements but we've historically used single line if statements throughout the codebase which I think is fine.
However, I do want to avoid control statements that are on new lines without braces, even if they're single statements as those are more prone to errors when refactoring.
Screenshots (if appropriate)
How to Test
Confirm there's no other linting errors.
Checklist
[ ] I have added before and after screenshots for UI changes[ ] I have added JSON response output for API changes[ ] I have added steps to reproduce and test for bug fixes in the description[ ] I have commented on my code, particularly in hard-to-understand areas[ ] I have added tests that prove my fix is effective or that my feature works[ ] I have addeda11y-tests
label to run a11y audit tests if neededPCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.