eslint-plugin-requirejs
Advanced tools
Comparing version 0.9.4 to 0.10.0
@@ -0,1 +1,6 @@ | ||
### v0.10.0 - July 11, 2016 | ||
* 0.10.0 (Casey Visco) | ||
* Add array of allowed paths to allowExtraDependencies of amd-function-arity (fixes #77) (Sam Bason) | ||
### v0.9.4 - February 1, 2016 | ||
@@ -2,0 +7,0 @@ |
@@ -37,2 +37,14 @@ /** | ||
function allUnassignedPathsAreAllowed(dependencyNodes, callbackParams) { | ||
if (typeof allowExtraDependencies === "boolean") { | ||
return allowExtraDependencies; | ||
} | ||
var unassignedPaths = dependencyNodes.slice(callbackParams.length); | ||
return unassignedPaths.every(function (path) { | ||
return allowExtraDependencies.indexOf(path.value) !== -1; | ||
}); | ||
} | ||
function checkArity(node, funcName) { | ||
@@ -52,3 +64,3 @@ var dependencyNodes = util.getDependencyNodes(node), | ||
if (dependencyNodes.length < callbackParams.length) { | ||
if (dependencyCount < actualParamCount) { | ||
context.report(node, TOO_MANY_PARAMS_MESSAGE, { | ||
@@ -59,3 +71,3 @@ functionName: funcName, | ||
}); | ||
} else if (dependencyNodes.length > callbackParams.length && !allowExtraDependencies) { | ||
} else if (dependencyCount > actualParamCount && !allUnassignedPathsAreAllowed(dependencyNodes, callbackParams)) { | ||
context.report(node, TOO_FEW_PARAMS_MESSAGE, { | ||
@@ -95,4 +107,15 @@ functionName: funcName, | ||
"allowExtraDependencies": { | ||
"type": "boolean", | ||
"default": false | ||
anyOf: [ | ||
{ | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
{ | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
] | ||
} | ||
@@ -99,0 +122,0 @@ }, |
{ | ||
"name": "eslint-plugin-requirejs", | ||
"author": "Casey Visco <cvisco@gmail.com>", | ||
"version": "0.9.4", | ||
"version": "0.10.0", | ||
"description": "Enforce code conventions for RequireJS modules with ESLint", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/cvisco/eslint-plugin-requirejs", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1883
81840
26
1
0