Socket
Socket
Sign inDemoInstall

eslint-plugin-flowtype

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-flowtype - npm Package Compare versions

Comparing version 3.10.1 to 3.10.2

50

dist/rules/useFlowType.js

@@ -12,3 +12,25 @@ 'use strict';

};
var markTypeAsUsedWithGenericType = function markTypeAsUsedWithGenericType(node) {
var typeId = void 0;
var scope = void 0;
var variable = void 0;
if (node.id.type === 'Identifier') {
typeId = node.id;
} else if (node.id.type === 'QualifiedTypeIdentifier') {
typeId = node.id;
do {
typeId = typeId.qualification;
} while (typeId.qualification);
}
for (scope = context.getScope(); scope; scope = scope.upper) {
variable = scope.set.get(typeId.name);
if (variable && variable.defs.length) {
context.markVariableAsUsed(typeId.name);
break;
}
}
};
return {

@@ -19,23 +41,11 @@ DeclareClass: markTypeAsUsed,

DeclareVariable: markTypeAsUsed,
GenericTypeAnnotation(node) {
var typeId = void 0;
var scope = void 0;
var variable = void 0;
if (node.id.type === 'Identifier') {
typeId = node.id;
} else if (node.id.type === 'QualifiedTypeIdentifier') {
typeId = node.id;
do {
typeId = typeId.qualification;
} while (typeId.qualification);
}
for (scope = context.getScope(); scope; scope = scope.upper) {
variable = scope.set.get(typeId.name);
if (variable && variable.defs.length) {
context.markVariableAsUsed(typeId.name);
break;
GenericTypeAnnotation: markTypeAsUsedWithGenericType,
TypeParameterDeclaration(node) {
node.params.forEach(function (param) {
if (param.default && param.default.typeParameters) {
param.default.typeParameters.params.forEach(function (typeParameterNode) {
markTypeAsUsedWithGenericType(typeParameterNode);
});
}
}
});
}

@@ -42,0 +52,0 @@ };

2

package.json

@@ -63,3 +63,3 @@ {

},
"version": "3.10.1"
"version": "3.10.2"
}
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