feat(ui): update ui packages and formatting checks#481
Open
cccs-mdr wants to merge 15 commits into
Open
Conversation
…expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
Contributor
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
This PR modernizes the ui/ toolchain by migrating formatting/linting from Prettier/ESLint to Oxc’s oxfmt/oxlint, updating CI + pre-commit hooks accordingly, and applying the resulting mechanical refactors across the UI codebase (including the Roboto side-effect import fix).
Changes:
- Replace Prettier/ESLint with
oxfmt/oxlintin pre-commit and GitHub Actions, and remove legacy config/scripts. - Mechanical refactors across UI code/tests (e.g.,
catch {}andvoiding ignored promises) to satisfy updated lint rules. - Update developer documentation to reflect the new UI formatting/linting workflow.
Reviewed changes
Copilot reviewed 158 out of 165 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/utils/xsrf.ts | Use catch {} cleanup |
| ui/src/utils/utils.ts | Use catch {} cleanup |
| ui/src/utils/utils.test.ts | Suppress floating promise in test |
| ui/src/utils/Throttler.test.ts | Suppress floating promises in tests |
| ui/src/utils/stringUtils.test.ts | Update expected escape string |
| ui/src/utils/menuUtils.ts | Remove divider insertion warnings |
| ui/src/utils/localStorage.ts | Use catch {} cleanup |
| ui/src/utils/classificationParser.ts | Boolean simplifications / formatting |
| ui/src/rest/AxiosClient.test.ts | Improve axios mock shape |
| ui/src/plugins/clue/helpers.tsx | Boolean simplifications |
| ui/src/plugins/clue/components/CluePivotForm.tsx | Schema spread simplification |
| ui/src/index.tsx | Roboto CSS entry import |
| ui/src/i18n.ts | Suppress floating init promise |
| ui/src/components/routes/views/Views.tsx | catch {} + ignore promise results |
| ui/src/components/routes/views/ViewComposer.tsx | Ignore promise results / async IIFE |
| ui/src/components/routes/templates/TemplateViewer.tsx | Ignore promise results |
| ui/src/components/routes/templates/Templates.tsx | catch {} + ignore promise results |
| ui/src/components/routes/templates/TemplateEditor.tsx | Ignore promise result |
| ui/src/components/routes/settings/ProfileSection.tsx | Ignore delayed promise |
| ui/src/components/routes/overviews/OverviewViewer.tsx | Ignore async IIFEs / save promise |
| ui/src/components/routes/overviews/Overviews.tsx | catch {} + ignore promise results |
| ui/src/components/routes/overviews/markdownExtendedTokenProvider.ts | Regex formatting/escaping tweaks |
| ui/src/components/routes/home/ViewCard.tsx | Ignore refresh promise results |
| ui/src/components/routes/home/index.tsx | Ignore async calls in effects |
| ui/src/components/routes/home/AnalyticCard.tsx | Ignore promise result |
| ui/src/components/routes/home/AddNewCard.tsx | Ignore promise result |
| ui/src/components/routes/hits/view/HitViewer.tsx | Ignore async calls in effects |
| ui/src/components/routes/hits/search/ViewLink.tsx | Ignore promise result |
| ui/src/components/routes/hits/search/shared/SearchSpan.tsx | Ignore async IIFE |
| ui/src/components/routes/hits/search/shared/HitSort.tsx | Ignore async IIFE |
| ui/src/components/routes/hits/search/shared/CustomSort.tsx | Ignore promise result |
| ui/src/components/routes/hits/search/RecordBrowser.tsx | Ignore promise result |
| ui/src/components/routes/hits/search/InformationPane.tsx | Ignore promise results |
| ui/src/components/routes/help/RetentionDocumentation.tsx | Ignore promise result |
| ui/src/components/routes/help/ApiDocumentation.tsx | Ignore promise result |
| ui/src/components/routes/events/EventViewer.tsx | Ignore promise result |
| ui/src/components/routes/dossiers/Dossiers.tsx | catch {} + ignore promise results |
| ui/src/components/routes/dossiers/DossierEditor.tsx | Ignore promise result |
| ui/src/components/routes/dossiers/DossierEditor.test.tsx | Test user-event call adjustment |
| ui/src/components/routes/cases/modals/ResolveModal.tsx | Ignore async IIFE |
| ui/src/components/routes/cases/modals/RenameItemModal.tsx | Ignore submit promise; focus change |
| ui/src/components/routes/cases/modals/AddToCaseModal.tsx | Remove autoFocus |
| ui/src/components/routes/cases/modals/AddRecordToCaseModal.tsx | Ignore promise result |
| ui/src/components/routes/cases/hooks/useCase.ts | Ignore promise result; catch {} |
| ui/src/components/routes/cases/detail/TaskPanel.tsx | Ignore dispatch promise |
| ui/src/components/routes/cases/detail/sidebar/CaseFolderContextMenu.tsx | Ignore dispatch promise |
| ui/src/components/routes/cases/detail/sidebar/CaseFolder.tsx | Ignore dispatch promise |
| ui/src/components/routes/cases/detail/ItemPage.tsx | Ignore promise result |
| ui/src/components/routes/cases/detail/CaseTimeline.tsx | Ignore dispatch promises |
| ui/src/components/routes/cases/detail/CaseTask.tsx | Ignore edit/delete promises |
| ui/src/components/routes/cases/detail/CaseSearch.tsx | Ignore search promise |
| ui/src/components/routes/cases/detail/CaseRules.tsx | Ignore update promise |
| ui/src/components/routes/cases/detail/CaseObservables.tsx | Ignore dispatch promises |
| ui/src/components/routes/cases/detail/CaseDetails.tsx | Ignore update promise |
| ui/src/components/routes/cases/detail/CaseDashboard.tsx | Ignore dispatch promise |
| ui/src/components/routes/cases/CaseViewer.tsx | Ignore fetch promise |
| ui/src/components/routes/cases/Cases.tsx | Ignore search promises |
| ui/src/components/routes/analytics/widgets/Stacked.tsx | Ignore fetch promise |
| ui/src/components/routes/analytics/widgets/Escalation.tsx | Ignore facet promise |
| ui/src/components/routes/analytics/widgets/Created.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/widgets/Assessment.tsx | Ignore facet promise |
| ui/src/components/routes/analytics/TriageSettings.tsx | Ignore update promise |
| ui/src/components/routes/analytics/AnalyticTemplates.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/AnalyticSearch.tsx | Ignore search promises |
| ui/src/components/routes/analytics/AnalyticOverviews.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/AnalyticOverview.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/AnalyticHitComments.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/AnalyticDetails.tsx | Ignore promise chain |
| ui/src/components/routes/analytics/AnalyticComments.tsx | Ignore submit promise; spread tweak |
| ui/src/components/routes/advanced/QueryBuilder.tsx | Type formatting + ignore promises |
| ui/src/components/routes/advanced/luceneCompletionProvider.ts | Ignore promise result |
| ui/src/components/routes/admin/users/UserSearch.tsx | Ignore search promises |
| ui/src/components/routes/admin/users/UserEditor.tsx | Ignore promise chain |
| ui/src/components/routes/action/view/ActionSearch.tsx | catch {} + ignore search promises |
| ui/src/components/routes/action/view/ActionDetails.tsx | Ignore Promise.all result |
| ui/src/components/routes/action/useMyActionFunctions.tsx | Ignore refresh search promise |
| ui/src/components/routes/action/edit/ActionEditor.tsx | Ignore promises; formatting |
| ui/src/components/logins/hooks/useLogin.tsx | Ignore getUser promise |
| ui/src/components/logins/auth/OAuthLogin.tsx | Ignore doOAuth promise |
| ui/src/components/hooks/useRelatedRecords.tsx | Ignore async IIFE |
| ui/src/components/hooks/useMySnackbar.tsx | Spread simplification |
| ui/src/components/hooks/useLocalStorageItem.test.tsx | Act call adjusted |
| ui/src/components/hooks/useLocalStorage.ts | Use catch {} cleanup |
| ui/src/components/hooks/useHitActions.tsx | Ignore manage promise |
| ui/src/components/elements/record/RecordContextMenu.tsx | Ignore matcher promises |
| ui/src/components/elements/record/RecordContextMenu.test.tsx | Test accessibility + click handling |
| ui/src/components/elements/record/RecordComments.tsx | Ignore promise results |
| ui/src/components/elements/ObjectDetails.tsx | Simplify destructuring |
| ui/src/components/elements/hit/HitSummary.tsx | Ignore aggregation promise |
| ui/src/components/elements/hit/HitOverview.tsx | Ignore promise result |
| ui/src/components/elements/hit/HitOutline.tsx | Ignore promise result |
| ui/src/components/elements/hit/HitNotebooks.tsx | catch {} + ignore promise results |
| ui/src/components/elements/hit/HitLabels.tsx | Ignore promise result |
| ui/src/components/elements/hit/HitCard.tsx | Ignore promise result |
| ui/src/components/elements/hit/HitActions.tsx | Ignore promise result |
| ui/src/components/elements/hit/grid/RecordTable.tsx | Ignore promise result |
| ui/src/components/elements/hit/grid/ColumnHeader.tsx | Boolean simplification |
| ui/src/components/elements/hit/grid/AddColumnModal.tsx | Ignore async IIFE |
| ui/src/components/elements/hit/elements/AnalyticLink.tsx | Ignore promise result |
| ui/src/components/elements/hit/aggregate/HitGraph.tsx | Ignore query promise |
| ui/src/components/elements/event/EventCard.tsx | Ignore promise result |
| ui/src/components/elements/EditRow.tsx | Ignore edit/submit promises |
| ui/src/components/elements/display/modals/RationaleModal.tsx | Ignore async IIFE |
| ui/src/components/elements/display/modals/RationaleModal.test.tsx | Special-char test update |
| ui/src/components/elements/display/Markdown.tsx | Ignore mermaid promise; catch {} |
| ui/src/components/elements/display/json/JSONViewer.tsx | Ignore clipboard promises |
| ui/src/components/elements/display/Image.tsx | Style spread simplification |
| ui/src/components/elements/display/HowlerAvatar.tsx | sx spread simplification |
| ui/src/components/elements/display/HandlebarsMarkdown.tsx | Typing tweak; remove awaits |
| ui/src/components/elements/display/handlebars/helpers.tsx | Use catch {} cleanup |
| ui/src/components/elements/display/ActionButton.tsx | Ignore promise chain |
| ui/src/components/elements/ContextMenu.test.tsx | Add focusability in mocks |
| ui/src/components/elements/Comment.tsx | Ignore edit promise |
| ui/src/components/elements/case/CaseCard.tsx | Ignore promise chain |
| ui/src/components/elements/addons/lists/TuiListMenu.tsx | Spread simplification |
| ui/src/components/app/providers/ViewProvider.tsx | Ignore async IIFE; spread tweak |
| ui/src/components/app/providers/UserListProvider.test.tsx | Adjust async usage in tests |
| ui/src/components/app/providers/SocketProvider.tsx | Ignore retry promise; catch {} |
| ui/src/components/app/providers/RecordSearchProvider.tsx | Ignore promise results |
| ui/src/components/app/providers/RecordProvider.tsx | Boolean simplification; ignore promise |
| ui/src/components/app/providers/OverviewProvider.tsx | Ignore promise result |
| ui/src/components/app/providers/GridColumnsProvider.tsx | Ignore promise chain |
| ui/src/components/app/providers/FavouritesProvider.tsx | Ignore async IIFE |
| ui/src/components/app/providers/AvatarProvider.tsx | catch {} cleanup |
| ui/src/components/app/providers/AnalyticProvider.tsx | Ignore promise result |
| ui/src/components/app/hooks/useTitle.tsx | Ignore promise result |
| ui/src/components/app/hooks/useMatchers.tsx | catch {} cleanup |
| ui/src/components/app/App.tsx | Ignore promise results |
| ui/src/api/v2/search/index.ts | Spread request simplification |
| ui/src/api/v2/search/facet.ts | Spread request simplification |
| ui/src/api/search/view.ts | Spread request simplification |
| ui/src/api/search/user.ts | Spread request simplification |
| ui/src/api/search/template.ts | Spread request simplification |
| ui/src/api/search/sigma/hit.ts | Spread request simplification |
| ui/src/api/search/overview.ts | Spread request simplification |
| ui/src/api/search/hit.ts | Spread request simplification |
| ui/src/api/search/histogram/hit.ts | Spread request simplification |
| ui/src/api/search/grouped/user.ts | Spread request simplification |
| ui/src/api/search/grouped/hit.ts | Spread request simplification |
| ui/src/api/search/facet/hit.ts | Spread request simplification |
| ui/src/api/search/explain/hit.ts | Spread request simplification |
| ui/src/api/search/eql/hit.ts | Spread request simplification |
| ui/src/api/search/dossier.ts | Spread request simplification |
| ui/src/api/search/count/hit.ts | Spread request simplification |
| ui/src/api/search/case.ts | Spread request simplification |
| ui/src/api/search/analytic.ts | Spread request simplification |
| ui/src/api/search/action.ts | Spread request simplification |
| ui/.prettierrc | Remove Prettier config |
| ui/.prettierignore | Remove Prettier ignore |
| ui/.eslintrc | Remove ESLint config |
| hooks/prettier.sh | Remove Prettier hook script |
| hooks/oxlint.sh | Add oxlint pre-commit script |
| documentation/docs/developer/frontend.md | Update frontend tooling docs |
| documentation/docs/developer/frontend.fr.md | Update frontend tooling docs (FR) |
| .prettierignore | Remove root Prettier ignore |
| .pre-commit-config.yaml | Add oxfmt/oxlint hooks |
| .github/workflows/ui-workflow.yml | Update UI CI checks to oxfmt/oxlint |
| .github/copilot-instructions.md | Update Copilot UI lint/format notes |
Files excluded by content exclusion policy (6)
- .vscode/extensions.json
- .vscode/settings.json
- ui/.oxfmtrc.json
- ui/.oxlintrc.json
- ui/package.json
- ui/tsconfig.json
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates typescript to v7, moves from prettier/eslint to oxfmt/oxlint, and updates the relevant formatting.
This pull request migrates the Howler UI project from using Prettier and ESLint for code formatting and linting to the Oxc project's
oxfmt(formatter) andoxlint(linter) tools. It updates all related documentation, configuration, and CI workflows to reflect this change. Additionally, it fixes a TypeScript import issue with the Roboto font in the UI and documents this fix in the changelog.Tooling migration to oxfmt/oxlint:
oxfmtandoxlintthroughout the UI, including removal of.eslintrc,.prettierrc, and.prettierignore, and adds corresponding pre-commit hooks and workflow steps. (ui/.eslintrc,ui/.prettierrc,ui/.prettierignore,.pre-commit-config.yaml,.github/workflows/ui-workflow.yml, [1] [2] [3] [4] [5] [6] [7]oxfmtandoxlintinstead of Prettier/ESLint, and clarifies the new linting/formatting workflow. (documentation/docs/developer/frontend.md,documentation/docs/developer/frontend.fr.md,.github/copilot-instructions.md, [1] [2] [3] [4] [5] [6]Changelog and bug fix:
@fontsource/robotoby switching to an explicit CSS entry import, and documents this in the changelog. (docs/RELEASES.md, docs/RELEASES.mdR3-R6)Other improvements:
.github/copilot-instructions.md, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10].github/workflows/ui-workflow.yml, .github/workflows/ui-workflow.ymlR202-R205)These changes modernize the project's frontend tooling, streamline formatting/linting, and resolve a key UI build issue.