diff --git a/site/.oxlintrc.jsonc b/site/.oxlintrc.jsonc index d42bc11d2f2..01f29af5013 100644 --- a/site/.oxlintrc.jsonc +++ b/site/.oxlintrc.jsonc @@ -185,6 +185,7 @@ "new-for-builtins": "error", "no-explicit-any": "error", "no-irregular-whitespace": "error", + "no-redeclare": "error", "no-use-before-define": [ "error", { "functions": false, "classes": false, "variables": false } @@ -205,7 +206,6 @@ // ========================================================== "no-autofocus": "off", // a11y/noAutofocus (large) "no-invalid-void-type": "off", // suspicious/noConfusingVoidType (large) - "no-redeclare": "off", // suspicious/noRedeclare (medium: TS declaration merging) "no-inferrable-types": "off", // style/noInferrableTypes (medium, coder error rule) "jsx-curly-brace-presence": "off", // style/useConsistentCurlyBraces (medium, coder error rule) "no-fallthrough": "off", // suspicious/noFallthroughSwitchClause (medium) diff --git a/site/src/components/FullPageLayout/Sidebar.tsx b/site/src/components/FullPageLayout/Sidebar.tsx index bae784b9179..560ec772e97 100644 --- a/site/src/components/FullPageLayout/Sidebar.tsx +++ b/site/src/components/FullPageLayout/Sidebar.tsx @@ -55,11 +55,12 @@ export const SidebarCaption: FC> = (props) => { ); }; -interface SidebarIconButton extends ComponentProps { +interface SidebarIconButtonProps + extends ComponentProps { isActive: boolean; } -export const SidebarIconButton: FC = ({ +export const SidebarIconButton: FC = ({ isActive, className, ...buttonProps diff --git a/site/src/components/HelpPopover/HelpPopover.tsx b/site/src/components/HelpPopover/HelpPopover.tsx index 81ef44277bc..30ba3b23f71 100644 --- a/site/src/components/HelpPopover/HelpPopover.tsx +++ b/site/src/components/HelpPopover/HelpPopover.tsx @@ -104,12 +104,15 @@ export const HelpPopoverText: FC> = ({ ); }; -interface HelpPopoverLink { +interface HelpPopoverLinkProps { children?: ReactNode; href: string; } -export const HelpPopoverLink: FC = ({ children, href }) => { +export const HelpPopoverLink: FC = ({ + children, + href, +}) => { return ( = ({ ); }; -type UsersTable = { +type UsersTableProps = { error: unknown; onChange: (user: T, checked: boolean) => void; selected: readonly T[]; @@ -95,7 +95,7 @@ const UsersTable = ({ onChange, selected, users, -}: UsersTable) => { +}: UsersTableProps) => { if (error) { return (
diff --git a/site/src/components/Timeline/TimelineDateRow.tsx b/site/src/components/Timeline/TimelineDateRow.tsx index f3395e445a9..1740c99ebbd 100644 --- a/site/src/components/Timeline/TimelineDateRow.tsx +++ b/site/src/components/Timeline/TimelineDateRow.tsx @@ -3,11 +3,11 @@ import { TableCell, TableRow } from "#/components/Table/Table"; import { formatDate } from "#/utils/time"; import { createDisplayDate } from "./utils"; -export interface TimelineDateRow { +interface TimelineDateRowProps { date: Date; } -export const TimelineDateRow: FC = ({ date }) => { +export const TimelineDateRow: FC = ({ date }) => { return ( void; onCancel: () => void; @@ -79,7 +79,7 @@ export interface TemplateSettingsForm { portSharingControlsEnabled: boolean; } -export const TemplateSettingsForm: FC = ({ +export const TemplateSettingsForm: FC = ({ template, onSubmit, onCancel, diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm.tsx index f80860b259e..2f29447cd14 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm.tsx @@ -61,7 +61,7 @@ const FAILURE_CLEANUP_DEFAULT = 7 * MS_DAY_CONVERSION; const INACTIVITY_CLEANUP_DEFAULT = 180 * MS_DAY_CONVERSION; const DORMANT_AUTODELETION_DEFAULT = 30 * MS_DAY_CONVERSION; -export interface TemplateScheduleForm { +interface TemplateScheduleFormProps { template: Template; onSubmit: (data: UpdateTemplateMeta) => void; onCancel: () => void; @@ -72,7 +72,7 @@ export interface TemplateScheduleForm { initialTouched?: FormikTouched; } -export const TemplateScheduleForm: FC = ({ +export const TemplateScheduleForm: FC = ({ template, onSubmit, onCancel, diff --git a/site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesForm.tsx b/site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesForm.tsx index d2bdb7ea9ea..faba73aad65 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesForm.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesForm.tsx @@ -21,7 +21,7 @@ import { TemplateVariableField, } from "./TemplateVariableField"; -export interface TemplateVariablesForm { +interface TemplateVariablesFormProps { templateVersion: TemplateVersion; templateVariables: TemplateVersionVariable[]; onSubmit: (data: CreateTemplateVersionRequest) => void; @@ -31,7 +31,7 @@ export interface TemplateVariablesForm { // Helpful to show field errors on Storybook initialTouched?: FormikTouched; } -export const TemplateVariablesForm: FC = ({ +export const TemplateVariablesForm: FC = ({ templateVersion, templateVariables, onSubmit, diff --git a/site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx b/site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx index ef23598e8e2..8400c4fa31b 100644 --- a/site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx @@ -10,7 +10,7 @@ import { } from "#/components/Popover/Popover"; import type { ThemeRole } from "#/theme/roles"; -export type NotificationItem = { +export type Notification = { title: string; severity: AlertProps["severity"]; detail?: ReactNode; @@ -20,7 +20,7 @@ export type NotificationItem = { type NotificationSeverity = "warning" | "info"; type NotificationsProps = { - items: NotificationItem[]; + items: Notification[]; severity: NotificationSeverity; icon: ReactNode; }; @@ -131,7 +131,7 @@ const NotificationPill: FC = ({ }; interface NotificationItemProps { - notification: NotificationItem; + notification: Notification; } const NotificationItem: FC = ({ notification }) => { diff --git a/site/src/pages/WorkspacePage/WorkspaceNotifications/WorkspaceNotifications.tsx b/site/src/pages/WorkspacePage/WorkspaceNotifications/WorkspaceNotifications.tsx index be4202e0e60..7a87dfc67e0 100644 --- a/site/src/pages/WorkspacePage/WorkspaceNotifications/WorkspaceNotifications.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceNotifications/WorkspaceNotifications.tsx @@ -19,8 +19,8 @@ import { useQuery } from "react-query"; import { formatDate } from "#/utils/time"; import type { WorkspacePermissions } from "../../../modules/workspaces/permissions"; import { + type Notification, NotificationActionButton, - type NotificationItem, Notifications, } from "./Notifications"; @@ -43,7 +43,7 @@ export const WorkspaceNotifications: FC = ({ onUpdateWorkspace, onActivateWorkspace, }) => { - const notifications: NotificationItem[] = []; + const notifications: Notification[] = []; // Outdated const canAutostartQuery = useQuery(workspaceResolveAutostart(workspace.id));