diff --git a/src/lib/components/badge/Badge.tsx b/src/lib/components/badge/Badge.tsx index 90ea40a..c0fade9 100644 --- a/src/lib/components/badge/Badge.tsx +++ b/src/lib/components/badge/Badge.tsx @@ -31,6 +31,7 @@ export const VuiBadge = ({ children, className, color, onClick, href, target, tr if (href) { return ( + // @ts-expect-error Type 'string' is not assignable to type 'HTMLAttributeReferrerPolicy | undefined'. {children} diff --git a/src/lib/components/button/BaseButton.tsx b/src/lib/components/button/BaseButton.tsx index d5403f3..6b613a8 100644 --- a/src/lib/components/button/BaseButton.tsx +++ b/src/lib/components/button/BaseButton.tsx @@ -81,6 +81,7 @@ export const BaseButton = forwardRef( }); return ( + // @ts-expect-error Type 'string' is not assignable to type 'HTMLAttributeReferrerPolicy | undefined'. ( if (href) { return ( + // @ts-expect-error Type 'string' is not assignable to type 'HTMLAttributeReferrerPolicy | undefined'. diff --git a/src/lib/components/summary/Summary.tsx b/src/lib/components/summary/Summary.tsx index ee96523..d72f320 100644 --- a/src/lib/components/summary/Summary.tsx +++ b/src/lib/components/summary/Summary.tsx @@ -6,7 +6,7 @@ import { VuiText } from "../typography/Text"; const markDownCitations = (summary: string) => { const citations = extractCitations(summary); return citations - .reduce((accum, { text, references }, index) => { + .reduce((accum, { text, references }) => { if (references) { accum.push(text); diff --git a/src/lib/utils/getTrackingProps.ts b/src/lib/utils/getTrackingProps.ts index afeb59c..3e3704e 100644 --- a/src/lib/utils/getTrackingProps.ts +++ b/src/lib/utils/getTrackingProps.ts @@ -3,8 +3,11 @@ export const getTrackingProps = (track?: boolean) => { return { // Protect against tabnabbing. rel: "noopener", - // Provide information for tracking, e.g. to docs. - referrerpolicy: "no-referrer-when-downgrade" + // Provide information for tracking, e.g. to docs. Technically this should be + // 'referrerpolicy' but React wants it in camel case. This clashes with + // react-router Link's HTMLAttributeReferrerPolicy type definition so we + // have to use @ts-expect-error at callsites that consume this helper. + referrerPolicy: "no-referrer-when-downgrade" }; } // Protect against tabnabbing and strip information from the referrer header.