eslint-plugin-loopback-options
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -26,17 +26,2 @@ /** | ||
// variables should be defined here | ||
function validateExp(exp, node) { | ||
if (!(exp && exp.callee && exp.callee.property)) { | ||
return; | ||
} | ||
if (exp.callee.property.name === 'save' && exp.arguments.length === 0) { | ||
context.report(node, 'Options should be passed to save() function'); | ||
} | ||
if ( | ||
exp.callee.property.name === 'create' && | ||
exp.arguments[exp.arguments.length - 1].name !== 'options' | ||
) { | ||
context.report(node, "'options' should be the last argument passed to create() function"); | ||
} | ||
} | ||
//---------------------------------------------------------------------- | ||
@@ -58,3 +43,3 @@ // Public | ||
node.arguments[node.arguments.length - 1].type === 'Identifier' && | ||
node.arguments[node.arguments.length - 1].name !== 'options' | ||
['options', 'ctxOptions'].indexOf(node.arguments[node.arguments.length - 1].name) === -1 | ||
) { | ||
@@ -73,3 +58,5 @@ context.report( | ||
node.arguments[node.arguments.length - 2].type === 'Identifier' && | ||
node.arguments[node.arguments.length - 2].name !== 'options' | ||
['options', 'ctxOptions'].indexOf( | ||
node.arguments[node.arguments.length - 2].name, | ||
) === -1 | ||
) { | ||
@@ -88,1 +75,3 @@ context.report( | ||
}; | ||
// eslint-disable-next-line loopback-options/options-required |
{ | ||
"name": "eslint-plugin-loopback-options", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Checks if options argument is passed to write functions", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
38564
150