fix: remove noreferrer on internal links (#9452)

* fix: remove `noreferrer` on internal links

* fix snaps

* fix lint
This commit is contained in:
David Luzar 2025-04-29 18:45:17 +02:00 committed by GitHub
parent 2a0d15799c
commit 4a60fe3d22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 21 additions and 14 deletions

View file

@ -32,6 +32,12 @@
"name": "jotai", "name": "jotai",
"message": "Do not import from \"jotai\" directly. Use our app-specific modules (\"editor-jotai\" or \"app-jotai\")." "message": "Do not import from \"jotai\" directly. Use our app-specific modules (\"editor-jotai\" or \"app-jotai\")."
} }
],
"react/jsx-no-target-blank": [
"error",
{
"allowReferrer": true
}
] ]
} }
} }

View file

@ -73,7 +73,7 @@ export const AIComponents = ({
</br> </br>
<div>You can also try <a href="${ <div>You can also try <a href="${
import.meta.env.VITE_APP_PLUS_LP import.meta.env.VITE_APP_PLUS_LP
}/plus?utm_source=excalidraw&utm_medium=app&utm_content=d2c" target="_blank" rel="noreferrer noopener">Excalidraw+</a> to get more requests.</div> }/plus?utm_source=excalidraw&utm_medium=app&utm_content=d2c" target="_blank" rel="noopener">Excalidraw+</a> to get more requests.</div>
</div> </div>
</body> </body>
</html>`, </html>`,

View file

@ -10,7 +10,7 @@ export const EncryptedIcon = () => {
className="encrypted-icon tooltip" className="encrypted-icon tooltip"
href="https://plus.excalidraw.com/blog/end-to-end-encryption" href="https://plus.excalidraw.com/blog/end-to-end-encryption"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener"
aria-label={t("encrypted.link")} aria-label={t("encrypted.link")}
> >
<Tooltip label={t("encrypted.tooltip")} long={true}> <Tooltip label={t("encrypted.tooltip")} long={true}>

View file

@ -10,7 +10,7 @@ export const ExcalidrawPlusAppLink = () => {
import.meta.env.VITE_APP_PLUS_APP import.meta.env.VITE_APP_PLUS_APP
}?utm_source=excalidraw&utm_medium=app&utm_content=signedInUserRedirectButton#excalidraw-redirect`} }?utm_source=excalidraw&utm_medium=app&utm_content=signedInUserRedirectButton#excalidraw-redirect`}
target="_blank" target="_blank"
rel="noreferrer" rel="noopener"
className="plus-button" className="plus-button"
> >
Go to Excalidraw+ Go to Excalidraw+

View file

@ -198,7 +198,7 @@ exports[`Test MobileMenu > should initialize with welcome screen and hide once u
<a <a
class="welcome-screen-menu-item " class="welcome-screen-menu-item "
href="undefined/plus?utm_source=excalidraw&utm_medium=app&utm_content=welcomeScreenGuest" href="undefined/plus?utm_source=excalidraw&utm_medium=app&utm_content=welcomeScreenGuest"
rel="noreferrer" rel="noopener"
target="_blank" target="_blank"
> >
<div <div

View file

@ -21,7 +21,7 @@ const Header = () => (
className="HelpDialog__btn" className="HelpDialog__btn"
href="https://docs.excalidraw.com" href="https://docs.excalidraw.com"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener"
> >
<div className="HelpDialog__link-icon">{ExternalLinkIcon}</div> <div className="HelpDialog__link-icon">{ExternalLinkIcon}</div>
{t("helpDialog.documentation")} {t("helpDialog.documentation")}
@ -30,7 +30,7 @@ const Header = () => (
className="HelpDialog__btn" className="HelpDialog__btn"
href="https://plus.excalidraw.com/blog" href="https://plus.excalidraw.com/blog"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener"
> >
<div className="HelpDialog__link-icon">{ExternalLinkIcon}</div> <div className="HelpDialog__link-icon">{ExternalLinkIcon}</div>
{t("helpDialog.blog")} {t("helpDialog.blog")}

View file

@ -389,7 +389,7 @@ const PublishLibrary = ({
<a <a
href="https://libraries.excalidraw.com" href="https://libraries.excalidraw.com"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener"
> >
{el} {el}
</a> </a>

View file

@ -16,7 +16,7 @@ const DropdownMenuItemLink = ({
onSelect, onSelect,
className = "", className = "",
selected, selected,
rel = "noreferrer", rel = "noopener",
...rest ...rest
}: { }: {
href: string; href: string;
@ -31,11 +31,12 @@ const DropdownMenuItemLink = ({
const handleClick = useHandleDropdownMenuItemClick(rest.onClick, onSelect); const handleClick = useHandleDropdownMenuItemClick(rest.onClick, onSelect);
return ( return (
// eslint-disable-next-line react/jsx-no-target-blank
<a <a
{...rest} {...rest}
href={href} href={href}
target="_blank" target="_blank"
rel="noreferrer" rel={rel || "noopener"}
className={getDropdownMenuItemClassName(className, selected)} className={getDropdownMenuItemClassName(className, selected)}
title={rest.title ?? rest["aria-label"]} title={rest.title ?? rest["aria-label"]}
onClick={handleClick} onClick={handleClick}

View file

@ -78,7 +78,7 @@ const WelcomeScreenMenuItemLink = ({
className={`welcome-screen-menu-item ${className}`} className={`welcome-screen-menu-item ${className}`}
href={href} href={href}
target="_blank" target="_blank"
rel="noreferrer" rel="noopener"
> >
<WelcomeScreenMenuItemContent icon={icon} shortcut={shortcut}> <WelcomeScreenMenuItemContent icon={icon} shortcut={shortcut}>
{children} {children}

View file

@ -21,7 +21,7 @@ exports[`<Excalidraw/> > <MainMenu/> > should render main menu with host menu it
<a <a
class="dropdown-menu-item dropdown-menu-item-base" class="dropdown-menu-item dropdown-menu-item-base"
href="blog.excalidaw.com" href="blog.excalidaw.com"
rel="noreferrer" rel="noopener"
target="_blank" target="_blank"
> >
<div <div
@ -392,7 +392,7 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
aria-label="GitHub" aria-label="GitHub"
class="dropdown-menu-item dropdown-menu-item-base" class="dropdown-menu-item dropdown-menu-item-base"
href="https://github.com/excalidraw/excalidraw" href="https://github.com/excalidraw/excalidraw"
rel="noreferrer" rel="noopener"
target="_blank" target="_blank"
title="GitHub" title="GitHub"
> >
@ -426,7 +426,7 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
aria-label="X" aria-label="X"
class="dropdown-menu-item dropdown-menu-item-base" class="dropdown-menu-item dropdown-menu-item-base"
href="https://x.com/excalidraw" href="https://x.com/excalidraw"
rel="noreferrer" rel="noopener"
target="_blank" target="_blank"
title="X" title="X"
> >
@ -472,7 +472,7 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
aria-label="Discord" aria-label="Discord"
class="dropdown-menu-item dropdown-menu-item-base" class="dropdown-menu-item dropdown-menu-item-base"
href="https://discord.gg/UexuTaE" href="https://discord.gg/UexuTaE"
rel="noreferrer" rel="noopener"
target="_blank" target="_blank"
title="Discord" title="Discord"
> >