Socket
Socket
Sign inDemoInstall

eslint-plugin-react

Package Overview
Dependencies
Maintainers
1
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react - npm Package Compare versions

Comparing version 3.7.0 to 3.7.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [3.7.1] - 2015-11-05
### Fixed
* Fix `sort-comp` crash on stateless components ([#285][])
* Fix crash in ES5 components detection ([#286][])
* Fix ES5 components detection from nested functions ([#287][])
[3.7.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.7.0...v3.7.1
[#285]: https://github.com/yannickcr/eslint-plugin-react/issues/285
[#286]: https://github.com/yannickcr/eslint-plugin-react/issues/286
[#287]: https://github.com/yannickcr/eslint-plugin-react/issues/287
## [3.7.0] - 2015-11-05

@@ -8,0 +19,0 @@ ### Added

24

lib/rules/sort-comp.js

@@ -78,14 +78,2 @@ /**

/**
* Checks if the component must be validated
* @param {Object} component The component to process
* @returns {Boolean} True if the component must be validated, false if not.
*/
function mustBeValidated(component) {
return (
component &&
!component.hasDisplayName
);
}
// --------------------------------------------------------------------------

@@ -240,6 +228,10 @@ // Public

function getComponentProperties(node) {
if (node.type === 'ClassDeclaration') {
return node.body.body;
switch (node.type) {
case 'ClassDeclaration':
return node.body.body;
case 'ObjectExpression':
return node.properties;
default:
return [];
}
return node.properties;
}

@@ -351,3 +343,3 @@

for (var component in list) {
if (!list.hasOwnProperty(component) || !mustBeValidated(list[component])) {
if (!list.hasOwnProperty(component)) {
continue;

@@ -354,0 +346,0 @@ }

@@ -113,3 +113,3 @@ /**

isES5Component: function(node) {
return sourceCode.getText(node.parent.callee) === 'React.createClass';
return node.parent && sourceCode.getText(node.parent.callee) === 'React.createClass';
},

@@ -183,7 +183,10 @@

var scope = context.getScope();
var node = scope.block && scope.block.parent && scope.block.parent.parent;
if (!node || !context.react.isES5Component(node)) {
return null;
while (scope) {
var node = scope.block && scope.block.parent && scope.block.parent.parent;
if (node && context.react.isES5Component(node)) {
return node;
}
scope = scope.upper;
}
return node;
return null;
},

@@ -190,0 +193,0 @@

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc