Merge pull request babel/eslint-plugin-babel#29 from evocateur/no-deps
Future-proofing
This commit is contained in:
parent
fcdf7ec95d
commit
a2c695275d
@ -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
|
||||
}
|
||||
}
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user