Rules
no-unsafe-target-blank
Full Name in eslint-plugin-react-dom
react-dom/no-unsafe-target-blankFull Name in @eslint-react/eslint-plugin
@eslint-react/dom/no-unsafe-target-blankFeatures
🔧
Presets
domrecommendedrecommended-typescriptrecommended-type-checked
Description
Prevents the use of target="_blank" without rel="noreferrer noopener".
Examples
Failing
import React from "react";
function MyComponent() {
return (
<a href="https://eslint-react.xyz" target="_blank">
Example
</a>
);
}Passing
import React from "react";
function MyComponent() {
return (
<a href="https://eslint-react.xyz" target="_blank" rel="noreferrer noopener">
Example
</a>
);
}Implementation
See Also
no-unsafe-iframe-sandbox
Enforcessandboxattribute foriframeelements is not set to unsafe combinations.