Socket
Socket
Sign inDemoInstall

eslint-plugin-react

Package Overview
Dependencies
Maintainers
1
Versions
208
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.6.0 to 3.6.1

7

CHANGELOG.md

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

## [3.6.1] - 2015-10-18
### Fixed
* Fix props validation in constructor ([#254][])
[3.6.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.6.0...v3.6.1
[#254]: https://github.com/yannickcr/eslint-plugin-react/issues/254
## [3.6.0] - 2015-10-18

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

22

lib/rules/prop-types.js

@@ -311,2 +311,17 @@ /**

/**
* Check if we are in a class constructor
* @return {boolean} true if we are in a class constructor, false if not
*/
function inConstructor() {
var scope = context.getScope();
while (scope) {
if (scope.block && scope.block.parent && scope.block.parent.kind === 'constructor') {
return true;
}
scope = scope.upper;
}
return false;
}
/**
* Retrieve the name of a property node

@@ -317,3 +332,6 @@ * @param {ASTNode} node The AST node with the property.

function getPropertyName(node) {
if (componentUtil.getNode(context, node)) {
if (componentUtil.getNode(context, node) && !inConstructor()) {
if (node.object.name === 'props') {
return void 0;
}
node = node.parent;

@@ -405,3 +423,3 @@ }

allNames: allNames,
node: node.object.name !== 'props' ? node.parent.property : node.property
node: node.object.name !== 'props' && !inConstructor() ? node.parent.property : node.property
});

@@ -408,0 +426,0 @@ break;

2

package.json
{
"name": "eslint-plugin-react",
"version": "3.6.0",
"version": "3.6.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