Skip to content
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

Add a few more ESLint rules #1355

Merged
merged 7 commits into from
Jul 17, 2023
Merged

Add a few more ESLint rules #1355

merged 7 commits into from
Jul 17, 2023

Conversation

j-f1
Copy link
Contributor

@j-f1 j-f1 commented Jul 17, 2023

  • 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.

@netlify
Copy link

netlify bot commented Jul 17, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 4fedda7
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/64b58588251e1f000791a723
😎 Deploy Preview https://deploy-preview-1355.demo.actualbudget.org/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2023

Bundle Stats - desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
13 2.34 MB -> 2.34 MB (+2.18 KB) +0.09%
Changeset
File Δ Size
src/components/common/Input.tsx 📈 +225 B (+23.17%) 971 B -> 1.17 KB
src/components/common/InputWithContent.tsx 📈 +169 B (+18.31%) 923 B -> 1.07 KB
src/components/reports/useReport.js 📈 +57 B (+14.04%) 406 B -> 463 B
../../node_modules/@reach/rect/dist/reach-rect.mjs 📈 +285 B (+9.20%) 3.03 KB -> 3.3 KB
src/components/select/DateSelect.js 📈 +502 B (+6.84%) 7.16 KB -> 7.65 KB
../../node_modules/@reach/portal/dist/reach-portal.mjs 📈 +122 B (+4.70%) 2.53 KB -> 2.65 KB
src/components/table.tsx 📈 +931 B (+4.38%) 20.74 KB -> 21.65 KB
src/components/tooltips.js 📈 +361 B (+4.03%) 8.75 KB -> 9.1 KB
src/components/Modals.js 📈 +190 B (+3.51%) 5.29 KB -> 5.48 KB
src/components/autocomplete/Autocomplete.tsx 📈 +408 B (+3.16%) 12.62 KB -> 13.02 KB
src/components/common.tsx 📈 +86 B (+2.68%) 3.14 KB -> 3.22 KB
../../node_modules/@react-spring/core/dist/esm/index.js 📈 +852 B (+1.92%) 43.4 KB -> 44.23 KB
src/components/accounts/MobileAccount.js 📈 +106 B (+1.74%) 5.96 KB -> 6.07 KB
../../node_modules/@reach/popover/dist/reach-popover.mjs 📈 +126 B (+1.45%) 8.49 KB -> 8.62 KB
src/components/payees/index.js 📈 +154 B (+1.45%) 10.4 KB -> 10.55 KB
../../node_modules/@react-spring/shared/dist/esm/index.js 📈 +313 B (+1.43%) 21.41 KB -> 21.72 KB
src/components/autocomplete/PayeeAutocomplete.js 📈 +96 B (+1.41%) 6.67 KB -> 6.76 KB
src/components/accounts/Account.js 📈 +357 B (+1.35%) 25.83 KB -> 26.18 KB
src/components/modals/PlaidExternalMsg.js 📈 +39 B (+1.32%) 2.88 KB -> 2.92 KB
../../node_modules/@reach/listbox/dist/reach-listbox.mjs 📈 +571 B (+1.30%) 42.77 KB -> 43.33 KB
src/components/common/Menu.tsx 📈 +36 B (+1.28%) 2.75 KB -> 2.79 KB
src/components/modals/FixEncryptionKey.js 📈 +33 B (+1.09%) 2.96 KB -> 3 KB
src/components/transactions/MobileTransaction.js 📈 +90 B (+0.99%) 8.85 KB -> 8.93 KB
../../node_modules/@reach/utils/dist/reach-utils.mjs 📈 +122 B (+0.98%) 12.14 KB -> 12.26 KB
src/hooks/useSelected.js 📈 +40 B (+0.67%) 5.79 KB -> 5.83 KB
src/components/modals/NordigenExternalMsg.js 📈 +39 B (+0.58%) 6.55 KB -> 6.59 KB
src/components/modals/EditRule.js 📈 +38 B (+0.21%) 17.47 KB -> 17.51 KB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/main.js 1.03 MB -> 1.03 MB (+2.15 KB) +0.20%
static/js/reports.chunk.js 20.77 KB -> 20.8 KB (+29 B) +0.14%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/457.chunk.js 387.21 KB 0%
static/media/Inter.var.woff2 317.25 KB 0%
static/media/Inter-italic.var.woff2 239.29 KB 0%
static/media/Inter-roman.var.woff2 221.86 KB 0%
static/media/bg.svg 116.73 KB 0%
static/js/969.chunk.js 12.94 KB 0%
static/js/resize-observer-polyfill.chunk.js 8.12 KB 0%
static/css/main.css 6.08 KB 0%
index.html 1.68 KB 0%
asset-manifest.json 1.47 KB 0%
static/media/browser-server.js 963 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2023

