0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/eslint/node_modules/estraverse-fb/keys.js
Yosuke Furukawa f9dd34d301 tools: replace closure-linter with eslint
PR-URL: https://github.com/iojs/io.js/pull/1539
Fixes: https://github.com/iojs/io.js/issues/1253
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-05-09 12:09:52 +09:00

57 lines
1.8 KiB
JavaScript

var unprefixedKeys = {
Identifier: [],
NamespacedName: ['namespace', 'name'],
MemberExpression: ['object', 'property'],
EmptyExpression: [],
ExpressionContainer: ['expression'],
Element: ['openingElement', 'closingElement', 'children'],
ClosingElement: ['name'],
OpeningElement: ['name', 'attributes'],
Attribute: ['name', 'value'],
Text: null,
SpreadAttribute: ['argument']
};
var flowKeys = {
Type: [],
AnyTypeAnnotation: [],
VoidTypeAnnotation: [],
NumberTypeAnnotation: [],
StringTypeAnnotation: [],
StringLiteralTypeAnnotation: ["value", "raw"],
BooleanTypeAnnotation: [],
TypeAnnotation: ["typeAnnotation"],
NullableTypeAnnotation: ["typeAnnotation"],
FunctionTypeAnnotation: ["params", "returnType", "rest", "typeParameters"],
FunctionTypeParam: ["name", "typeAnnotation", "optional"],
ObjectTypeAnnotation: ["properties"],
ObjectTypeProperty: ["key", "value", "optional"],
ObjectTypeIndexer: ["id", "key", "value"],
ObjectTypeCallProperty: ["value"],
QualifiedTypeIdentifier: ["qualification", "id"],
GenericTypeAnnotation: ["id", "typeParameters"],
MemberTypeAnnotation: ["object", "property"],
UnionTypeAnnotation: ["types"],
IntersectionTypeAnnotation: ["types"],
TypeofTypeAnnotation: ["argument"],
TypeParameterDeclaration: ["params"],
TypeParameterInstantiation: ["params"],
ClassProperty: ["key", "typeAnnotation"],
ClassImplements: [],
InterfaceDeclaration: ["id", "body", "extends"],
InterfaceExtends: ["id"],
TypeAlias: ["id", "typeParameters", "right"],
TupleTypeAnnotation: ["types"],
DeclareVariable: ["id"],
DeclareFunction: ["id"],
DeclareClass: ["id"],
DeclareModule: ["id", "body"]
};
for (var key in unprefixedKeys) {
exports['XJS' + key] = exports['JSX' + key] = unprefixedKeys[key];
}
for (var key in flowKeys) {
exports[key] = flowKeys[key];
}