eslint-plugin-flowtype
Advanced tools
Comparing version 2.2.7 to 2.3.0
@@ -15,2 +15,6 @@ 'use strict'; | ||
var _requireValidFileAnnotation = require('./rules/requireValidFileAnnotation'); | ||
var _requireValidFileAnnotation2 = _interopRequireDefault(_requireValidFileAnnotation); | ||
var _spaceAfterTypeColon = require('./rules/spaceAfterTypeColon'); | ||
@@ -34,2 +38,3 @@ | ||
'require-return-type': _requireReturnType2.default, | ||
'require-valid-file-annotation': _requireValidFileAnnotation2.default, | ||
'space-after-type-colon': _spaceAfterTypeColon2.default, | ||
@@ -47,3 +52,2 @@ 'space-before-type-colon': _spaceBeforeTypeColon2.default, | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=index.js.map | ||
module.exports = exports['default']; |
@@ -7,10 +7,6 @@ 'use strict'; | ||
var _forEach2 = require('lodash/forEach'); | ||
var _lodash = require('lodash'); | ||
var _forEach3 = _interopRequireDefault(_forEach2); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _utilities = require('./../utilities'); | ||
@@ -21,3 +17,3 @@ | ||
exports.default = (0, _utilities.iterateFunctionNodes)(function (context) { | ||
var checkThisFile = !(0, _get3.default)(context, 'settings.flowtype.onlyFilesWithFlowAnnotation') || (0, _utilities.isFlowFile)(context); | ||
var checkThisFile = !_lodash2.default.get(context, 'settings.flowtype.onlyFilesWithFlowAnnotation') || (0, _utilities.isFlowFile)(context); | ||
@@ -29,5 +25,5 @@ if (!checkThisFile) { | ||
return function (functionNode) { | ||
(0, _forEach3.default)(functionNode.params, function (identifierNode) { | ||
_lodash2.default.forEach(functionNode.params, function (identifierNode) { | ||
var parameterName = (0, _utilities.getParameterName)(identifierNode, context); | ||
var typeAnnotation = (0, _get3.default)(identifierNode, 'typeAnnotation') || (0, _get3.default)(identifierNode, 'left.typeAnnotation'); | ||
var typeAnnotation = _lodash2.default.get(identifierNode, 'typeAnnotation') || _lodash2.default.get(identifierNode, 'left.typeAnnotation'); | ||
@@ -40,3 +36,2 @@ if (!typeAnnotation) { | ||
}); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=requireParameterType.js.map | ||
module.exports = exports['default']; |
@@ -7,5 +7,5 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _lodash = require('lodash'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
@@ -17,3 +17,3 @@ var _utilities = require('./../utilities'); | ||
exports.default = function (context) { | ||
var checkThisFile = !(0, _get3.default)(context, 'settings.flowtype.onlyFilesWithFlowAnnotation') || (0, _utilities.isFlowFile)(context); | ||
var checkThisFile = !_lodash2.default.get(context, 'settings.flowtype.onlyFilesWithFlowAnnotation') || (0, _utilities.isFlowFile)(context); | ||
@@ -24,4 +24,4 @@ if (!checkThisFile) { | ||
var annotateReturn = ((0, _get3.default)(context, 'options[0]') || 'always') === 'always'; | ||
var annotateUndefined = ((0, _get3.default)(context, 'options[1].annotateUndefined') || 'never') === 'always'; | ||
var annotateReturn = (_lodash2.default.get(context, 'options[0]') || 'always') === 'always'; | ||
var annotateUndefined = (_lodash2.default.get(context, 'options[1].annotateUndefined') || 'never') === 'always'; | ||
@@ -41,4 +41,4 @@ var targetNodes = []; | ||
var getIsReturnTypeAnnotationUndefined = function getIsReturnTypeAnnotationUndefined(targetNode) { | ||
var isReturnTypeAnnotationLiteralUndefined = (0, _get3.default)(targetNode, 'functionNode.returnType.typeAnnotation.id.name') === 'undefined' && (0, _get3.default)(targetNode, 'functionNode.returnType.typeAnnotation.type') === 'GenericTypeAnnotation'; | ||
var isReturnTypeAnnotationVoid = (0, _get3.default)(targetNode, 'functionNode.returnType.typeAnnotation.type') === 'VoidTypeAnnotation'; | ||
var isReturnTypeAnnotationLiteralUndefined = _lodash2.default.get(targetNode, 'functionNode.returnType.typeAnnotation.id.name') === 'undefined' && _lodash2.default.get(targetNode, 'functionNode.returnType.typeAnnotation.type') === 'GenericTypeAnnotation'; | ||
var isReturnTypeAnnotationVoid = _lodash2.default.get(targetNode, 'functionNode.returnType.typeAnnotation.type') === 'VoidTypeAnnotation'; | ||
@@ -91,3 +91,2 @@ return isReturnTypeAnnotationLiteralUndefined || isReturnTypeAnnotationVoid; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=requireReturnType.js.map | ||
module.exports = exports['default']; |
@@ -7,10 +7,6 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _lodash = require('lodash'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _forEach2 = require('lodash/forEach'); | ||
var _forEach3 = _interopRequireDefault(_forEach2); | ||
var _utilities = require('./../utilities'); | ||
@@ -24,5 +20,5 @@ | ||
return function (functionNode) { | ||
(0, _forEach3.default)(functionNode.params, function (identifierNode) { | ||
_lodash2.default.forEach(functionNode.params, function (identifierNode) { | ||
var parameterName = (0, _utilities.getParameterName)(identifierNode, context); | ||
var typeAnnotation = (0, _get3.default)(identifierNode, 'typeAnnotation') || (0, _get3.default)(identifierNode, 'left.typeAnnotation'); | ||
var typeAnnotation = _lodash2.default.get(identifierNode, 'typeAnnotation') || _lodash2.default.get(identifierNode, 'left.typeAnnotation'); | ||
@@ -55,3 +51,2 @@ if (typeAnnotation) { | ||
}); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=spaceAfterTypeColon.js.map | ||
module.exports = exports['default']; |
@@ -7,10 +7,6 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _lodash = require('lodash'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _forEach2 = require('lodash/forEach'); | ||
var _forEach3 = _interopRequireDefault(_forEach2); | ||
var _utilities = require('./../utilities'); | ||
@@ -24,5 +20,5 @@ | ||
return function (functionNode) { | ||
(0, _forEach3.default)(functionNode.params, function (identifierNode) { | ||
_lodash2.default.forEach(functionNode.params, function (identifierNode) { | ||
var parameterName = (0, _utilities.getParameterName)(identifierNode, context); | ||
var typeAnnotation = (0, _get3.default)(identifierNode, 'typeAnnotation') || (0, _get3.default)(identifierNode, 'left.typeAnnotation'); | ||
var typeAnnotation = _lodash2.default.get(identifierNode, 'typeAnnotation') || _lodash2.default.get(identifierNode, 'left.typeAnnotation'); | ||
@@ -43,3 +39,2 @@ if (typeAnnotation) { | ||
}); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=spaceBeforeTypeColon.js.map | ||
module.exports = exports['default']; |
@@ -25,3 +25,2 @@ 'use strict'; | ||
}; | ||
}; | ||
//# sourceMappingURL=typeIdMatch.js.map | ||
}; |
@@ -7,18 +7,14 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _lodash = require('lodash'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _has2 = require('lodash/has'); | ||
var _has3 = _interopRequireDefault(_has2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (identifierNode, context) { | ||
if ((0, _has3.default)(identifierNode, 'name')) { | ||
if (_lodash2.default.has(identifierNode, 'name')) { | ||
return identifierNode.name; | ||
} | ||
if ((0, _has3.default)(identifierNode, 'left.name')) { | ||
if (_lodash2.default.has(identifierNode, 'left.name')) { | ||
return identifierNode.left.name; | ||
@@ -34,3 +30,3 @@ } | ||
} | ||
if ((0, _get3.default)(identifierNode, 'left.type') === 'ObjectPattern' && (0, _get3.default)(identifierNode, 'right.type') === 'ObjectExpression') { | ||
if (_lodash2.default.get(identifierNode, 'left.type') === 'ObjectPattern' && _lodash2.default.get(identifierNode, 'right.type') === 'ObjectExpression') { | ||
return context.getSourceCode().getText(identifierNode.left); | ||
@@ -42,3 +38,2 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=getParameterName.js.map | ||
module.exports = exports['default']; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
}); | ||
exports.iterateFunctionNodes = exports.isFlowFile = exports.getParameterName = undefined; | ||
exports.iterateFunctionNodes = exports.isFlowFileAnnotation = exports.isFlowFile = exports.getParameterName = undefined; | ||
@@ -18,2 +18,6 @@ var _getParameterName2 = require('./getParameterName.js'); | ||
var _isFlowFileAnnotation2 = require('./isFlowFileAnnotation.js'); | ||
var _isFlowFileAnnotation3 = _interopRequireDefault(_isFlowFileAnnotation2); | ||
var _iterateFunctionNodes2 = require('./iterateFunctionNodes.js'); | ||
@@ -27,3 +31,3 @@ | ||
exports.isFlowFile = _isFlowFile3.default; | ||
exports.iterateFunctionNodes = _iterateFunctionNodes3.default; | ||
//# sourceMappingURL=index.js.map | ||
exports.isFlowFileAnnotation = _isFlowFileAnnotation3.default; | ||
exports.iterateFunctionNodes = _iterateFunctionNodes3.default; |
@@ -7,5 +7,5 @@ 'use strict'; | ||
var _includes2 = require('lodash/includes'); | ||
var _isFlowFileAnnotation = require('./isFlowFileAnnotation.js'); | ||
var _includes3 = _interopRequireDefault(_includes2); | ||
var _isFlowFileAnnotation2 = _interopRequireDefault(_isFlowFileAnnotation); | ||
@@ -23,6 +23,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
return (0, _includes3.default)(firstComment.value, '@flow'); | ||
return (0, _isFlowFileAnnotation2.default)(firstComment.value); | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=isFlowFile.js.map | ||
module.exports = exports['default']; |
@@ -19,3 +19,2 @@ "use strict"; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=iterateFunctionNodes.js.map | ||
module.exports = exports["default"]; |
{ | ||
"name": "eslint-plugin-flowtype", | ||
"description": "Flowtype linting rules for ESLint.", | ||
"version": "2.2.7", | ||
"version": "2.3.0", | ||
"main": "./dist/index.js", | ||
@@ -28,8 +28,6 @@ "repository": { | ||
"scripts": { | ||
"lint": "pragmatist lint", | ||
"test": "pragmatist test --type-assertions", | ||
"build": "pragmatist build --es5", | ||
"watch-test": "pragmatist watch-test --type-assertions", | ||
"watch-build": "pragmatist watch-build --es5", | ||
"readme-add-assertions": "babel-node --presets es2015 ./bin/readmeAssertions", | ||
"lint": "eslint ./src ./tests", | ||
"test": "mocha --compilers js:babel-register ./tests/rules/index.js", | ||
"build": "babel ./src --out-dir ./dist", | ||
"readme-add-assertions": "babel-node ./bin/readmeAssertions", | ||
"readme": "node ./node_modules/.bin/gitdown ./.README/README.md --output-file ./README.md; npm run readme-add-assertions", | ||
@@ -41,11 +39,13 @@ "create-index": "create-index ./src --update-index" | ||
"babel-eslint": "^6.0.2", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"babel-register": "^6.9.0", | ||
"chai": "^3.5.0", | ||
"create-index": "^0.1.2", | ||
"eslint": "^2.7.0", | ||
"eslint": "^2.13.1", | ||
"eslint-config-canonical": "^1.7.12", | ||
"gitdown": "^2.4.8", | ||
"globby": "^4.0.0", | ||
"mocha": "^2.4.5", | ||
"pragmatist": "^3.0.21" | ||
"mocha": "^2.5.3" | ||
} | ||
} |
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
25
380
39826
12
70