Merge branch 'master' into collections

This commit is contained in:
Dominik Ferber
2015-10-21 19:53:35 +02:00
3 changed files with 8 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
import {NON_METEOR} from '../util/environment'
import {getExecutors} from '../util'
import {isMeteorCall, getPropertyName, refersTo, hasContext} from '../util/ast'
import {isMeteorCall, isMeteorProp, getPropertyName, refersTo, hasContext} from '../util/ast'
// -----------------------------------------------------------------------------
// Rule Definition
@@ -117,6 +117,11 @@ module.exports = getMeta => context => {
return {
NewExpression: function (node) {
if (!isMeteorProp(node.callee, 'Error')) {
return
}
const executors = getExecutors(env, context.getAncestors())
if (executors.size === 0) {
return

View File

@@ -42,7 +42,7 @@
"colors": "1.1.2",
"coveralls": "2.11.4",
"cz-conventional-changelog": "1.1.4",
"eslint": "1.7.2",
"eslint": "1.7.3",
"ghooks": "0.3.2",
"istanbul": "0.4.0",
"mocha": "2.3.3",

View File

@@ -14,6 +14,7 @@ const rule = require('../../../dist/rules/methods')
const RuleTester = require('eslint').RuleTester
const commonValidCode = [
'new Meteor.foo()',
'Meteor.call("foo")',
'Meteor.call("foo", true)',
'Meteor.apply("foo", [], function () {})',