From fb4fa9b532cd30ca4e31117157602f49470b74cd Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 24 Aug 2024 01:21:13 +0800 Subject: [PATCH] Sort visitorKeys in test (#16606) --- tests/unit/__snapshots__/visitor-keys.js.snap | 550 +++++++++--------- tests/unit/visitor-keys.js | 6 + 2 files changed, 281 insertions(+), 275 deletions(-) diff --git a/tests/unit/__snapshots__/visitor-keys.js.snap b/tests/unit/__snapshots__/visitor-keys.js.snap index d944bc7ca..b0ddea3d5 100644 --- a/tests/unit/__snapshots__/visitor-keys.js.snap +++ b/tests/unit/__snapshots__/visitor-keys.js.snap @@ -14,19 +14,19 @@ exports[`visitor keys estree 1`] = ` "elements", ], "ArrayPattern": [ + "decorators", "elements", "typeAnnotation", - "decorators", ], "ArrayTypeAnnotation": [ "elementType", ], "ArrowFunctionExpression": [ - "params", "body", + "params", + "predicate", "returnType", "typeParameters", - "predicate", ], "AsConstExpression": [ "expression", @@ -40,9 +40,9 @@ exports[`visitor keys estree 1`] = ` "right", ], "AssignmentPattern": [ + "decorators", "left", "right", - "decorators", "typeAnnotation", ], "AwaitExpression": [ @@ -56,12 +56,12 @@ exports[`visitor keys estree 1`] = ` "right", ], "BindExpression": [ - "object", "callee", + "object", ], "BlockStatement": [ - "directives", "body", + "directives", ], "BooleanLiteral": [], "BooleanLiteralTypeAnnotation": [], @@ -70,114 +70,114 @@ exports[`visitor keys estree 1`] = ` "label", ], "CallExpression": [ - "callee", "arguments", - "typeParameters", + "callee", "typeArguments", + "typeParameters", ], "CatchClause": [ - "param", "body", + "param", ], "ChainExpression": [ "expression", ], "ClassAccessorProperty": [ - "key", - "value", - "typeAnnotation", "decorators", + "key", + "typeAnnotation", + "value", ], "ClassBody": [ "body", ], "ClassDeclaration": [ - "id", "body", - "superClass", - "mixins", - "typeParameters", - "superTypeParameters", - "implements", "decorators", + "id", + "implements", + "mixins", + "superClass", "superTypeArguments", + "superTypeParameters", + "typeParameters", ], "ClassExpression": [ - "id", "body", - "superClass", - "mixins", - "typeParameters", - "superTypeParameters", - "implements", "decorators", + "id", + "implements", + "mixins", + "superClass", "superTypeArguments", + "superTypeParameters", + "typeParameters", ], "ClassImplements": [ "id", "typeParameters", ], "ClassMethod": [ - "key", - "params", "body", "decorators", + "key", + "params", "returnType", "typeParameters", ], "ClassPrivateMethod": [ - "key", - "params", "body", "decorators", + "key", + "params", "returnType", "typeParameters", ], "ClassPrivateProperty": [ - "key", - "value", "decorators", + "key", "typeAnnotation", + "value", "variance", ], "ClassProperty": [ - "key", - "value", - "typeAnnotation", "decorators", + "key", + "typeAnnotation", + "value", "variance", ], "ComponentDeclaration": [ + "body", "id", "params", - "body", - "typeParameters", "rendersType", + "typeParameters", ], "ComponentParameter": [ - "name", "local", + "name", ], "ComponentTypeAnnotation": [ "params", + "rendersType", "rest", "typeParameters", - "rendersType", ], "ComponentTypeParameter": [ "name", "typeAnnotation", ], "ConditionalExpression": [ - "test", - "consequent", "alternate", + "consequent", + "test", ], "ConditionalTypeAnnotation": [ "checkType", "extendsType", - "trueType", "falseType", + "trueType", ], "ContinueStatement": [ "label", @@ -185,31 +185,31 @@ exports[`visitor keys estree 1`] = ` "DebuggerStatement": [], "DecimalLiteral": [], "DeclareClass": [ - "id", - "typeParameters", - "extends", - "mixins", - "implements", "body", + "extends", + "id", + "implements", + "mixins", + "typeParameters", ], "DeclareComponent": [ "id", "params", + "rendersType", "rest", "typeParameters", - "rendersType", ], "DeclareEnum": [ - "id", "body", + "id", ], "DeclareExportAllDeclaration": [ "source", ], "DeclareExportDeclaration": [ "declaration", - "specifiers", "source", + "specifiers", ], "DeclareFunction": [ "id", @@ -219,31 +219,31 @@ exports[`visitor keys estree 1`] = ` "id", ], "DeclareInterface": [ + "body", + "extends", "id", "typeParameters", - "extends", - "body", ], "DeclareModule": [ - "id", "body", + "id", ], "DeclareModuleExports": [ "typeAnnotation", ], "DeclareNamespace": [ - "id", "body", + "id", ], "DeclareOpaqueType": [ "id", - "typeParameters", "supertype", + "typeParameters", ], "DeclareTypeAlias": [ "id", - "typeParameters", "right", + "typeParameters", ], "DeclareVariable": [ "id", @@ -262,8 +262,8 @@ exports[`visitor keys estree 1`] = ` "body", ], "DoWhileStatement": [ - "test", "body", + "test", ], "EmptyStatement": [], "EmptyTypeAnnotation": [], @@ -282,8 +282,8 @@ exports[`visitor keys estree 1`] = ` "init", ], "EnumDeclaration": [ - "id", "body", + "id", ], "EnumDefaultedMember": [ "id", @@ -313,9 +313,9 @@ exports[`visitor keys estree 1`] = ` "argument", ], "ExportAllDeclaration": [ - "source", "attributes", "exported", + "source", ], "ExportDefaultDeclaration": [ "declaration", @@ -324,17 +324,17 @@ exports[`visitor keys estree 1`] = ` "exported", ], "ExportNamedDeclaration": [ - "declaration", - "specifiers", - "source", "attributes", + "declaration", + "source", + "specifiers", ], "ExportNamespaceSpecifier": [ "exported", ], "ExportSpecifier": [ - "local", "exported", + "local", ], "ExpressionStatement": [ "expression", @@ -343,42 +343,42 @@ exports[`visitor keys estree 1`] = ` "program", ], "ForInStatement": [ + "body", "left", "right", - "body", ], "ForOfStatement": [ + "body", "left", "right", - "body", ], "ForStatement": [ + "body", "init", "test", "update", - "body", ], "FunctionDeclaration": [ + "body", "id", "params", - "body", + "predicate", "returnType", "typeParameters", - "predicate", ], "FunctionExpression": [ + "body", "id", "params", - "body", "returnType", "typeParameters", ], "FunctionTypeAnnotation": [ - "typeParameters", "params", "rest", "returnType", "this", + "typeParameters", ], "FunctionTypeParam": [ "name", @@ -389,26 +389,26 @@ exports[`visitor keys estree 1`] = ` "typeParameters", ], "HookDeclaration": [ + "body", "id", "params", - "body", - "typeParameters", "returnType", + "typeParameters", ], "HookTypeAnnotation": [ "params", - "returnType", "rest", + "returnType", "typeParameters", ], "Identifier": [ - "typeAnnotation", "decorators", + "typeAnnotation", ], "IfStatement": [ - "test", - "consequent", "alternate", + "consequent", + "test", ], "Import": [], "ImportAttribute": [ @@ -416,46 +416,46 @@ exports[`visitor keys estree 1`] = ` "value", ], "ImportDeclaration": [ - "specifiers", - "source", "attributes", + "source", + "specifiers", ], "ImportDefaultSpecifier": [ "local", ], "ImportExpression": [ - "source", - "options", "attributes", + "options", + "source", ], "ImportNamespaceSpecifier": [ "local", ], "ImportSpecifier": [ - "local", "imported", + "local", ], "IndexedAccessType": [ - "objectType", "indexType", + "objectType", ], "InferTypeAnnotation": [ "typeParameter", ], "InferredPredicate": [], "InterfaceDeclaration": [ + "body", + "extends", "id", "typeParameters", - "extends", - "body", ], "InterfaceExtends": [ "id", "typeParameters", ], "InterfaceTypeAnnotation": [ - "extends", "body", + "extends", ], "InterpreterDirective": [], "IntersectionTypeAnnotation": [ @@ -470,18 +470,18 @@ exports[`visitor keys estree 1`] = ` ], "JSXClosingFragment": [], "JSXElement": [ - "openingElement", "children", "closingElement", + "openingElement", ], "JSXEmptyExpression": [], "JSXExpressionContainer": [ "expression", ], "JSXFragment": [ - "openingFragment", "children", "closingFragment", + "openingFragment", ], "JSXIdentifier": [], "JSXMemberExpression": [ @@ -489,12 +489,12 @@ exports[`visitor keys estree 1`] = ` "property", ], "JSXNamespacedName": [ - "namespace", "name", + "namespace", ], "JSXOpeningElement": [ - "name", "attributes", + "name", "typeArguments", "typeParameters", ], @@ -516,8 +516,8 @@ exports[`visitor keys estree 1`] = ` "argument", ], "LabeledStatement": [ - "label", "body", + "label", ], "Literal": [], "LogicalExpression": [ @@ -549,36 +549,36 @@ exports[`visitor keys estree 1`] = ` "body", ], "NGMicrosyntaxAs": [ - "key", "alias", + "key", ], "NGMicrosyntaxExpression": [ - "expression", "alias", + "expression", ], "NGMicrosyntaxKey": [], "NGMicrosyntaxKeyedExpression": [ - "key", "expression", + "key", ], "NGMicrosyntaxLet": [ "key", "value", ], "NGPipeExpression": [ + "arguments", "left", "right", - "arguments", ], "NGRoot": [ "node", ], "NeverTypeAnnotation": [], "NewExpression": [ - "callee", "arguments", - "typeParameters", + "callee", "typeArguments", + "typeParameters", ], "Noop": [], "NullLiteral": [], @@ -593,28 +593,28 @@ exports[`visitor keys estree 1`] = ` "properties", ], "ObjectMethod": [ - "key", - "params", "body", "decorators", + "key", + "params", "returnType", "typeParameters", ], "ObjectPattern": [ + "decorators", "properties", "typeAnnotation", - "decorators", ], "ObjectProperty": [ + "decorators", "key", "value", - "decorators", ], "ObjectTypeAnnotation": [ - "properties", - "indexers", "callProperties", + "indexers", "internalSlots", + "properties", ], "ObjectTypeCallProperty": [ "value", @@ -645,19 +645,19 @@ exports[`visitor keys estree 1`] = ` ], "OpaqueType": [ "id", - "typeParameters", - "supertype", "impltype", + "supertype", + "typeParameters", ], "OptionalCallExpression": [ - "callee", "arguments", - "typeParameters", + "callee", "typeArguments", + "typeParameters", ], "OptionalIndexedAccessType": [ - "objectType", "indexType", + "objectType", ], "OptionalMemberExpression": [ "object", @@ -679,8 +679,8 @@ exports[`visitor keys estree 1`] = ` "id", ], "Program": [ - "directives", "body", + "directives", ], "Property": [ "key", @@ -698,8 +698,8 @@ exports[`visitor keys estree 1`] = ` "qualification", ], "QualifiedTypeofIdentifier": [ - "qualification", "id", + "qualification", ], "RecordExpression": [ "properties", @@ -707,8 +707,8 @@ exports[`visitor keys estree 1`] = ` "RegExpLiteral": [], "RestElement": [ "argument", - "typeAnnotation", "decorators", + "typeAnnotation", ], "ReturnStatement": [ "argument", @@ -731,12 +731,12 @@ exports[`visitor keys estree 1`] = ` "StringTypeAnnotation": [], "Super": [], "SwitchCase": [ - "test", "consequent", + "test", ], "SwitchStatement": [ - "discriminant", "cases", + "discriminant", ], "SymbolTypeAnnotation": [], "TSAbstractAccessorProperty": [ @@ -766,11 +766,11 @@ exports[`visitor keys estree 1`] = ` "TSBigIntKeyword": [], "TSBooleanKeyword": [], "TSCallSignatureDeclaration": [ - "typeParameters", "parameters", - "typeAnnotation", "params", "returnType", + "typeAnnotation", + "typeParameters", ], "TSClassImplements": [ "expression", @@ -780,43 +780,43 @@ exports[`visitor keys estree 1`] = ` "TSConditionalType": [ "checkType", "extendsType", - "trueType", "falseType", + "trueType", ], "TSConstructSignatureDeclaration": [ - "typeParameters", "parameters", - "typeAnnotation", "params", "returnType", + "typeAnnotation", + "typeParameters", ], "TSConstructorType": [ - "typeParameters", "parameters", - "typeAnnotation", "params", "returnType", + "typeAnnotation", + "typeParameters", ], "TSDeclareFunction": [ + "body", "id", - "typeParameters", "params", "returnType", - "body", + "typeParameters", ], "TSDeclareKeyword": [], "TSDeclareMethod": [ "decorators", "key", - "typeParameters", "params", "returnType", + "typeParameters", ], "TSEmptyBodyFunctionExpression": [ "id", - "typeParameters", "params", "returnType", + "typeParameters", ], "TSEnumBody": [ "members", @@ -841,11 +841,11 @@ exports[`visitor keys estree 1`] = ` "expression", ], "TSFunctionType": [ - "typeParameters", "parameters", - "typeAnnotation", "params", "returnType", + "typeAnnotation", + "typeParameters", ], "TSImportEqualsDeclaration": [ "id", @@ -854,33 +854,33 @@ exports[`visitor keys estree 1`] = ` "TSImportType": [ "argument", "qualifier", - "typeParameters", "typeArguments", + "typeParameters", ], "TSIndexSignature": [ "parameters", "typeAnnotation", ], "TSIndexedAccessType": [ - "objectType", "indexType", + "objectType", ], "TSInferType": [ "typeParameter", ], "TSInstantiationExpression": [ "expression", - "typeParameters", "typeArguments", + "typeParameters", ], "TSInterfaceBody": [ "body", ], "TSInterfaceDeclaration": [ + "body", + "extends", "id", "typeParameters", - "extends", - "body", ], "TSInterfaceHeritage": [ "expression", @@ -903,28 +903,28 @@ exports[`visitor keys estree 1`] = ` "literal", ], "TSMappedType": [ - "typeParameter", - "typeAnnotation", "nameType", + "typeAnnotation", + "typeParameter", ], "TSMethodSignature": [ "key", - "typeParameters", "parameters", - "typeAnnotation", "params", "returnType", + "typeAnnotation", + "typeParameters", ], "TSModuleBlock": [ "body", ], "TSModuleDeclaration": [ - "id", "body", + "id", ], "TSNamedTupleMember": [ - "label", "elementType", + "label", ], "TSNamespaceExportDeclaration": [ "id", @@ -940,8 +940,8 @@ exports[`visitor keys estree 1`] = ` "typeAnnotation", ], "TSParameterProperty": [ - "parameter", "decorators", + "parameter", ], "TSParenthesizedType": [ "typeAnnotation", @@ -978,15 +978,15 @@ exports[`visitor keys estree 1`] = ` ], "TSTypeAliasDeclaration": [ "id", - "typeParameters", "typeAnnotation", + "typeParameters", ], "TSTypeAnnotation": [ "typeAnnotation", ], "TSTypeAssertion": [ - "typeAnnotation", "expression", + "typeAnnotation", ], "TSTypeLiteral": [ "members", @@ -1011,13 +1011,13 @@ exports[`visitor keys estree 1`] = ` ], "TSTypeQuery": [ "exprName", - "typeParameters", "typeArguments", + "typeParameters", ], "TSTypeReference": [ + "typeArguments", "typeName", "typeParameters", - "typeArguments", ], "TSUndefinedKeyword": [], "TSUnionType": [ @@ -1026,15 +1026,15 @@ exports[`visitor keys estree 1`] = ` "TSUnknownKeyword": [], "TSVoidKeyword": [], "TaggedTemplateExpression": [ - "tag", "quasi", - "typeParameters", + "tag", "typeArguments", + "typeParameters", ], "TemplateElement": [], "TemplateLiteral": [ - "quasis", "expressions", + "quasis", ], "ThisExpression": [], "ThisTypeAnnotation": [], @@ -1044,19 +1044,19 @@ exports[`visitor keys estree 1`] = ` "TopicReference": [], "TryStatement": [ "block", - "handler", "finalizer", + "handler", ], "TupleExpression": [ "elements", ], "TupleTypeAnnotation": [ - "types", "elementTypes", + "types", ], "TupleTypeLabeledElement": [ - "label", "elementType", + "label", "variance", ], "TupleTypeSpreadElement": [ @@ -1065,8 +1065,8 @@ exports[`visitor keys estree 1`] = ` ], "TypeAlias": [ "id", - "typeParameters", "right", + "typeParameters", ], "TypeAnnotation": [ "typeAnnotation", @@ -1090,9 +1090,9 @@ exports[`visitor keys estree 1`] = ` "params", ], "TypePredicate": [ + "asserts", "parameterName", "typeAnnotation", - "asserts", ], "TypeofTypeAnnotation": [ "argument", @@ -1120,12 +1120,12 @@ exports[`visitor keys estree 1`] = ` "Variance": [], "VoidTypeAnnotation": [], "WhileStatement": [ - "test", "body", + "test", ], "WithStatement": [ - "object", "body", + "object", ], "YieldExpression": [ "argument", @@ -1172,11 +1172,11 @@ exports[`visitor keys glimmer 1`] = ` "body", ], "BlockStatement": [ - "path", - "params", "hash", - "program", "inverse", + "params", + "path", + "program", ], "BooleanLiteral": [], "CommentStatement": [], @@ -1184,15 +1184,15 @@ exports[`visitor keys glimmer 1`] = ` "parts", ], "ElementModifierStatement": [ - "path", - "params", "hash", + "params", + "path", ], "ElementNode": [ "attributes", - "modifiers", "children", "comments", + "modifiers", ], "Hash": [ "pairs", @@ -1202,18 +1202,18 @@ exports[`visitor keys glimmer 1`] = ` ], "MustacheCommentStatement": [], "MustacheStatement": [ - "path", - "params", "hash", + "params", + "path", ], "NullLiteral": [], "NumberLiteral": [], "PathExpression": [], "StringLiteral": [], "SubExpression": [ - "path", - "params", "hash", + "params", + "path", ], "Template": [ "body", @@ -1231,97 +1231,97 @@ exports[`visitor keys graphql 1`] = ` ], "BooleanValue": [], "Directive": [ - "name", "arguments", + "name", ], "DirectiveDefinition": [ - "description", - "name", "arguments", + "description", "locations", + "name", ], "Document": [ "definitions", ], "EnumTypeDefinition": [ "description", - "name", "directives", + "name", "values", ], "EnumTypeExtension": [ - "name", "directives", + "name", "values", ], "EnumValue": [], "EnumValueDefinition": [ "description", - "name", "directives", + "name", ], "Field": [ "alias", - "name", "arguments", "directives", + "name", "selectionSet", ], "FieldDefinition": [ - "description", - "name", "arguments", - "type", + "description", "directives", + "name", + "type", ], "FloatValue": [], "FragmentDefinition": [ - "name", - "variableDefinitions", - "typeCondition", "directives", + "name", "selectionSet", + "typeCondition", + "variableDefinitions", ], "FragmentSpread": [ - "name", "directives", + "name", ], "InlineFragment": [ - "typeCondition", "directives", "selectionSet", + "typeCondition", ], "InputObjectTypeDefinition": [ "description", - "name", "directives", "fields", + "name", ], "InputObjectTypeExtension": [ - "name", "directives", "fields", + "name", ], "InputValueDefinition": [ + "defaultValue", "description", + "directives", "name", "type", - "defaultValue", - "directives", ], "IntValue": [], "InterfaceTypeDefinition": [ "description", - "name", - "interfaces", "directives", "fields", + "interfaces", + "name", ], "InterfaceTypeExtension": [ - "name", - "interfaces", "directives", "fields", + "interfaces", + "name", ], "ListType": [ "type", @@ -1343,37 +1343,37 @@ exports[`visitor keys graphql 1`] = ` ], "ObjectTypeDefinition": [ "description", - "name", - "interfaces", "directives", "fields", + "interfaces", + "name", ], "ObjectTypeExtension": [ - "name", - "interfaces", "directives", "fields", + "interfaces", + "name", ], "ObjectValue": [ "fields", ], "OperationDefinition": [ - "name", - "variableDefinitions", "directives", + "name", "selectionSet", + "variableDefinitions", ], "OperationTypeDefinition": [ "type", ], "ScalarTypeDefinition": [ "description", - "name", "directives", + "name", ], "ScalarTypeExtension": [ - "name", "directives", + "name", ], "SchemaDefinition": [ "description", @@ -1390,23 +1390,23 @@ exports[`visitor keys graphql 1`] = ` "StringValue": [], "UnionTypeDefinition": [ "description", - "name", "directives", + "name", "types", ], "UnionTypeExtension": [ - "name", "directives", + "name", "types", ], "Variable": [ "name", ], "VariableDefinition": [ - "variable", - "type", "defaultValue", "directives", + "type", + "variable", ], } `; @@ -1460,24 +1460,24 @@ exports[`visitor keys html 1`] = ` exports[`visitor keys postcss 1`] = ` { "css-atrule": [ - "selector", - "params", - "value", "nodes", + "params", + "selector", + "value", ], "css-comment": [], "css-decl": [ - "value", - "selector", "nodes", + "selector", + "value", ], "css-root": [ "frontMatter", "nodes", ], "css-rule": [ - "selector", "nodes", + "selector", ], "front-matter": [], "media-colon": [], @@ -1531,9 +1531,9 @@ exports[`visitor keys postcss 1`] = ` "value-operator": [], "value-paren": [], "value-paren_group": [ - "open", - "groups", "close", + "groups", + "open", ], "value-root": [ "group", @@ -1629,245 +1629,245 @@ exports[`visitor keys yaml 1`] = ` { "alias": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "anchor": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "blockFolded": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "blockLiteral": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "comment": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "directive": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "document": [ - "head", + "anchor", "body", "children", - "anchor", - "tag", + "endComments", + "head", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "documentBody": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "documentHead": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "flowMapping": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "flowMappingItem": [ - "key", - "value", - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", + "key", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", + "value", ], "flowSequence": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "flowSequenceItem": [ - "content", - "children", "anchor", - "tag", + "children", + "content", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "mapping": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "mappingItem": [ - "key", - "value", - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", + "key", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", + "value", ], "mappingKey": [ - "content", - "children", "anchor", - "tag", + "children", + "content", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "mappingValue": [ - "content", - "children", "anchor", - "tag", + "children", + "content", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "plain": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "quoteDouble": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "quoteSingle": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "root": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "sequence": [ - "children", "anchor", - "tag", + "children", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "sequenceItem": [ - "content", - "children", "anchor", - "tag", + "children", + "content", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], "tag": [ "anchor", - "tag", + "endComments", "indicatorComment", "leadingComments", "middleComments", + "tag", "trailingComment", - "endComments", ], } `; diff --git a/tests/unit/visitor-keys.js b/tests/unit/visitor-keys.js index c40201dfa..5411b42b7 100644 --- a/tests/unit/visitor-keys.js +++ b/tests/unit/visitor-keys.js @@ -19,6 +19,12 @@ describe("visitor keys", () => { { name: "remark", visitorKeys: remarkVisitorKeys }, { name: "yaml", visitorKeys: yamlVisitorKeys }, ])("$name", ({ visitorKeys }) => { + visitorKeys = Object.fromEntries( + Object.entries(visitorKeys).map(([type, keys]) => [ + type, + [...keys].sort(), + ]), + ); expect(visitorKeys).toMatchSnapshot(); }); });