eslint-plugin-mocha
Advanced tools
Comparing version 4.3.0 to 4.4.0
@@ -0,1 +1,21 @@ | ||
## 4.4.0 (August 24, 2016) | ||
### Features | ||
* Add `no-hooks-for-single-case` rule (fixes #44) (#95) | ||
* Add rule `no-return-and-callback` (fixes #88) (#94) | ||
* Add `no-top-level-hooks` rule (fixes #37) (#87) | ||
### Documentation | ||
* Fix title in `no-sibling-hooks` documentation file (#92) | ||
### Dependency Upgrades | ||
* Update ramda to version 0.22.1 🚀 (#93) | ||
### Build-Related | ||
* Add editorconfig file (#91) | ||
## 4.3.0 (August 1, 2016) | ||
@@ -2,0 +22,0 @@ |
@@ -11,2 +11,3 @@ 'use strict'; | ||
'no-global-tests': require('./lib/rules/no-global-tests'), | ||
'no-return-and-callback': require('./lib/rules/no-return-and-callback'), | ||
'valid-test-description': require('./lib/rules/valid-test-description'), | ||
@@ -16,3 +17,5 @@ 'valid-suite-description': require('./lib/rules/valid-suite-description'), | ||
'no-hooks': require('./lib/rules/no-hooks'), | ||
'no-sibling-hooks': require('./lib/rules/no-sibling-hooks') | ||
'no-hooks-for-single-case': require('./lib/rules/no-hooks-for-single-case'), | ||
'no-sibling-hooks': require('./lib/rules/no-sibling-hooks'), | ||
'no-top-level-hooks': require('./lib/rules/no-top-level-hooks') | ||
}, | ||
@@ -19,0 +22,0 @@ configs: { |
'use strict'; | ||
var astUtil = require('../util/ast'); | ||
module.exports = function (context) { | ||
var hooks = [ 'before', 'after', 'beforeEach', 'afterEach' ]; | ||
return { | ||
CallExpression: function (node) { | ||
if (node.callee.type === 'Identifier' && hooks.indexOf(node.callee.name) !== -1) { | ||
if (astUtil.isHookIdentifier(node.callee)) { | ||
context.report({ | ||
@@ -10,0 +10,0 @@ node: node.callee, |
'use strict'; | ||
var describeAliases = [ 'describe', 'xdescribe', 'context', 'xcontext' ]; | ||
var astUtil = require('../util/ast'); | ||
@@ -15,18 +15,4 @@ function newDescribeLayer(describeNode) { | ||
function isDescribeIdentifier(node) { | ||
return node.type === 'Identifier' && describeAliases.indexOf(node.name) !== -1; | ||
} | ||
function isDescribe(node) { | ||
return node | ||
&& node.type === 'CallExpression' | ||
&& (isDescribeIdentifier(node.callee) | ||
// eslint-disable-next-line no-extra-parens | ||
|| (node.callee.type === 'MemberExpression' && isDescribeIdentifier(node.callee.object)) | ||
); | ||
} | ||
module.exports = function (context) { | ||
var hooks = [ 'before', 'after', 'beforeEach', 'afterEach' ], | ||
isUsed = []; | ||
var isUsed = []; | ||
@@ -38,5 +24,5 @@ return { | ||
CallExpression: function (node) { // eslint-disable-line complexity | ||
CallExpression: function (node) { | ||
var name = node.callee && node.callee.name; | ||
if (isDescribe(node)) { | ||
if (astUtil.isDescribe(node)) { | ||
isUsed.push(newDescribeLayer(node)); | ||
@@ -46,3 +32,3 @@ return; | ||
if (node.callee.type !== 'Identifier' || hooks.indexOf(name) === -1) { | ||
if (!astUtil.isHookIdentifier(node.callee)) { | ||
return; | ||
@@ -49,0 +35,0 @@ } |
{ | ||
"name": "eslint-plugin-mocha", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"description": "Eslint rules for mocha.", | ||
@@ -15,3 +15,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"ramda": "^0.21.0" | ||
"ramda": "^0.22.1" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
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
37168
26
728
+ Addedramda@0.22.1(transitive)
- Removedramda@0.21.0(transitive)
Updatedramda@^0.22.1