eslint-plugin-react
Advanced tools
Comparing version 7.26.0 to 7.26.1
@@ -100,3 +100,4 @@ /** | ||
const messages = { | ||
noTargetBlank: 'Using target="_blank" without rel="noreferrer" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener' | ||
noTargetBlankWithoutNoreferrer: 'Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations', | ||
noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noreferrer" or rel="noopener" (the former implies the latter and is preferred due to wider support) is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations' | ||
}; | ||
@@ -177,3 +178,4 @@ | ||
if (hasDangerousLink && !hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttributeIndex)) { | ||
report(context, messages.noTargetBlank, 'noTargetBlank', { | ||
const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer'; | ||
report(context, messages[messageId], messageId, { | ||
node, | ||
@@ -249,3 +251,4 @@ fix(fixer) { | ||
) { | ||
report(context, messages.noTargetBlank, 'noTargetBlank', { | ||
const messageId = allowReferrer ? 'noTargetBlankWithoutNoopener' : 'noTargetBlankWithoutNoreferrer'; | ||
report(context, messages[messageId], messageId, { | ||
node | ||
@@ -252,0 +255,0 @@ }); |
@@ -43,3 +43,3 @@ /** | ||
const name = node.arguments[0].value; | ||
if (name.indexOf(':') === -1) return undefined; | ||
if (typeof name !== 'string' || name.indexOf(':') === -1) return undefined; | ||
report(context, messages.noNamespace, 'noNamespace', { | ||
@@ -55,3 +55,3 @@ node, | ||
const name = elementType(node); | ||
if (name.indexOf(':') === -1) return undefined; | ||
if (typeof name !== 'string' || name.indexOf(':') === -1) return undefined; | ||
report(context, messages.noNamespace, 'noNamespace', { | ||
@@ -58,0 +58,0 @@ node, |
{ | ||
"name": "eslint-plugin-react", | ||
"version": "7.26.0", | ||
"version": "7.26.1", | ||
"author": "Yannick Croissant <yannick.croissant+npm@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "React specific linting rules for ESLint", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
642248
17830