diff --git a/eslint/babel-eslint-plugin/helpers.js b/eslint/babel-eslint-plugin/helpers.js deleted file mode 100644 index 77f42a3bf4..0000000000 --- a/eslint/babel-eslint-plugin/helpers.js +++ /dev/null @@ -1,15 +0,0 @@ -var _parse = require('babel-core').parse; - -module.exports = { - parse: function(code){ - var ast = null - try { - ast = _parse(code, { locations: true, ranges: true }).body[0] //unwrap body - } - catch (err){ - console.warn(err) - } - - return ast - } -} \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 29c67dcbd6..28a10bd211 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -32,8 +32,5 @@ "is-my-json-valid": "^2.12.0", "mocha": "^2.2.5", "phantomjs": "^1.9.17" - }, - "dependencies": { - "babel-core": "^5.5.8" } } diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js index a1d4575c2a..0e17a9baae 100644 --- a/eslint/babel-eslint-plugin/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -69,8 +69,8 @@ function calculateCapIsNewExceptions(config) { module.exports = function(context) { var config = context.options[0] || {}; - config.newIsCap = config.newIsCap !== false; - config.capIsNew = config.capIsNew !== false; + var NEW_IS_CAP = config.newIsCap !== false; + var CAP_IS_NEW = config.capIsNew !== false; var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); @@ -176,7 +176,7 @@ module.exports = function(context) { // Public //-------------------------------------------------------------------------- - if (config.newIsCap) { + if (NEW_IS_CAP) { listeners.NewExpression = function(node) { var constructorName = extractNameFromExpression(node); @@ -190,7 +190,7 @@ module.exports = function(context) { }; } - if (config.capIsNew) { + if (CAP_IS_NEW) { listeners.CallExpression = function(node) { var calleeName = extractNameFromExpression(node);