Remove lodash dependency (babel/babel-eslint#450)
This commit is contained in:
parent
371488c102
commit
700f62e28e
@ -1,5 +1,4 @@
|
|||||||
var babylonToEspree = require("./babylon-to-espree");
|
var babylonToEspree = require("./babylon-to-espree");
|
||||||
var pick = require("lodash").pickBy;
|
|
||||||
var Module = require("module");
|
var Module = require("module");
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var parse = require("babylon").parse;
|
var parse = require("babylon").parse;
|
||||||
@ -100,18 +99,23 @@ function monkeypatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// iterate through part of t.VISITOR_KEYS
|
// iterate through part of t.VISITOR_KEYS
|
||||||
var visitorKeysMap = pick(t.VISITOR_KEYS, (k) => {
|
var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([
|
||||||
return t.FLIPPED_ALIAS_KEYS.Flow.concat([
|
"ArrayPattern",
|
||||||
"ArrayPattern",
|
"ClassDeclaration",
|
||||||
"ClassDeclaration",
|
"ClassExpression",
|
||||||
"ClassExpression",
|
"FunctionDeclaration",
|
||||||
"FunctionDeclaration",
|
"FunctionExpression",
|
||||||
"FunctionExpression",
|
"Identifier",
|
||||||
"Identifier",
|
"ObjectPattern",
|
||||||
"ObjectPattern",
|
"RestElement"
|
||||||
"RestElement"
|
]);
|
||||||
]).indexOf(k) === -1;
|
var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) {
|
||||||
});
|
var value = t.VISITOR_KEYS[key];
|
||||||
|
if (flowFlippedAliasKeys.indexOf(value) === -1) {
|
||||||
|
acc[key] = value;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
var propertyTypes = {
|
var propertyTypes = {
|
||||||
// loops
|
// loops
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
"babel-code-frame": "^6.22.0",
|
"babel-code-frame": "^6.22.0",
|
||||||
"babel-traverse": "^6.23.1",
|
"babel-traverse": "^6.23.1",
|
||||||
"babel-types": "^6.23.0",
|
"babel-types": "^6.23.0",
|
||||||
"babylon": "^6.16.1",
|
"babylon": "^6.16.1"
|
||||||
"lodash": "^4.17.4"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && npm run test-only",
|
"test": "npm run lint && npm run test-only",
|
||||||
|
|||||||
@ -694,7 +694,7 @@ lodash.pickby@^4.6.0:
|
|||||||
version "4.6.0"
|
version "4.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
|
resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
|
||||||
|
|
||||||
lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
|
lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0:
|
||||||
version "4.17.4"
|
version "4.17.4"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user