32 Commits

Author SHA1 Message Date
Matiss Janis Aboltins
0472211925 [AI] lint: await-thenable, no-floating-promises (#6987)
* [AI] Desktop client, E2E, loot-core, sync-server and tooling updates

Co-authored-by: Cursor <cursoragent@cursor.com>

* Refactor database handling in various modules to use async/await for improved readability and error handling. This includes updates to database opening and closing methods across multiple files, ensuring consistent asynchronous behavior. Additionally, minor adjustments were made to encryption functions to support async operations.

* Refactor sync migration tests to utilize async/await for improved readability. Updated transaction handling to streamline event expectations and cleanup process.

* Refactor various functions to utilize async/await for improved readability and error handling. Updated service stopping, encryption, and file upload/download methods to ensure consistent asynchronous behavior across the application.

* Refactor BudgetFileSelection component to use async/await for onSelect method, enhancing error handling and readability. Update merge tests to utilize async/await for improved clarity in transaction merging expectations.

* Refactor filesystem module to use async/await for init function and related database operations, enhancing error handling and consistency across file interactions. Updated tests to reflect asynchronous behavior in database operations and file writing.

* Fix typo in init function declaration to ensure it returns a Promise<void> instead of Proise<void>.

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6987

* Update tests to use async/await for init function in web filesystem, ensuring consistent asynchronous behavior in database operations.

* Update VRT screenshot for payees filter test to reflect recent changes

* [AI] Fix no-floating-promises lint error in desktop-electron

Wrapped queuedClientWinLogs.map() with Promise.all and void operator to properly handle the array of promises for executing queued logs.

Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>

* Refactor promise handling in global and sync event handlers

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6987

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>
2026-02-19 14:22:05 +00:00
Matiss Janis Aboltins
d4e25f4047 [AI] Introduce type-aware oxlint and disable no-duplicate-type-constituents rule (#6984)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 19:05:57 +00:00
Matiss Janis Aboltins
7e8a118411 [AI] lint: convert oxlint warnings to errors (#6970)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 13:48:50 +00:00
Matiss Janis Aboltins
c8aa0cf1d3 Refactor: extract tooltip components and clean up lint suppressions (#6721)
* Refactor: extract tooltip components and clean up lint suppressions

Extract CustomTooltip components from CrossoverGraph and NetWorthGraph
to module level to fix unstable nested components lint warnings. Also
consolidate theme file lint rule into oxlintrc.json and add proper
typing to styles object.

* Add release notes for maintenance updates addressing lint violations

* Remove style prop from CustomTooltip to prevent container layout styles from affecting tooltip

Co-authored-by: matiss <matiss@mja.lv>

* Refactor NetWorthGraph component by extracting TrendTooltip and StackedTooltip into separate functions for improved readability and maintainability. Update tooltip props to include necessary parameters for rendering. Clean up unused code and enhance tooltip styling.

* Refactor NetWorthGraph component to streamline tooltip handling

- Removed unnecessary prop passing for translation function in TrendTooltip.
- Adjusted import statements for better clarity and consistency.
- Cleaned up code to enhance readability and maintainability.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-02-10 15:12:22 +00:00
Matiss Janis Aboltins
84cebed20b Enforce consistent TypeScript type import style (#6805) 2026-02-10 13:33:20 +00:00
Joel Jeremy Marquez
7f6f4d5def Move redux state to react-query - category states (#5977)
* Move redux state to react query - category states

* Fix typecheck errors

* Fix typecheck errors

* Fix typecheck errors

* Remove t argument

* [autofix.ci] apply automated fixes

* Coderabbot suggestion

* Code review feedback

* Fix type

* Coderabbit

* Delete useCategoryActions

* Fix lint

* Use categories from react query cache

* Fix typecheck error

* Update to use useDeleteCategoryGroupMutation

* Coderabbit feedback

* Break up useCategoryActions

* [autofix.ci] apply automated fixes

* Fix typecheck errors

* Fix typecheck error

* Fix typecheck error

* await nested mutations

* Await deleteCategory

* Rename to sendThrow

* Fix lint errors

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-05 00:42:49 +00:00
Matiss Janis Aboltins
9585a92cda Add oxlint rule against direct theme imports; fix Login OpenID button styles (#6796)
Co-authored-by: Michael Clark <5285928+MikesGlitch@users.noreply.github.com>
2026-02-04 19:29:20 +00:00
Matiss Janis Aboltins
176336e7f3 Upgrade oxfmt/oxlint and migrate import sorting to oxfmt (#6719)
* Upgrade oxfmt/oxlint and migrate import sorting to oxfmt

Upgrade oxfmt from 0.22.0 to 0.26.0 and oxlint from 1.38.0 to 1.41.0.

Move import sorting configuration from oxlint (perfectionist/sort-imports)
to oxfmt's new experimentalSortImports feature, which provides native
import sorting support in the formatter.

* Add release notes for maintenance updates including oxlint and oxfmt upgrades
2026-01-19 21:46:24 +00:00
Matiss Janis Aboltins
65dee4c627 lint: a11y issue fixes (#6679)
* Fix accessibility issues: use semantic HTML and correct tab indices

- Replace View with semantic h1 in ModalHeader
- Fix tabIndex from 1 to 0 in Menu component
- Remove disabled oxlint accessibility rules
- Update components to use proper semantic HTML elements

* Refactor button elements to semantic HTML in Autocomplete and CategoryAutocomplete components

- Replace button elements with div/View while maintaining role="button" for accessibility.
- Update styles and props accordingly to ensure consistent behavior.
- Adjust onClick types in Item and SecondaryItem components for better type safety.

* Add release notes for upcoming maintenance updates addressing various accessibility issues

* Refactor autocomplete components to improve text alignment and button semantics

- Added textAlign: 'left' style to AccountItem and PayeeItem for consistent text alignment.
- Removed type="button" from CategoryItem to streamline button semantics.
- Updated ItemContent to use the Button component instead of a button element, enhancing accessibility and consistency.

* Refactor budget and report components to improve text alignment

- Removed font: 'inherit' style from EnvelopeBudgetComponents and TrackingBudgetComponents for cleaner styling.
- Updated ActionableGridListItem and ReportCard components to replace font: 'inherit' with textAlign: 'left' for consistent text alignment.

* Update ActionableGridListItem to include font inheritance for improved styling consistency

* Refactor button elements to use the Button component for consistency and improved semantics

- Updated various components (EnvelopeBudgetComponents, IncomeCategoryMonth, CategoryMonth, ActionableGridListItem, ReportCard, DesktopLinkedNotes) to replace native button elements with the custom Button component.
- Adjusted styles and event handlers to align with the new Button implementation, ensuring consistent behavior and accessibility across the application.

* Update Button and ActionableGridListItem styles for consistency

- Set a fixed borderRadius of 4 for the Button component, ensuring uniformity across variants.
- Adjusted ActionableGridListItem to have a borderRadius of 0 for a cleaner design.

* Update CategoryAutocomplete to include button type attribute for improved semantics

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6679

* Update VRT screenshot for Payees search functionality

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-19 18:19:13 +00:00
Matiss Janis Aboltins
b6452f930b lint: add perfectionist/sort-named-imports rule (#6680)
* Apply import sorting with perfectionist/sort-named-imports rule

- Add perfectionist/sort-named-imports oxlint rule
- Sort named imports: value imports before type imports
- Update component-library and desktop-client files to match new rule

* Add release notes for linting updates on named imports
2026-01-16 23:41:45 +00:00
Matiss Janis Aboltins
6bf119786c lint: re-enable some react rules (#6667)
* Remove hooks disable in electron fixtures

Co-authored-by: matiss <matiss@mja.lv>

* Add release notes for PR #6667

* Re-enable exhaustive-deps for low-risk hooks

Co-authored-by: matiss <matiss@mja.lv>

* Reduce exhaustive-deps overrides

Co-authored-by: matiss <matiss@mja.lv>

* Format useQuery hook

Co-authored-by: matiss <matiss@mja.lv>

* Fix exhaustive-deps warnings in hooks

Co-authored-by: matiss <matiss@mja.lv>

* Format useQuery dependencies

Co-authored-by: matiss <matiss@mja.lv>

* Document dynamic hook dependencies

Co-authored-by: matiss <matiss@mja.lv>

* Use react exhaustive-deps disables

Co-authored-by: matiss <matiss@mja.lv>

* Adjust exhaustive-deps disables

Co-authored-by: matiss <matiss@mja.lv>

* Refactor React hooks to address exhaustive-deps linting issues

- Updated multiple components to use `useEffectEvent` for better handling of dependencies.
- Adjusted dependencies in various hooks to improve code quality and maintainability.
- Removed unnecessary `useCallback` and `useRef` usages where applicable.
- Consolidated linting rules for React hooks to enhance consistency across the codebase.

* Refactor useEffect hooks to improve dependency management

- Updated ManageRules component to correctly return the init function in useEffect.
- Adjusted Modals component to disable exhaustive-deps linting for specific dependencies, enhancing clarity and maintainability.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-16 08:45:29 +00:00
Matiss Janis Aboltins
b88feb9336 lint: patch some no-empty-function violations & delete unused code (#6642)
* lint: patch some no-empty-function violations

* docs: update ESLint rules and remove unused loadOwner function in UserAccess component

* refactor: remove getRemoteFile function and associated method from budget file handlers

* chore: disable docstring checks in coderabbit configuration
2026-01-13 22:05:24 +00:00
Matiss Janis Aboltins
0c3a515e29 Update linting rules and replace @ts-ignore with @ts-expect-error (#6636)
* Update linting rules and replace @ts-ignore with @ts-expect-error

* Add release notes for PR #6636

* Fix TypeScript linting issue by adding @ts-ignore for electron types in server start message

* Change category to Maintenance and update linting rules

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-13 21:53:14 +00:00
Matiss Janis Aboltins
9e7a4cde36 Remove ESLint and complete migration to oxlint (#6584)
* Remove ESLint and migrate fully to oxlint

* Add release notes for PR #6584

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-06 23:19:03 +00:00
Matiss Janis Aboltins
f1faf45659 lint: move last remaining native eslint rules to oxlint (create new alternatives) (#6468)
* lint: clean up unnecessary config and disables

* fix: update package import path in browser preload script

* lint: create custom ESLint rules for rules not in oxlint

- Add object-shorthand-properties rule (replaces object-shorthand)
- Add prefer-const rule (replaces prefer-const)
- Add no-anchor-tag rule (replaces no-restricted-syntax for <a> tags)
- Add no-react-default-import rule (replaces no-restricted-syntax for React.*)

These custom rules are needed because oxlint doesn't support these rules yet.
All rules are properly tested and integrated into the ESLint config.

* refactor: enhance prefer-const rule to track variable reassignments by scope

- Introduced a mapping of scopes to reassigned variable names, improving the accuracy of the prefer-const rule.
- Added helper functions to determine variable scopes and reassignment status.
- Updated logic to check variable reassignments during declaration analysis.
- Adjusted test cases to reflect changes in variable handling.
2026-01-05 09:00:44 +00:00
Julian Dominguez-Schatz
65da89efeb Add configuration to use built-in test explorer in VS Code (#6505)
* Add configuration files to make tests runnable in VS Code

* Add default configs/fix tests when run from VS Code

* Fix typo

* Add release notes
2025-12-29 22:40:20 +00:00
Matiss Janis Aboltins
cee994cf97 lint: add react/jsx-boolean-value lint rule (#6464) 2025-12-21 13:25:00 +00:00
Connor Shea
3004b6fa6e chore: Add a meta.name to the eslint plugin. (#6463)
* Add a name to the eslint plugin.

* Add release note.

* Also update the no-restricted-imports patterns in .oxlintrc.json.

The glob library is different from what ESLint uses, so the globs need
a bit of adjustment.
2025-12-21 08:33:22 +00:00
Matiss Janis Aboltins
1fe1bad2f8 lint: move actual eslint rules to oxlint and some eslint (#6462)
* lint: move actual eslint rules to oxlint and some eslint

* Update ESLint configuration to remove test file patterns from linting

* Add review status configuration to .coderabbit.yaml

* Remove oxlint plugin from ESLint configuration and package dependencies
2025-12-20 23:00:35 +00:00
Matiss Janis Aboltins
146aeb1f5a lint: fix most eslint/no-empty-function violations (#6457)
* lint: fix most eslint/no-empty-function violations

* Remove unnecessary closing brace in .oxlintrc.json
2025-12-20 21:38:05 +00:00
Matiss Janis Aboltins
ddb95359c3 lint: fix eslint/default-case rule violations (#6456) 2025-12-20 19:45:22 +00:00
Matiss Janis Aboltins
4fc00ae7f1 lint: patch typescript ignored issues (#6450)
* Updates across multiple packages

* Release notes

* Enhance error handling in budget goals reducer by throwing an error when the template is null
2025-12-19 23:40:28 +00:00
Matiss Janis Aboltins
b092681468 Update linting configuration (#6451) 2025-12-19 22:11:25 +00:00
Matiss Janis Aboltins
07fbcebb6a lint: move eslint-native rules to oxlint (#6449)
* Update linting configuration and fix related issues

* Fix type coercion for comment ID in check-first-comment.js to ensure proper comparison with summary comment IDs
2025-12-19 19:57:30 +00:00
Matiss Janis Aboltins
05735eb55d Lint: simplify ESLint config and add oxlint configuration (#6443)
* Simplify ESLint config and add oxlint configuration

- Switch from typescript-eslint recommended to base config
- Remove redundant TypeScript-specific rules that are handled by base config
- Add oxlint configuration with appropriate rules
- Simplify globals configuration using globals package
- Add coverage directory to ESLint ignores
- Clean up various TypeScript rule configurations

* Add release notes for PR #6443

* [autofix.ci] apply automated fixes

* Refactor release note generator and update CLI argument parsing

- Adjusted the release note generator to fix string formatting.
- Refactored CLI argument parsing in migrate/cli.ts to use parseSync for improved clarity and consistency.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-18 23:53:46 +00:00
Matiss Janis Aboltins
fca4522a65 lint: enable linter in docs and fix issues (#6400)
- Removed temporary ignores for the docs package.
- Updated linting rules for the docs package to improve code quality.
- Refactored variable declarations from `let` to `const` for better consistency.
- Added a new configuration file for oxlint in the docs directory.
- Made minor formatting adjustments across various components.
2025-12-13 23:52:42 +00:00
Matiss Janis Aboltins
094da46fb0 lint: move some more rules to oxlint/oxfmt and upgrade linter versions (#6398) 2025-12-13 22:41:21 +00:00
Matiss Janis Aboltins
32bc254040 Lint: port react and import rules from eslint to oxc (#6312)
* Enforce JSX file extensions for React components

- Update eslint config to enforce .jsx/.tsx extensions for files containing JSX
- Convert docs package JS files to JSX where they contain React code
- Fix unstable nested components in CrossoverGraph and NetWorthGraph
- Update oxlint configuration
- Update e2e fixtures

* Fix: Rename react-hooks/exhaustive-deps to react/exhaustive-deps

Co-authored-by: matiss <matiss@mja.lv>

* Enhance ESLint configuration and update import rules

* Refactor ESLint configuration to enhance import order rules and add eslint-plugin-import

* Fix ESLint directive comments in API files to use correct syntax

* Fix

* Fix ESLint directive comments and update import/extensions rule in configuration

* Refactor ESLint configuration to enforce JSX extension rules and improve code clarity

* Update ESLint configuration: disable 'import/no-unresolved' rule and remove obsolete .oxlintrc.json file

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-12-12 22:40:38 +00:00
Matiss Janis Aboltins
0aa96ecaee Fix lint violations (vol.3) (#6301)
* Fix lint violations

* Refactor code for clarity and consistency

- Updated various components to improve readability and maintainability, including:
  - Changed `while (1)` to `while (true)` for better clarity.
  - Simplified conditional checks by removing unnecessary boolean casts.
  - Added missing `key` props in mapped elements to ensure proper rendering in lists.
  - Adjusted the handling of hidden states in budget components for clearer logic.
  - Cleaned up linting rules in `.oxlintrc.json` to streamline configuration.

* Enhance accessibility and linting compliance

- Updated `.oxlintrc.json` to add a warning for `jsx-a11y/no-autofocus` and removed several disabled rules.
- Added `aria-level` attributes to improve semantic structure in `Page.tsx`, `Modal.tsx`, and `ReportCardName.tsx`.
- Replaced `<label>` elements with `<Text>` components in various modals to ensure proper accessibility.
- Added `htmlFor` attributes to labels in `ImportTransactionsModal.tsx` for better form accessibility.
- Disabled specific linting rules inline to address accessibility concerns in `Image.jsx` and `Toggle.tsx`.

* Add new keywords to spelling allowlist

- Updated `.github/actions/docs-spelling/allow/keywords.txt` to include `oxfmt` and `oxlint` for improved spell-checking in documentation and code comments.

* Disable no-autofocus rule in .oxlintrc.json

* Update Trans component usage in MergeUnusedPayeesModal

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-09 21:39:50 +00:00
Matiss Janis Aboltins
1117451b69 Fix lint violations (vol.2) (#6300)
* Fix lint violations

* Refactor code for clarity and consistency

- Updated various components to improve readability and maintainability, including:
  - Changed `while (1)` to `while (true)` for better clarity.
  - Simplified conditional checks by removing unnecessary boolean casts.
  - Added missing `key` props in mapped elements to ensure proper rendering in lists.
  - Adjusted the handling of hidden states in budget components for clearer logic.
  - Cleaned up linting rules in `.oxlintrc.json` to streamline configuration.

* Fix unused variable warning in electronApp fixture

* Fix linting comment in fixtures.ts
2025-12-08 16:39:27 +00:00
Matiss Janis Aboltins
666b0b80b6 Fix lint violations (#6299) 2025-12-04 23:17:31 +00:00
Matiss Janis Aboltins
879fd1b054 chore: replace Prettier with oxfmt and add oxlint (#6259)
* chore: replace Prettier with oxfmt and add oxlint

- Replace Prettier with oxfmt (Prettier-compatible formatter from OXC project)
- Add oxlint for fast linting alongside ESLint
- Add eslint-plugin-oxlint to disable ESLint rules covered by oxlint
- Update lint scripts to run oxfmt, oxlint, then eslint
- Update lint-staged configuration for pre-commit hooks
- Create .oxfmtrc.json and .oxlintrc.json configuration files
- Remove .prettierrc.json and .prettierignore
- Reformat codebase with oxfmt

* chore: update dependencies in yarn.lock

* chore: update oxlint configuration to disable additional rules

* chore: update oxfmt and oxlint configurations, enhance test readability
2025-12-04 19:55:10 +00:00