Fix vistor keys for FunctionExpression (#18084)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-10-16 07:18:38 +08:00
1 parent d3da764b37
commit 9871b4931c
5 files changed
+18 -1

No files matched your search

@@ -32,7 +32,6 @@ const additionalVisitorKeys = {
const excludeVisitorKeys = {
// From `flowVisitorKeys`
ArrowFunctionExpression: ["id"],
FunctionExpression: ["predicate"],
// TODO: Remove `types` when babel changes AST of `TupleTypeAnnotation`
// Flow parser changed `.types` to `.elementTypes` https://github.com/facebook/flow/commit/5b60e6a81dc277dfab2e88fa3737a4dc9aafdcab
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`function-predicate.js format 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
| printWidth
=====================================input======================================
const fn = function(): %checks {}
=====================================output=====================================
const fn = function (): %checks {};
================================================================================
`;
@@ -0,0 +1 @@
runFormatTest(import.meta, ["flow"]);
@@ -0,0 +1 @@
const fn = function(): %checks {}
@@ -372,6 +372,7 @@ exports[`visitor keys estree 1`] = `
"body",
"id",
"params",
"predicate",
"returnType",
"typeParameters",
],