eslint-plugin-flowtype
Advanced tools
Comparing version 2.20.0 to 2.21.0
@@ -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) |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146920
1543
2873