Socket
Socket
Sign inDemoInstall

eslint-plugin-react

Package Overview
Dependencies
188
Maintainers
2
Versions
202
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.20.4 to 7.20.5

8

lib/rules/jsx-curly-brace-presence.js

@@ -103,7 +103,7 @@ /**

function needToEscapeCharacterForJSX(raw) {
function needToEscapeCharacterForJSX(raw, node) {
return (
containsBackslash(raw)
|| containsHTMLEntity(raw)
|| containsDisallowedJSXTextChars(raw)
|| (node.parent.type !== 'JSXAttribute' && containsDisallowedJSXTextChars(raw))
);

@@ -242,3 +242,3 @@ }

)
&& !needToEscapeCharacterForJSX(expression.raw) && (
&& !needToEscapeCharacterForJSX(expression.raw, JSXExpressionNode) && (
jsxUtil.isJSX(JSXExpressionNode.parent)

@@ -254,3 +254,3 @@ || !containsQuoteCharacters(expression.value)

&& !isStringWithTrailingWhiteSpaces(expression.quasis[0].value.raw)
&& !needToEscapeCharacterForJSX(expression.quasis[0].value.raw) && (
&& !needToEscapeCharacterForJSX(expression.quasis[0].value.raw, JSXExpressionNode) && (
jsxUtil.isJSX(JSXExpressionNode.parent)

@@ -257,0 +257,0 @@ || !containsQuoteCharacters(expression.quasis[0].value.cooked)

@@ -222,9 +222,25 @@ /**

function handleES6ComponentEnter(node) {
if (utils.isES6Component(node)) {
classInfo = getInitialClassInfo();
}
}
function handleES6ComponentExit() {
if (!classInfo) {
return;
}
reportUnusedFields();
classInfo = null;
}
return {
ClassDeclaration(node) {
if (utils.isES6Component(node)) {
classInfo = getInitialClassInfo();
}
},
ClassDeclaration: handleES6ComponentEnter,
'ClassDeclaration:exit': handleES6ComponentExit,
ClassExpression: handleES6ComponentEnter,
'ClassExpression:exit': handleES6ComponentExit,
ObjectExpression(node) {

@@ -247,10 +263,2 @@ if (utils.isES5Component(node)) {

'ClassDeclaration:exit'() {
if (!classInfo) {
return;
}
reportUnusedFields();
classInfo = null;
},
CallExpression(node) {

@@ -257,0 +265,0 @@ if (!classInfo) {

@@ -692,3 +692,3 @@ /**

node.type === 'FunctionDeclaration'
&& isFirstLetterCapitalized(node.id.name)
&& (!node.id || isFirstLetterCapitalized(node.id.name))
&& utils.isReturningJSXOrNull(node)

@@ -695,0 +695,0 @@ ) {

{
"name": "eslint-plugin-react",
"version": "7.20.4",
"version": "7.20.5",
"author": "Yannick Croissant <yannick.croissant+npm@gmail.com>",

@@ -5,0 +5,0 @@ "description": "React specific linting rules for ESLint",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc