Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 144 additions & 114 deletions apps/oxlint/src-js/generated/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,20 @@

const { freeze } = Object;

export default freeze({
// Leaf nodes
DebuggerStatement: freeze([]),
EmptyStatement: freeze([]),
Literal: freeze([]),
PrivateIdentifier: freeze([]),
Super: freeze([]),
TemplateElement: freeze([]),
ThisExpression: freeze([]),
JSXClosingFragment: freeze([]),
JSXEmptyExpression: freeze([]),
JSXIdentifier: freeze([]),
JSXOpeningFragment: freeze([]),
JSXText: freeze([]),
TSAnyKeyword: freeze([]),
TSBigIntKeyword: freeze([]),
TSBooleanKeyword: freeze([]),
TSIntrinsicKeyword: freeze([]),
TSJSDocUnknownType: freeze([]),
TSNeverKeyword: freeze([]),
TSNullKeyword: freeze([]),
TSNumberKeyword: freeze([]),
TSObjectKeyword: freeze([]),
TSStringKeyword: freeze([]),
TSSymbolKeyword: freeze([]),
TSThisType: freeze([]),
TSUndefinedKeyword: freeze([]),
TSUnknownKeyword: freeze([]),
TSVoidKeyword: freeze([]),
// Non-leaf nodes
AccessorProperty: freeze(["decorators", "key", "typeAnnotation", "value"]),
ArrayExpression: freeze(["elements"]),
ArrayPattern: freeze(["decorators", "elements", "typeAnnotation"]),
ArrowFunctionExpression: freeze(["typeParameters", "params", "returnType", "body"]),
AssignmentExpression: freeze(["left", "right"]),
AssignmentPattern: freeze(["decorators", "left", "right", "typeAnnotation"]),
AwaitExpression: freeze(["argument"]),
BinaryExpression: freeze(["left", "right"]),
BlockStatement: freeze(["body"]),
BreakStatement: freeze(["label"]),
CallExpression: freeze(["callee", "typeArguments", "arguments"]),
CatchClause: freeze(["param", "body"]),
ChainExpression: freeze(["expression"]),
ClassBody: freeze(["body"]),
ClassDeclaration: freeze([
const $EMPTY = freeze([]),
DECORATORS__KEY__TYPE_ANNOTATION__VALUE = freeze([
"decorators",
"key",
"typeAnnotation",
"value",
]),
LEFT__RIGHT = freeze(["left", "right"]),
ARGUMENT = freeze(["argument"]),
BODY = freeze(["body"]),
LABEL = freeze(["label"]),
CALLEE__TYPE_ARGUMENTS__ARGUMENTS = freeze(["callee", "typeArguments", "arguments"]),
EXPRESSION = freeze(["expression"]),
DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY = freeze([
"decorators",
"id",
"typeParameters",
Expand All @@ -56,135 +25,196 @@ export default freeze({
"implements",
"body",
]),
ClassExpression: freeze([
"decorators",
TEST__CONSEQUENT__ALTERNATE = freeze(["test", "consequent", "alternate"]),
LEFT__RIGHT__BODY = freeze(["left", "right", "body"]),
ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY = freeze([
"id",
"typeParameters",
"superClass",
"superTypeArguments",
"implements",
"params",
"returnType",
"body",
]),
ConditionalExpression: freeze(["test", "consequent", "alternate"]),
ContinueStatement: freeze(["label"]),
Decorator: freeze(["expression"]),
KEY__VALUE = freeze(["key", "value"]),
LOCAL = freeze(["local"]),
OBJECT__PROPERTY = freeze(["object", "property"]),
DECORATORS__KEY__TYPE_ANNOTATION = freeze(["decorators", "key", "typeAnnotation"]),
EXPRESSION__TYPE_ANNOTATION = freeze(["expression", "typeAnnotation"]),
TYPE_PARAMETERS__PARAMS__RETURN_TYPE = freeze(["typeParameters", "params", "returnType"]),
EXPRESSION__TYPE_ARGUMENTS = freeze(["expression", "typeArguments"]),
MEMBERS = freeze(["members"]),
ID__BODY = freeze(["id", "body"]),
TYPES = freeze(["types"]),
TYPE_ANNOTATION = freeze(["typeAnnotation"]),
PARAMS = freeze(["params"]);

export default freeze({
// Leaf nodes
DebuggerStatement: $EMPTY,
EmptyStatement: $EMPTY,
Literal: $EMPTY,
PrivateIdentifier: $EMPTY,
Super: $EMPTY,
TemplateElement: $EMPTY,
ThisExpression: $EMPTY,
JSXClosingFragment: $EMPTY,
JSXEmptyExpression: $EMPTY,
JSXIdentifier: $EMPTY,
JSXOpeningFragment: $EMPTY,
JSXText: $EMPTY,
TSAnyKeyword: $EMPTY,
TSBigIntKeyword: $EMPTY,
TSBooleanKeyword: $EMPTY,
TSIntrinsicKeyword: $EMPTY,
TSJSDocUnknownType: $EMPTY,
TSNeverKeyword: $EMPTY,
TSNullKeyword: $EMPTY,
TSNumberKeyword: $EMPTY,
TSObjectKeyword: $EMPTY,
TSStringKeyword: $EMPTY,
TSSymbolKeyword: $EMPTY,
TSThisType: $EMPTY,
TSUndefinedKeyword: $EMPTY,
TSUnknownKeyword: $EMPTY,
TSVoidKeyword: $EMPTY,
// Non-leaf nodes
AccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
ArrayExpression: freeze(["elements"]),
ArrayPattern: freeze(["decorators", "elements", "typeAnnotation"]),
ArrowFunctionExpression: freeze(["typeParameters", "params", "returnType", "body"]),
AssignmentExpression: LEFT__RIGHT,
AssignmentPattern: freeze(["decorators", "left", "right", "typeAnnotation"]),
AwaitExpression: ARGUMENT,
BinaryExpression: LEFT__RIGHT,
BlockStatement: BODY,
BreakStatement: LABEL,
CallExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
CatchClause: freeze(["param", "body"]),
ChainExpression: EXPRESSION,
ClassBody: BODY,
ClassDeclaration:
DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
ClassExpression:
DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
ConditionalExpression: TEST__CONSEQUENT__ALTERNATE,
ContinueStatement: LABEL,
Decorator: EXPRESSION,
DoWhileStatement: freeze(["body", "test"]),
ExportAllDeclaration: freeze(["exported", "source", "attributes"]),
ExportDefaultDeclaration: freeze(["declaration"]),
ExportNamedDeclaration: freeze(["declaration", "specifiers", "source", "attributes"]),
ExportSpecifier: freeze(["local", "exported"]),
ExpressionStatement: freeze(["expression"]),
ForInStatement: freeze(["left", "right", "body"]),
ForOfStatement: freeze(["left", "right", "body"]),
ExpressionStatement: EXPRESSION,
ForInStatement: LEFT__RIGHT__BODY,
ForOfStatement: LEFT__RIGHT__BODY,
ForStatement: freeze(["init", "test", "update", "body"]),
FunctionDeclaration: freeze(["id", "typeParameters", "params", "returnType", "body"]),
FunctionExpression: freeze(["id", "typeParameters", "params", "returnType", "body"]),
FunctionDeclaration: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
FunctionExpression: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
Identifier: freeze(["decorators", "typeAnnotation"]),
IfStatement: freeze(["test", "consequent", "alternate"]),
ImportAttribute: freeze(["key", "value"]),
IfStatement: TEST__CONSEQUENT__ALTERNATE,
ImportAttribute: KEY__VALUE,
ImportDeclaration: freeze(["specifiers", "source", "attributes"]),
ImportDefaultSpecifier: freeze(["local"]),
ImportDefaultSpecifier: LOCAL,
ImportExpression: freeze(["source", "options"]),
ImportNamespaceSpecifier: freeze(["local"]),
ImportNamespaceSpecifier: LOCAL,
ImportSpecifier: freeze(["imported", "local"]),
LabeledStatement: freeze(["label", "body"]),
LogicalExpression: freeze(["left", "right"]),
MemberExpression: freeze(["object", "property"]),
LogicalExpression: LEFT__RIGHT,
MemberExpression: OBJECT__PROPERTY,
MetaProperty: freeze(["meta", "property"]),
MethodDefinition: freeze(["decorators", "key", "value"]),
NewExpression: freeze(["callee", "typeArguments", "arguments"]),
NewExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
ObjectExpression: freeze(["properties"]),
ObjectPattern: freeze(["decorators", "properties", "typeAnnotation"]),
ParenthesizedExpression: freeze(["expression"]),
Program: freeze(["body"]),
Property: freeze(["key", "value"]),
PropertyDefinition: freeze(["decorators", "key", "typeAnnotation", "value"]),
ParenthesizedExpression: EXPRESSION,
Program: BODY,
Property: KEY__VALUE,
PropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
RestElement: freeze(["decorators", "argument", "typeAnnotation"]),
ReturnStatement: freeze(["argument"]),
ReturnStatement: ARGUMENT,
SequenceExpression: freeze(["expressions"]),
SpreadElement: freeze(["argument"]),
StaticBlock: freeze(["body"]),
SpreadElement: ARGUMENT,
StaticBlock: BODY,
SwitchCase: freeze(["test", "consequent"]),
SwitchStatement: freeze(["discriminant", "cases"]),
TaggedTemplateExpression: freeze(["tag", "typeArguments", "quasi"]),
TemplateLiteral: freeze(["quasis", "expressions"]),
ThrowStatement: freeze(["argument"]),
ThrowStatement: ARGUMENT,
TryStatement: freeze(["block", "handler", "finalizer"]),
UnaryExpression: freeze(["argument"]),
UpdateExpression: freeze(["argument"]),
UnaryExpression: ARGUMENT,
UpdateExpression: ARGUMENT,
V8IntrinsicExpression: freeze(["name", "arguments"]),
VariableDeclaration: freeze(["declarations"]),
VariableDeclarator: freeze(["id", "init"]),
WhileStatement: freeze(["test", "body"]),
WithStatement: freeze(["object", "body"]),
YieldExpression: freeze(["argument"]),
YieldExpression: ARGUMENT,
JSXAttribute: freeze(["name", "value"]),
JSXClosingElement: freeze(["name"]),
JSXElement: freeze(["openingElement", "children", "closingElement"]),
JSXExpressionContainer: freeze(["expression"]),
JSXExpressionContainer: EXPRESSION,
JSXFragment: freeze(["openingFragment", "children", "closingFragment"]),
JSXMemberExpression: freeze(["object", "property"]),
JSXMemberExpression: OBJECT__PROPERTY,
JSXNamespacedName: freeze(["namespace", "name"]),
JSXOpeningElement: freeze(["name", "typeArguments", "attributes"]),
JSXSpreadAttribute: freeze(["argument"]),
JSXSpreadChild: freeze(["expression"]),
TSAbstractAccessorProperty: freeze(["decorators", "key", "typeAnnotation"]),
TSAbstractMethodDefinition: freeze(["key", "value"]),
TSAbstractPropertyDefinition: freeze(["decorators", "key", "typeAnnotation"]),
JSXSpreadAttribute: ARGUMENT,
JSXSpreadChild: EXPRESSION,
TSAbstractAccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION,
TSAbstractMethodDefinition: KEY__VALUE,
TSAbstractPropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION,
TSArrayType: freeze(["elementType"]),
TSAsExpression: freeze(["expression", "typeAnnotation"]),
TSCallSignatureDeclaration: freeze(["typeParameters", "params", "returnType"]),
TSClassImplements: freeze(["expression", "typeArguments"]),
TSAsExpression: EXPRESSION__TYPE_ANNOTATION,
TSCallSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
TSClassImplements: EXPRESSION__TYPE_ARGUMENTS,
TSConditionalType: freeze(["checkType", "extendsType", "trueType", "falseType"]),
TSConstructSignatureDeclaration: freeze(["typeParameters", "params", "returnType"]),
TSConstructorType: freeze(["typeParameters", "params", "returnType"]),
TSDeclareFunction: freeze(["id", "typeParameters", "params", "returnType", "body"]),
TSConstructSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
TSConstructorType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
TSDeclareFunction: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
TSEmptyBodyFunctionExpression: freeze(["id", "typeParameters", "params", "returnType"]),
TSEnumBody: freeze(["members"]),
TSEnumDeclaration: freeze(["id", "body"]),
TSEnumBody: MEMBERS,
TSEnumDeclaration: ID__BODY,
TSEnumMember: freeze(["id", "initializer"]),
TSExportAssignment: freeze(["expression"]),
TSExternalModuleReference: freeze(["expression"]),
TSFunctionType: freeze(["typeParameters", "params", "returnType"]),
TSExportAssignment: EXPRESSION,
TSExternalModuleReference: EXPRESSION,
TSFunctionType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
TSImportEqualsDeclaration: freeze(["id", "moduleReference"]),
TSImportType: freeze(["argument", "options", "qualifier", "typeArguments"]),
TSIndexSignature: freeze(["parameters", "typeAnnotation"]),
TSIndexedAccessType: freeze(["objectType", "indexType"]),
TSInferType: freeze(["typeParameter"]),
TSInstantiationExpression: freeze(["expression", "typeArguments"]),
TSInterfaceBody: freeze(["body"]),
TSInstantiationExpression: EXPRESSION__TYPE_ARGUMENTS,
TSInterfaceBody: BODY,
TSInterfaceDeclaration: freeze(["id", "typeParameters", "extends", "body"]),
TSInterfaceHeritage: freeze(["expression", "typeArguments"]),
TSIntersectionType: freeze(["types"]),
TSJSDocNonNullableType: freeze(["typeAnnotation"]),
TSJSDocNullableType: freeze(["typeAnnotation"]),
TSInterfaceHeritage: EXPRESSION__TYPE_ARGUMENTS,
TSIntersectionType: TYPES,
TSJSDocNonNullableType: TYPE_ANNOTATION,
TSJSDocNullableType: TYPE_ANNOTATION,
TSLiteralType: freeze(["literal"]),
TSMappedType: freeze(["key", "constraint", "nameType", "typeAnnotation"]),
TSMethodSignature: freeze(["key", "typeParameters", "params", "returnType"]),
TSModuleBlock: freeze(["body"]),
TSModuleDeclaration: freeze(["id", "body"]),
TSModuleBlock: BODY,
TSModuleDeclaration: ID__BODY,
TSNamedTupleMember: freeze(["label", "elementType"]),
TSNamespaceExportDeclaration: freeze(["id"]),
TSNonNullExpression: freeze(["expression"]),
TSOptionalType: freeze(["typeAnnotation"]),
TSNonNullExpression: EXPRESSION,
TSOptionalType: TYPE_ANNOTATION,
TSParameterProperty: freeze(["decorators", "parameter"]),
TSParenthesizedType: freeze(["typeAnnotation"]),
TSParenthesizedType: TYPE_ANNOTATION,
TSPropertySignature: freeze(["key", "typeAnnotation"]),
TSQualifiedName: freeze(["left", "right"]),
TSRestType: freeze(["typeAnnotation"]),
TSSatisfiesExpression: freeze(["expression", "typeAnnotation"]),
TSQualifiedName: LEFT__RIGHT,
TSRestType: TYPE_ANNOTATION,
TSSatisfiesExpression: EXPRESSION__TYPE_ANNOTATION,
TSTemplateLiteralType: freeze(["quasis", "types"]),
TSTupleType: freeze(["elementTypes"]),
TSTypeAliasDeclaration: freeze(["id", "typeParameters", "typeAnnotation"]),
TSTypeAnnotation: freeze(["typeAnnotation"]),
TSTypeAnnotation: TYPE_ANNOTATION,
TSTypeAssertion: freeze(["typeAnnotation", "expression"]),
TSTypeLiteral: freeze(["members"]),
TSTypeOperator: freeze(["typeAnnotation"]),
TSTypeLiteral: MEMBERS,
TSTypeOperator: TYPE_ANNOTATION,
TSTypeParameter: freeze(["name", "constraint", "default"]),
TSTypeParameterDeclaration: freeze(["params"]),
TSTypeParameterInstantiation: freeze(["params"]),
TSTypeParameterDeclaration: PARAMS,
TSTypeParameterInstantiation: PARAMS,
TSTypePredicate: freeze(["parameterName", "typeAnnotation"]),
TSTypeQuery: freeze(["exprName", "typeArguments"]),
TSTypeReference: freeze(["typeName", "typeArguments"]),
TSUnionType: freeze(["types"]),
TSUnionType: TYPES,
});
Loading
Loading