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>
This commit is contained in:
Matiss Janis Aboltins
2025-12-09 21:39:50 +00:00
committed by GitHub
parent 5a4fc5823c
commit 0aa96ecaee
16 changed files with 45 additions and 29 deletions

View File

@@ -2,15 +2,12 @@
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "import", "jsx-a11y"],
"rules": {
"jsx-a11y/no-autofocus": ["warn", { "ignoreNonDOM": true }],
// TODO fix all these and re-enable
"jsx-a11y/alt-text": "off",
"jsx-a11y/aria-role": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/prefer-tag-over-role": "off",
"jsx-a11y/role-has-required-aria-props": "off",
"jsx-a11y/tabindex-no-positive": "off",
"no-autofocus": "off",
},
"overrides": [
{