diff options
Diffstat (limited to 'tools/eslint/node_modules/estraverse-fb/keys.js')
-rw-r--r-- | tools/eslint/node_modules/estraverse-fb/keys.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/estraverse-fb/keys.js b/tools/eslint/node_modules/estraverse-fb/keys.js new file mode 100644 index 0000000000..47df04a58b --- /dev/null +++ b/tools/eslint/node_modules/estraverse-fb/keys.js @@ -0,0 +1,57 @@ +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]; +}
\ No newline at end of file |