fix: remove noreferrer on internal links

This commit is contained in:
dwelle 2025-04-29 17:44:18 +02:00
parent 2a0d15799c
commit 211c1a0d1c
8 changed files with 30 additions and 11 deletions

View file

@ -1,10 +1,22 @@
{ {
"extends": ["@excalidraw/eslint-config", "react-app"], "extends": [
"@excalidraw/eslint-config",
"react-app"
],
"rules": { "rules": {
"import/order": [ "import/order": [
"warn", "warn",
{ {
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"], "groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
],
"pathGroups": [ "pathGroups": [
{ {
"pattern": "@excalidraw/**", "pattern": "@excalidraw/**",
@ -32,6 +44,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

@ -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}