eslint-plugin-mocha
Advanced tools
Comparing version 0.1.1 to 0.2.0
module.exports = function (context) { | ||
'use strict'; | ||
var mochaTestFunctions = [ | ||
'it', | ||
'describe', | ||
'suite', | ||
'test' | ||
]; | ||
function isCallToMochasOnlyFunction(callee) { | ||
return callee.type === 'MemberExpression' && | ||
isObjectNamedItOrDescribe(callee.object) && | ||
isPropertyNamedOnly(callee.property); | ||
matchesMochaTestFunction(callee.object) && | ||
isPropertyNamedOnly(callee.property); | ||
} | ||
function isObjectNamedItOrDescribe(object) { | ||
return object && (object.name === 'it' || object.name === 'describe'); | ||
function matchesMochaTestFunction(object) { | ||
return object && mochaTestFunctions.indexOf(object.name) !== -1; | ||
} | ||
@@ -13,0 +20,0 @@ |
{ | ||
"name": "eslint-plugin-mocha", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Eslint rules for mocha.", | ||
@@ -14,10 +14,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"istanbul": "0.3.0", | ||
"istanbul": "0.3.2", | ||
"mocha": "1.21.4", | ||
"eslint-tester": "0.2.0", | ||
"eslint": "~0.8.0", | ||
"eslint-tester": "0.2.1", | ||
"eslint": "^0.8.0", | ||
"coveralls": "2.11.1" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "~0.8.0" | ||
"eslint": "^0.8.0" | ||
}, | ||
@@ -24,0 +24,0 @@ "repository": { |
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
4479
34