[PR #1355] [MERGED] Add a few more ESLint rules #33881

Closed
opened 2026-04-20 21:08:45 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1355
Author: @j-f1
Created: 7/17/2023
Status: Merged
Merged: 7/17/2023
Merged by: @j-f1

Base: masterHead: jed/more-eslint


📝 Commits (7)

  • 865416c Enable react/self-closing-comp to require self-closing components where possible
  • c3f6f5d Add 'prefer-if-statement' rule
  • 42cd324 Auto-fix fixable violations
  • 11feaca Manually fix remaining violations
  • 867e685 Add release note
  • 55a0840 Bump browserslist/caniuse
  • 4fedda7 Enable bugfixes in preset-env to unlock more ES features

📊 Changes

35 files changed (+353 additions, -111 deletions)

View changed files

📝 .eslintrc.js (+2 -0)
📝 packages/desktop-client/src/components/Background.js (+1 -1)
📝 packages/desktop-client/src/components/Modals.js (+2 -2)
📝 packages/desktop-client/src/components/NotesButton.tsx (+1 -1)
📝 packages/desktop-client/src/components/accounts/Account.js (+18 -15)
📝 packages/desktop-client/src/components/accounts/MobileAccount.js (+2 -2)
📝 packages/desktop-client/src/components/autocomplete/Autocomplete.tsx (+8 -8)
📝 packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.js (+3 -3)
📝 packages/desktop-client/src/components/common.tsx (+1 -1)
📝 packages/desktop-client/src/components/common/Input.tsx (+2 -2)
📝 packages/desktop-client/src/components/common/InputWithContent.tsx (+2 -2)
📝 packages/desktop-client/src/components/common/Menu.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/EditRule.js (+1 -1)
📝 packages/desktop-client/src/components/modals/FixEncryptionKey.js (+1 -1)
📝 packages/desktop-client/src/components/modals/NordigenExternalMsg.js (+1 -1)
📝 packages/desktop-client/src/components/modals/PlaidExternalMsg.js (+1 -1)
📝 packages/desktop-client/src/components/payees/index.js (+2 -2)
📝 packages/desktop-client/src/components/reports/useReport.js (+1 -1)
📝 packages/desktop-client/src/components/schedules/SchedulesTable.js (+1 -1)
📝 packages/desktop-client/src/components/select/DateSelect.js (+10 -12)

...and 15 more files

📄 Description

  • react/self-closing-comp auto fixes <div></div> to <div /> which is equivalent
  • the custom prefer-if-statement rule detects logical expressions (foo && bar / foo || bar) or ternaries at the top level and suggests using an if statement or optional chaining. It can also auto-fix the most common usage of this pattern in the codebase, as shown in the third commit.

🔄 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/1355 **Author:** [@j-f1](https://github.com/j-f1) **Created:** 7/17/2023 **Status:** ✅ Merged **Merged:** 7/17/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `jed/more-eslint` --- ### 📝 Commits (7) - [`865416c`](https://github.com/actualbudget/actual/commit/865416ca1195ac605e84711ad753314ca62e5faa) Enable react/self-closing-comp to require self-closing components where possible - [`c3f6f5d`](https://github.com/actualbudget/actual/commit/c3f6f5db48a40ace5247a5a5bb2b3f232e00d13e) Add 'prefer-if-statement' rule - [`42cd324`](https://github.com/actualbudget/actual/commit/42cd324d9b1e7217b4a614fd9c66fe7a23e4b33c) Auto-fix fixable violations - [`11feaca`](https://github.com/actualbudget/actual/commit/11feaca53707458b6d215197e73204518c915879) Manually fix remaining violations - [`867e685`](https://github.com/actualbudget/actual/commit/867e685b1f12c4f7cd67362363cdc999a5800d9a) Add release note - [`55a0840`](https://github.com/actualbudget/actual/commit/55a0840dfa37dc87262a5627e44f5222477fc20b) Bump browserslist/caniuse - [`4fedda7`](https://github.com/actualbudget/actual/commit/4fedda7e851657972d397b8247fd5f1fdea0aa76) Enable bugfixes in preset-env to unlock more ES features ### 📊 Changes **35 files changed** (+353 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `.eslintrc.js` (+2 -0) 📝 `packages/desktop-client/src/components/Background.js` (+1 -1) 📝 `packages/desktop-client/src/components/Modals.js` (+2 -2) 📝 `packages/desktop-client/src/components/NotesButton.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/accounts/Account.js` (+18 -15) 📝 `packages/desktop-client/src/components/accounts/MobileAccount.js` (+2 -2) 📝 `packages/desktop-client/src/components/autocomplete/Autocomplete.tsx` (+8 -8) 📝 `packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.js` (+3 -3) 📝 `packages/desktop-client/src/components/common.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/common/Input.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/common/InputWithContent.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/common/Menu.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/EditRule.js` (+1 -1) 📝 `packages/desktop-client/src/components/modals/FixEncryptionKey.js` (+1 -1) 📝 `packages/desktop-client/src/components/modals/NordigenExternalMsg.js` (+1 -1) 📝 `packages/desktop-client/src/components/modals/PlaidExternalMsg.js` (+1 -1) 📝 `packages/desktop-client/src/components/payees/index.js` (+2 -2) 📝 `packages/desktop-client/src/components/reports/useReport.js` (+1 -1) 📝 `packages/desktop-client/src/components/schedules/SchedulesTable.js` (+1 -1) 📝 `packages/desktop-client/src/components/select/DateSelect.js` (+10 -12) _...and 15 more files_ </details> ### 📄 Description - `react/self-closing-comp` auto fixes `<div></div>` to `<div />` which is equivalent - the custom `prefer-if-statement` rule detects logical expressions (`foo && bar` / `foo || bar`) or ternaries at the top level and suggests using an if statement or optional chaining. It can also auto-fix the most common usage of this pattern in the codebase, as shown in the third commit. --- <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-04-20 21:08:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#33881