From dda9504bdd9c219f55d0aa091684b4e8a02fbf40 Mon Sep 17 00:00:00 2001 From: Chris Arderne Date: Wed, 19 Aug 2026 16:35:42 +0100 Subject: [PATCH] fix(webapp): require explicit native button types (#4692) ## Summary Add explicit types to native dashboard buttons and enforce `react/button-has-type`. This prevents action buttons from accidentally submitting a surrounding form. Shared button primitives retain their caller-selected submit and reset semantics with documented lint exceptions. Base: [#4691](https://github.com/triggerdotdev/trigger.dev/pull/4691) --- .oxlintrc.json | 1 + apps/webapp/app/components/code/TSQLResultsTable.tsx | 1 + apps/webapp/app/components/navigation/SideMenuItem.tsx | 2 ++ apps/webapp/app/components/primitives/AppliedFilter.tsx | 1 + apps/webapp/app/components/primitives/Buttons.tsx | 2 ++ apps/webapp/app/components/primitives/Popover.tsx | 2 ++ apps/webapp/app/components/primitives/Select.tsx | 1 + apps/webapp/app/components/primitives/Table.tsx | 2 ++ apps/webapp/app/components/primitives/Toast.tsx | 1 + apps/webapp/app/components/runs/v3/ai/AIChatMessages.tsx | 1 + apps/webapp/app/components/runs/v3/ai/AIToolsInventory.tsx | 1 + .../route.tsx | 1 + apps/webapp/app/routes/storybook.tsql-editor/route.tsx | 1 + 13 files changed, 17 insertions(+) diff --git a/.oxlintrc.json b/.oxlintrc.json index ee5c80fb1..17a03ad38 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -115,6 +115,7 @@ { "files": ["apps/webapp/app/**/*.ts", "apps/webapp/app/**/*.tsx"], "rules": { + "react/button-has-type": "error", "react/jsx-no-useless-fragment": "error", "react/no-unstable-nested-components": "error", "react/rules-of-hooks": "error", diff --git a/apps/webapp/app/components/code/TSQLResultsTable.tsx b/apps/webapp/app/components/code/TSQLResultsTable.tsx index 8556d1ff2..6da3caee0 100644 --- a/apps/webapp/app/components/code/TSQLResultsTable.tsx +++ b/apps/webapp/app/components/code/TSQLResultsTable.tsx @@ -970,6 +970,7 @@ function HeaderCellContent({ )} {onFilterClick && ( ); }); +/* oxlint-enable react/button-has-type */ diff --git a/apps/webapp/app/components/primitives/AppliedFilter.tsx b/apps/webapp/app/components/primitives/AppliedFilter.tsx index 6390a5826..cfb000164 100644 --- a/apps/webapp/app/components/primitives/AppliedFilter.tsx +++ b/apps/webapp/app/components/primitives/AppliedFilter.tsx @@ -67,6 +67,7 @@ export function AppliedFilter({ {removable && (