Bundle Stats - loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 1.97 MB -> 1.96 MB (-8.8 KB) -0.44%
Changeset
File Δ Size
packages/loot-core/src/server/cloud-storage.ts 📈 +2 B (+0.02%) 10.69 KB -> 10.69 KB
node_modules/@jlongster/sql.js/dist/sql-wasm.js 📉 -84 B (-0.08%) 106.48 KB -> 106.39 KB
node_modules/@rschedule/core/es2015/rules.js 📉 -33 B (-0.10%) 33.08 KB -> 33.05 KB
packages/loot-core/src/server/aql/schema/index.ts 📉 -33 B (-0.31%) 10.38 KB -> 10.35 KB
packages/loot-core/src/server/accounts/rules.ts 📉 -64 B (-0.35%) 17.79 KB -> 17.73 KB
packages/loot-core/src/server/sheet.ts 📉 -23 B (-0.38%) 5.95 KB -> 5.92 KB
packages/loot-core/src/server/budget/cleanup-template.ts 📉 -23 B (-0.47%) 4.73 KB -> 4.71 KB
node_modules/csv-parse/lib/index.js 📉 -233 B (-0.48%) 47.79 KB -> 47.57 KB
packages/loot-core/src/shared/rules.ts 📉 -27 B (-0.51%) 5.21 KB -> 5.19 KB
node_modules/buffer/index.js 📉 -296 B (-0.51%) 56.86 KB -> 56.57 KB
packages/loot-core/src/server/accounts/sync.ts 📉 -156 B (-0.58%) 26.35 KB -> 26.2 KB
packages/loot-core/src/server/budget/goaltemplates.ts 📉 -123 B (-0.59%) 20.47 KB -> 20.35 KB
packages/loot-core/src/server/accounts/transactions.ts 📉 -31 B (-0.64%) 4.74 KB -> 4.71 KB
packages/loot-core/src/platform/server/asyncStorage/index.web.ts 📉 -19 B (-0.66%) 2.8 KB -> 2.79 KB
packages/loot-core/src/shared/util.ts 📉 -54 B (-0.69%) 7.67 KB -> 7.62 KB
packages/loot-core/src/platform/server/fs/index.web.ts 📉 -74 B (-0.80%) 9.06 KB -> 8.98 KB
packages/loot-core/src/server/schedules/find-schedules.ts 📉 -93 B (-0.92%) 9.89 KB -> 9.8 KB
packages/loot-core/src/server/encryption-internals.web.ts 📉 -25 B (-0.93%) 2.63 KB -> 2.61 KB
packages/loot-core/src/server/db/index.ts 📉 -156 B (-0.95%) 15.95 KB -> 15.8 KB
packages/import-ynab4/importer.js 📉 -125 B (-1.04%) 11.77 KB -> 11.65 KB
packages/loot-core/src/server/aql/compiler.ts 📉 -330 B (-1.14%) 28.34 KB -> 28.01 KB
packages/loot-core/src/server/aql/schema/executors.ts 📉 -74 B (-1.17%) 6.18 KB -> 6.11 KB
node_modules/@rschedule/core/es2015/main.js 📉 -378 B (-1.24%) 29.86 KB -> 29.49 KB
node_modules/csv-stringify/lib/index.js 📉 -309 B (-1.44%) 20.97 KB -> 20.67 KB
packages/loot-core/src/server/aql/schema-helpers.ts 📉 -78 B (-1.44%) 5.29 KB -> 5.21 KB
packages/loot-core/src/server/accounts/transaction-rules.ts 📉 -302 B (-1.46%) 20.19 KB -> 19.89 KB
packages/loot-core/src/platform/server/indexeddb/index.web.ts 📉 -74 B (-1.62%) 4.47 KB -> 4.4 KB
node_modules/@rschedule/standard-date-adapter/es2015/main.js 📉 -76 B (-1.66%) 4.46 KB -> 4.39 KB
node_modules/absurd-sql/dist/indexeddb-backend.js 📉 -608 B (-1.76%) 33.68 KB -> 33.09 KB
packages/loot-core/src/server/filters/app.ts 📉 -80 B (-1.77%) 4.41 KB -> 4.33 KB
packages/loot-core/src/server/spreadsheet/spreadsheet.ts 📉 -189 B (-1.78%) 10.38 KB -> 10.19 KB
packages/loot-core/src/shared/months.ts 📉 -148 B (-1.79%) 8.07 KB -> 7.93 KB
packages/api/methods.js 📉 -78 B (-1.89%) 4.04 KB -> 3.96 KB
packages/loot-core/src/platform/server/fs/path-join.web.ts 📉 -59 B (-2.12%) 2.72 KB -> 2.66 KB
packages/loot-core/src/server/undo.ts 📉 -136 B (-2.16%) 6.14 KB -> 6.01 KB
packages/loot-core/src/server/accounts/parse-file.ts 📉 -74 B (-2.34%) 3.09 KB -> 3.02 KB
packages/loot-core/src/shared/errors.ts 📉 -79 B (-2.37%) 3.26 KB -> 3.18 KB
node_modules/adm-zip/methods/zipcrypto.js 📉 -127 B (-2.41%) 5.14 KB -> 5.02 KB
packages/loot-core/src/server/schedules/app.ts 📉 -398 B (-2.62%) 14.85 KB -> 14.46 KB
packages/loot-core/src/shared/query.ts 📉 -78 B (-2.70%) 2.82 KB -> 2.74 KB
packages/loot-core/src/server/budget/rollover.ts 📉 -165 B (-2.94%) 5.49 KB -> 5.33 KB
packages/loot-core/src/platform/server/sqlite/index.web.ts 📉 -148 B (-3.09%) 4.68 KB -> 4.53 KB
packages/loot-core/src/server/accounts/qif2json.ts 📉 -74 B (-3.23%) 2.24 KB -> 2.16 KB
packages/loot-core/src/server/main.ts 📉 -2.01 KB (-3.24%) 62.24 KB -> 60.23 KB
packages/loot-core/src/server/aql/exec.ts 📉 -80 B (-3.27%) 2.39 KB -> 2.31 KB
packages/loot-core/src/server/prefs.ts 📉 -78 B (-3.31%) 2.3 KB -> 2.23 KB
packages/crdt/src/crdt/timestamp.ts 📉 -288 B (-3.49%) 8.07 KB -> 7.79 KB
packages/loot-core/src/server/post.ts 📉 -74 B (-3.50%) 2.07 KB -> 1.99 KB
packages/loot-core/src/server/budget/actions.ts 📉 -303 B (-3.80%) 7.79 KB -> 7.49 KB
packages/loot-core/src/server/accounts/link.ts 📉 -148 B (-3.93%) 3.68 KB -> 3.54 KB
packages/loot-core/src/server/mutators.ts 📉 -154 B (-4.14%) 3.63 KB -> 3.48 KB
packages/loot-core/src/server/encryption.ts 📉 -83 B (-4.65%) 1.74 KB -> 1.66 KB
node_modules/csv-parse/lib/ResizeableBuffer.js 📉 -78 B (-4.94%) 1.54 KB -> 1.47 KB
packages/loot-core/src/platform/server/log/index.web.ts 📉 -8 B (-5.06%) 158 B -> 150 B
packages/loot-core/src/server/api.ts 📉 -860 B (-5.15%) 16.3 KB -> 15.46 KB
packages/crdt/src/crdt/merkle.ts 📉 -222 B (-5.22%) 4.15 KB -> 3.93 KB
node_modules/@rschedule/core/es2015/generators.js 📉 -5.8 KB (-5.97%) 97.08 KB -> 91.29 KB
packages/loot-core/src/server/accounts/export-to-csv.ts 📉 -150 B (-6.01%) 2.44 KB -> 2.29 KB
packages/loot-core/src/server/accounts/title/index.ts 📉 -353 B (-6.37%) 5.42 KB -> 5.07 KB
packages/loot-core/src/server/app.ts 📉 -130 B (-7.64%) 1.66 KB -> 1.53 KB
packages/loot-core/src/server/db/util.ts 📉 -74 B (-8.26%) 896 B -> 822 B
node_modules/uuid/dist/esm-browser/stringify.js 📉 -148 B (-9.09%) 1.59 KB -> 1.45 KB
packages/loot-core/src/server/models.ts 📉 -400 B (-9.54%) 4.09 KB -> 3.7 KB
packages/loot-core/src/server/notes/app.ts 📉 -23 B (-9.54%) 241 B -> 218 B
node_modules/csv-parse/lib/sync.js 📉 -74 B (-10.48%) 706 B -> 632 B
node_modules/csv-stringify/lib/sync.js 📉 -74 B (-10.88%) 680 B -> 606 B
packages/loot-core/src/shared/async.ts 📉 -140 B (-11.12%) 1.23 KB -> 1.09 KB
node_modules/@rschedule/json-tools/es2015/Schedule.js 📉 -450 B (-11.90%) 3.69 KB -> 3.25 KB
packages/loot-core/src/server/server-config.ts 📉 -146 B (-17.85%) 818 B -> 672 B
packages/loot-core/src/server/budget/util.ts 📉 -127 B (-19.60%) 648 B -> 521 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
kcab.worker.js 1016.6 KB -> 1007.79 KB (-8.8 KB) -0.87%

Unchanged

Asset File Size % Changed
xfo.xfo.kcab.worker.js 1004.04 KB 0%

@j-f1 j-f1 merged commit 1031bbb into master Jul 17, 2023
15 checks passed
@j-f1 j-f1 deleted the jed/more-eslint branch July 17, 2023 21:32
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Jul 17, 2023
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants