diff --git a/.eslintrc.json b/.eslintrc.json index 8263b08a9..d977e8980 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,22 @@ { - "extends": ["@excalidraw/eslint-config", "react-app"], + "extends": [ + "@excalidraw/eslint-config", + "react-app" + ], "rules": { "import/order": [ "warn", { - "groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"], + "groups": [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + "object", + "type" + ], "pathGroups": [ { "pattern": "@excalidraw/**", @@ -32,6 +44,12 @@ "name": "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 + } ] } } diff --git a/excalidraw-app/components/AI.tsx b/excalidraw-app/components/AI.tsx index 4469d74f6..9a222a968 100644 --- a/excalidraw-app/components/AI.tsx +++ b/excalidraw-app/components/AI.tsx @@ -73,7 +73,7 @@ export const AIComponents = ({
You can also try Excalidraw+ to get more requests.
+ }/plus?utm_source=excalidraw&utm_medium=app&utm_content=d2c" target="_blank" rel="noopener">Excalidraw+ to get more requests. `, diff --git a/excalidraw-app/components/EncryptedIcon.tsx b/excalidraw-app/components/EncryptedIcon.tsx index 552e7ca82..f7d8ca601 100644 --- a/excalidraw-app/components/EncryptedIcon.tsx +++ b/excalidraw-app/components/EncryptedIcon.tsx @@ -10,7 +10,7 @@ export const EncryptedIcon = () => { className="encrypted-icon tooltip" href="https://plus.excalidraw.com/blog/end-to-end-encryption" target="_blank" - rel="noopener noreferrer" + rel="noopener" aria-label={t("encrypted.link")} > diff --git a/excalidraw-app/components/ExcalidrawPlusAppLink.tsx b/excalidraw-app/components/ExcalidrawPlusAppLink.tsx index 76be9a8f0..04cd96302 100644 --- a/excalidraw-app/components/ExcalidrawPlusAppLink.tsx +++ b/excalidraw-app/components/ExcalidrawPlusAppLink.tsx @@ -10,7 +10,7 @@ export const ExcalidrawPlusAppLink = () => { import.meta.env.VITE_APP_PLUS_APP }?utm_source=excalidraw&utm_medium=app&utm_content=signedInUserRedirectButton#excalidraw-redirect`} target="_blank" - rel="noreferrer" + rel="noopener" className="plus-button" > Go to Excalidraw+ diff --git a/packages/excalidraw/components/HelpDialog.tsx b/packages/excalidraw/components/HelpDialog.tsx index 60fc40372..9dd9550ac 100644 --- a/packages/excalidraw/components/HelpDialog.tsx +++ b/packages/excalidraw/components/HelpDialog.tsx @@ -21,7 +21,7 @@ const Header = () => ( className="HelpDialog__btn" href="https://docs.excalidraw.com" target="_blank" - rel="noopener noreferrer" + rel="noopener" >
{ExternalLinkIcon}
{t("helpDialog.documentation")} @@ -30,7 +30,7 @@ const Header = () => ( className="HelpDialog__btn" href="https://plus.excalidraw.com/blog" target="_blank" - rel="noopener noreferrer" + rel="noopener" >
{ExternalLinkIcon}
{t("helpDialog.blog")} diff --git a/packages/excalidraw/components/PublishLibrary.tsx b/packages/excalidraw/components/PublishLibrary.tsx index c1db91296..580b909d4 100644 --- a/packages/excalidraw/components/PublishLibrary.tsx +++ b/packages/excalidraw/components/PublishLibrary.tsx @@ -389,7 +389,7 @@ const PublishLibrary = ({ {el} diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.tsx index 1457f5ae7..d4f549c84 100644 --- a/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.tsx +++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.tsx @@ -16,7 +16,7 @@ const DropdownMenuItemLink = ({ onSelect, className = "", selected, - rel = "noreferrer", + rel = "noopener", ...rest }: { href: string; @@ -31,11 +31,12 @@ const DropdownMenuItemLink = ({ const handleClick = useHandleDropdownMenuItemClick(rest.onClick, onSelect); return ( + // eslint-disable-next-line react/jsx-no-target-blank {children}