eslint-plugin-microsoft-typescript
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -26,6 +26,17 @@ "use strict"; | ||
}, | ||
defaultOptions: [{ allowNamedFunctions: false, allowDeclarations: false }], | ||
defaultOptions: [{ | ||
allowNamedFunctions: false, | ||
allowDeclarations: false, | ||
}], | ||
create: function (context, _a) { | ||
var _b = _a[0], allowNamedFunctions = _b.allowNamedFunctions, allowDeclarations = _b.allowDeclarations; | ||
var isThisParameter = function (node) { return (node.params.length && !!node.params.find(function (param) { return param.type === experimental_utils_1.AST_NODE_TYPES.Identifier && param.name === 'this'; })); }; | ||
var shouldIgnore = function (node) { | ||
var parent = node.parent; | ||
if (!parent) { | ||
return false; | ||
} | ||
return node.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression | ||
&& (parent.type === experimental_utils_1.AST_NODE_TYPES.Property || parent.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition); | ||
}; | ||
var stack = []; | ||
@@ -45,3 +56,3 @@ var enterFunction = function () { | ||
} | ||
if (allowNamedFunctions && node.id !== null) { | ||
if ((allowNamedFunctions && node.id !== null) || shouldIgnore(node)) { | ||
return; | ||
@@ -48,0 +59,0 @@ } |
{ | ||
"name": "eslint-plugin-microsoft-typescript", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "ESlint rules for TypeScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
24865
492