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

(ESLint) Enforce filename extensions for jsx #2101

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

twk3
Copy link
Contributor

@twk3 twk3 commented Dec 18, 2023

  • JSX content must use .jsx or .tsx here
  • Files that don't contain JSX can't use those two extensions

In preparation for considering moving to vite, which requires JSX content to be in one of these file extensions.

Currently this MR is also removing the x from files that don't contain JSX, (and enforcing that via eslint as well), but that is optional and not required for moving to vite. (Just seemed logical to me).

The eslint file contains the only content changes, everything else is just extension renames.

Split out of #2084

- JSX content must use .jsx or .tsx here
- Files that don't contain JSX can't use those two extensions
@trafico-bot trafico-bot bot added the 🚧 WIP label Dec 18, 2023
Copy link

netlify bot commented Dec 18, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit c49ac22
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/657fcf70cc02fc00089ec23f
😎 Deploy Preview https://deploy-preview-2101.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.

Copy link
Contributor

github-actions bot commented Dec 18, 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
16 3.09 MB → 3.09 MB (+6 B) +0.00%
Changeset (largest 100 files by percent change)
File Δ Size
src/components/budget/MobileBudgetTable.jsx 🆕 +73.12 kB 0 B → 73.12 kB
src/components/transactions/TransactionsTable.jsx 🆕 +67.59 kB 0 B → 67.59 kB
src/components/accounts/Account.jsx 🆕 +53.45 kB 0 B → 53.45 kB
src/components/transactions/MobileTransaction.jsx 🆕 +46.14 kB 0 B → 46.14 kB
src/components/modals/ImportTransactions.jsx 🆕 +46 kB 0 B → 46 kB
src/components/schedules/EditSchedule.jsx 🆕 +38.38 kB 0 B → 38.38 kB
src/components/modals/EditRule.jsx 🆕 +36.58 kB 0 B → 36.58 kB
src/components/filters/FiltersMenu.jsx 🆕 +24.29 kB 0 B → 24.29 kB
src/components/select/RecurringSchedulePicker.jsx 🆕 +22.58 kB 0 B → 22.58 kB
src/components/reports/ReportSidebar.jsx 🆕 +19.4 kB 0 B → 19.4 kB
src/components/accounts/Header.jsx 🆕 +18.92 kB 0 B → 18.92 kB
src/components/reports/reports/CustomReport.jsx 🆕 +16.62 kB 0 B → 16.62 kB
src/components/budget/MobileBudget.jsx 🆕 +13.81 kB 0 B → 13.81 kB
src/components/filters/SavedFilters.jsx 🆕 +13.07 kB 0 B → 13.07 kB
src/components/manager/BudgetList.jsx 🆕 +11.51 kB 0 B → 11.51 kB
src/components/payees/ManagePayees.jsx 🆕 +11.2 kB 0 B → 11.2 kB
src/components/budget/BudgetTable.jsx 🆕 +10.58 kB 0 B → 10.58 kB
src/components/manager/ManagementApp.jsx 🆕 +10.49 kB 0 B → 10.49 kB
src/components/budget/BudgetCategories.jsx 🆕 +10.42 kB 0 B → 10.42 kB
src/components/modals/EditField.jsx 🆕 +9.66 kB 0 B → 9.66 kB
src/components/accounts/MobileAccounts.jsx 🆕 +9.55 kB 0 B → 9.55 kB
src/components/mobile/MobileAmountInput.jsx 🆕 +9.41 kB 0 B → 9.41 kB
src/components/modals/MergeUnusedPayees.jsx 🆕 +9.32 kB 0 B → 9.32 kB
src/components/reports/reports/CashFlowCard.jsx 🆕 +8.88 kB 0 B → 8.88 kB
src/components/transactions/SimpleTransactionsTable.jsx 🆕 +8.78 kB 0 B → 8.78 kB
src/components/modals/SelectLinkedAccounts.jsx 🆕 +7.76 kB 0 B → 7.76 kB
src/components/reports/spreadsheets/sankey-spreadsheet.ts 🆕 +7.58 kB 0 B → 7.58 kB
src/components/util/GenericInput.jsx 🆕 +6.87 kB 0 B → 6.87 kB
src/components/reports/Header.jsx 🆕 +6.87 kB 0 B → 6.87 kB
src/components/accounts/MobileAccount.jsx 🆕 +6.79 kB 0 B → 6.79 kB
src/components/accounts/Balance.jsx 🆕 +6.69 kB 0 B → 6.69 kB
src/components/transactions/SelectedTransactions.jsx 🆕 +6.67 kB 0 B → 6.67 kB
src/components/reports/ReportTopbar.jsx 🆕 +6.51 kB 0 B → 6.51 kB
src/components/transactions/TransactionList.jsx 🆕 +6.44 kB 0 B → 6.44 kB
src/components/accounts/Reconcile.jsx 🆕 +6.36 kB 0 B → 6.36 kB
src/components/reports/reports/NetWorth.jsx 🆕 +6.34 kB 0 B → 6.34 kB
src/components/modals/LoadBackup.jsx 🆕 +6.28 kB 0 B → 6.28 kB
src/components/reports/reports/CategorySpending.jsx 🆕 +6.25 kB 0 B → 6.25 kB
src/components/manager/DeleteFile.jsx 🆕 +5.78 kB 0 B → 5.78 kB
src/components/accounts/AccountSyncCheck.jsx 🆕 +5.71 kB 0 B → 5.71 kB
src/components/reports/reports/Sankey.jsx 🆕 +5.21 kB 0 B → 5.21 kB
src/components/payees/ManagePayeesWithData.jsx 🆕 +5.13 kB 0 B → 5.13 kB
src/components/accounts/MobileAccountDetails.jsx 🆕 +5.08 kB 0 B → 5.08 kB
src/components/reports/reports/NetWorthCard.jsx 🆕 +4.73 kB 0 B → 4.73 kB
src/components/reports/spreadsheets/net-worth-spreadsheet.ts 🆕 +4.64 kB 0 B → 4.64 kB
src/components/reports/spreadsheets/default-spreadsheet.ts 🆕 +4.45 kB 0 B → 4.45 kB
src/components/mobile/MobileForms.jsx 🆕 +4.1 kB 0 B → 4.1 kB
src/components/schedules/PostsOfflineNotification.jsx 🆕 +3.98 kB 0 B → 3.98 kB
src/components/reports/ReportOptions.ts 🆕 +3.78 kB 0 B → 3.78 kB
src/components/manager/Modals.jsx 🆕 +3.26 kB 0 B → 3.26 kB
src/components/reports/reports/CustomReportCard.jsx 🆕 +2.75 kB 0 B → 2.75 kB
src/components/reports/reports/CategorySpendingCard.jsx 🆕 +2.65 kB 0 B → 2.65 kB
src/components/reports/Overview.jsx 🆕 +2.5 kB 0 B → 2.5 kB
src/components/reports/Tooltip.jsx 🆕 +2.42 kB 0 B → 2.42 kB
src/components/reports/reports/SankeyCard.jsx 🆕 +2.34 kB 0 B → 2.34 kB
src/components/reports/ReportRouter.jsx 🆕 +1.39 kB 0 B → 1.39 kB
src/components/GlobalKeys.ts 🆕 +1.13 kB 0 B → 1.13 kB
../loot-core/src/client/data-hooks/filters.ts 🆕 +837 B 0 B → 837 B
src/components/common/InitialFocus.ts 🆕 +784 B 0 B → 784 B
src/components/payees/ManagePayeesPage.jsx 🆕 +582 B 0 B → 582 B
src/components/reports/Change.jsx 🆕 +563 B 0 B → 563 B
src/components/reports/useReport.ts 🆕 +542 B 0 B → 542 B
src/components/SyncRefresh.ts 🆕 +347 B 0 B → 347 B
src/util/router-tools.ts 🆕 +277 B 0 B → 277 B
src/components/reports/numberFormatter.ts 🆕 +219 B 0 B → 219 B
src/components/rules/SchedulesQuery.ts 🆕 +197 B 0 B → 197 B
src/components/budget/MobileBudgetTable.js 🔥 -73.12 kB (-100%) 73.12 kB → 0 B
src/components/transactions/TransactionsTable.js 🔥 -67.59 kB (-100%) 67.59 kB → 0 B
src/components/accounts/Account.js 🔥 -53.45 kB (-100%) 53.45 kB → 0 B
src/components/transactions/MobileTransaction.js 🔥 -46.14 kB (-100%) 46.14 kB → 0 B
src/components/modals/ImportTransactions.js 🔥 -46 kB (-100%) 46 kB → 0 B
src/components/schedules/EditSchedule.js 🔥 -38.38 kB (-100%) 38.38 kB → 0 B
src/components/modals/EditRule.js 🔥 -36.58 kB (-100%) 36.58 kB → 0 B
src/components/filters/FiltersMenu.js 🔥 -24.29 kB (-100%) 24.29 kB → 0 B
src/components/select/RecurringSchedulePicker.js 🔥 -22.58 kB (-100%) 22.58 kB → 0 B
src/components/reports/ReportSidebar.js 🔥 -19.4 kB (-100%) 19.4 kB → 0 B
src/components/accounts/Header.js 🔥 -18.92 kB (-100%) 18.92 kB → 0 B
src/components/reports/reports/CustomReport.js 🔥 -16.62 kB (-100%) 16.62 kB → 0 B
src/components/budget/MobileBudget.js 🔥 -13.81 kB (-100%) 13.81 kB → 0 B
src/components/filters/SavedFilters.js 🔥 -13.07 kB (-100%) 13.07 kB → 0 B
src/components/manager/BudgetList.js 🔥 -11.51 kB (-100%) 11.51 kB → 0 B
src/components/payees/ManagePayees.js 🔥 -11.2 kB (-100%) 11.2 kB → 0 B
src/components/budget/BudgetTable.js 🔥 -10.58 kB (-100%) 10.58 kB → 0 B
src/components/manager/ManagementApp.js 🔥 -10.49 kB (-100%) 10.49 kB → 0 B
src/components/budget/BudgetCategories.js 🔥 -10.42 kB (-100%) 10.42 kB → 0 B
src/components/modals/EditField.js 🔥 -9.66 kB (-100%) 9.66 kB → 0 B
src/components/accounts/MobileAccounts.js 🔥 -9.55 kB (-100%) 9.55 kB → 0 B
src/components/mobile/MobileAmountInput.js 🔥 -9.41 kB (-100%) 9.41 kB → 0 B
src/components/modals/MergeUnusedPayees.js 🔥 -9.32 kB (-100%) 9.32 kB → 0 B
src/components/reports/reports/CashFlowCard.js 🔥 -8.88 kB (-100%) 8.88 kB → 0 B
src/components/transactions/SimpleTransactionsTable.js 🔥 -8.78 kB (-100%) 8.78 kB → 0 B
src/components/modals/SelectLinkedAccounts.js 🔥 -7.76 kB (-100%) 7.76 kB → 0 B
src/components/reports/spreadsheets/sankey-spreadsheet.tsx 🔥 -7.58 kB (-100%) 7.58 kB → 0 B
src/components/util/GenericInput.js 🔥 -6.87 kB (-100%) 6.87 kB → 0 B
src/components/reports/Header.js 🔥 -6.87 kB (-100%) 6.87 kB → 0 B
src/components/accounts/MobileAccount.js 🔥 -6.79 kB (-100%) 6.79 kB → 0 B
src/components/accounts/Balance.js 🔥 -6.69 kB (-100%) 6.69 kB → 0 B
src/components/transactions/SelectedTransactions.js 🔥 -6.67 kB (-100%) 6.67 kB → 0 B
src/components/reports/ReportTopbar.js 🔥 -6.51 kB (-100%) 6.51 kB → 0 B
src/components/transactions/TransactionList.js 🔥 -6.44 kB (-100%) 6.44 kB → 0 B
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/553.chunk.js 0 B → 28.94 kB (+28.94 kB) -

Removed

Asset File Size % Changed
static/js/226.chunk.js 28.94 kB → 0 B (-28.94 kB) -100%

Bigger

Asset File Size % Changed
static/js/main.js 1.26 MB → 1.26 MB (+3 B) +0.00%
static/js/wide-components.chunk.js 114.99 kB → 114.99 kB (+1 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/231.chunk.js 117.38 kB 0%
static/js/reports.chunk.js 77.29 kB 0%
static/js/narrow-components.chunk.js 51.17 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 911 B 0%

Copy link
Contributor

github-actions bot commented Dec 18, 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 2.23 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.24 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@twk3 twk3 changed the title [WIP] (ESLint) Enforce filename extensions for jsx (ESLint) Enforce filename extensions for jsx Dec 18, 2023
@@ -282,9 +287,6 @@ module.exports = {
},
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is included already with the import/typescript extends: https://github.com/import-js/eslint-plugin-import/blob/main/config/typescript.js

@@ -39,6 +39,7 @@ module.exports = {
'react-app',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this adds tsx and jsx to the resolved imports so their filenames don't need to be specified in imports

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing

@MatissJanis MatissJanis merged commit 9ea8e86 into actualbudget:master Dec 18, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Dec 18, 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