[PR #1015] [MERGED] Enable 'curly' rule #3466

Closed
opened 2026-02-28 20:42:03 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1015
Author: @j-f1
Created: 5/9/2023
Status: Merged
Merged: 5/9/2023
Merged by: @j-f1

Base: masterHead: jed/the-other-curly


📝 Commits (2)

📊 Changes

3 files changed (+16 additions, -4 deletions)

View changed files

📝 .eslintrc.js (+2 -0)
📝 packages/loot-core/src/server/budget/goaltemplates.ts (+8 -4)
upcoming-release-notes/1015.md (+6 -0)

📄 Description

Multi-line if/for statements in JS can be confusing since there aren’t braces to indicate which code is enclosed in the statement. I set the configuration to multi-line to enforce usage of braces for multi-line statement bodies, but still allow things like if (foo) return;. I additionally added the consistent option to require braces for all elements of an if/else chain if one element has it. As you can see, this set of options pretty closely matches the existing code style.

I was going to comment in #1008 about this stylistic change but realized that it’s (IMO) a little impolite to ask for code style changes unless they can be automatically enforced.

Note that if (foo) { \n return; \n } is still valid and won’t be collapsed. I tried to automatically collapse all such cases but it was a lot of files and I didn’t want to pick out the useful from the useless differences.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/1015 **Author:** [@j-f1](https://github.com/j-f1) **Created:** 5/9/2023 **Status:** ✅ Merged **Merged:** 5/9/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `jed/the-other-curly` --- ### 📝 Commits (2) - [`a7b2542`](https://github.com/actualbudget/actual/commit/a7b2542ed0ee098c6c6b72f74d28f52d84799df1) Enable 'curly' rule - [`47bad88`](https://github.com/actualbudget/actual/commit/47bad8846901f2fe658fa16a4191e67012a33cfe) Add release note ### 📊 Changes **3 files changed** (+16 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.eslintrc.js` (+2 -0) 📝 `packages/loot-core/src/server/budget/goaltemplates.ts` (+8 -4) ➕ `upcoming-release-notes/1015.md` (+6 -0) </details> ### 📄 Description Multi-line `if`/`for` statements in JS can be confusing since there aren’t braces to indicate which code is enclosed in the statement. I set the configuration to `multi-line` to enforce usage of braces for multi-line statement bodies, but still allow things like `if (foo) return;`. I additionally added the `consistent` option to require braces for all elements of an if/else chain if one element has it. As you can see, this set of options pretty closely matches the existing code style. I was going to comment in #1008 about this stylistic change but realized that it’s (IMO) a little impolite to ask for code style changes unless they can be automatically enforced. Note that `if (foo) { \n return; \n }` is still valid and won’t be collapsed. I tried to automatically collapse all such cases but it was a lot of files and I didn’t want to pick out the useful from the useless differences. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:42:03 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#3466