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 2.20.0 to 2.21.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="2.21.0"></a>
# [2.21.0](https://github.com/gajus/eslint-plugin-flowtype/compare/v2.20.0...v2.21.0) (2016-10-22)
### Features
* Add variance support to spaceBeforeTypeColon & spaceAfterTypeColon ([4a7f87f](https://github.com/gajus/eslint-plugin-flowtype/commit/4a7f87f)), closes [#137](https://github.com/gajus/eslint-plugin-flowtype/issues/137)
<a name="2.20.0"></a>

@@ -7,0 +17,0 @@ # [2.20.0](https://github.com/gajus/eslint-plugin-flowtype/compare/v2.19.0...v2.20.0) (2016-10-06)

18

dist/rules/spaceAfterTypeColon.js

@@ -170,7 +170,17 @@ 'use strict';

var getColon = function getColon(objectTypeProperty) {
if (objectTypeProperty.optional || objectTypeProperty.static) {
return sourceCode.getFirstToken(objectTypeProperty, 2);
} else {
return sourceCode.getFirstToken(objectTypeProperty, 1);
var tokenIndex = 1; // eslint-disable-line init-declarations
if (objectTypeProperty.optional) {
tokenIndex++;
}
if (objectTypeProperty.static) {
tokenIndex++;
}
if (objectTypeProperty.variance) {
tokenIndex++;
}
return sourceCode.getFirstToken(objectTypeProperty, tokenIndex);
};

@@ -177,0 +187,0 @@

@@ -113,9 +113,19 @@ 'use strict';

var getFirstTokens = function getFirstTokens(objectTypeProperty) {
var tokens = sourceCode.getFirstTokens(objectTypeProperty, 3);
var tokens = sourceCode.getFirstTokens(objectTypeProperty, 4);
if (objectTypeProperty.optional || objectTypeProperty.static) {
return [tokens[1], tokens[2]];
} else {
return [tokens[0], tokens[1]];
var tokenIndex = 0; // eslint-disable-line init-declarations
if (objectTypeProperty.optional) {
tokenIndex++;
}
if (objectTypeProperty.static) {
tokenIndex++;
}
if (objectTypeProperty.variance) {
tokenIndex++;
}
return [tokens[tokenIndex], tokens[tokenIndex + 1]];
};

@@ -122,0 +132,0 @@

@@ -31,3 +31,13 @@ 'use strict';

if (identifierNode.type === 'ObjectTypeProperty') {
return context.getSourceCode().getFirstToken(identifierNode, identifierNode.static ? 1 : 0).value;
var tokenIndex = 0; // eslint-disable-line init-declarations
if (identifierNode.static) {
tokenIndex++;
}
if (identifierNode.variance) {
tokenIndex++;
}
return context.getSourceCode().getFirstToken(identifierNode, tokenIndex).value;
}

@@ -34,0 +44,0 @@

{
"name": "eslint-plugin-flowtype",
"description": "Flowtype linting rules for ESLint.",
"version": "2.20.0",
"version": "2.21.0",
"main": "./dist/index.js",

@@ -6,0 +6,0 @@ "repository": {

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

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