Update dependency flow-parser to v0.309.0 (#18980)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
b4489dc05f
commit
512f973602
8 files changed
+47
-18
No files matched your search
+1
-1
@@ -73,7 +73,7 @@
|
||||
"fast-json-stable-stringify": "2.1.0",
|
||||
"file-entry-cache": "11.1.2",
|
||||
"find-cache-directory": "6.0.0",
|
||||
"flow-parser": "0.307.0",
|
||||
"flow-parser": "0.309.0",
|
||||
"get-east-asian-width": "1.4.0",
|
||||
"get-stdin": "9.0.0",
|
||||
"graphql": "16.13.2",
|
||||
|
||||
@@ -3,6 +3,14 @@ import { printDeclareToken } from "./miscellaneous.js";
|
||||
import { printObject } from "./object.js";
|
||||
|
||||
function printFlowEnumBody(path, options, print) {
|
||||
const { node } = path;
|
||||
return [
|
||||
node.explicitType ? `of ${node.explicitType} ` : "",
|
||||
printObject(path, options, print),
|
||||
];
|
||||
}
|
||||
|
||||
function printLegacyFlowEnumBody(path, options, print) {
|
||||
const { node } = path;
|
||||
return [
|
||||
node.type === "EnumSymbolBody" || node.explicitType
|
||||
@@ -60,4 +68,9 @@ function printEnumDeclaration(path, print) {
|
||||
];
|
||||
}
|
||||
|
||||
export { printEnumDeclaration, printEnumMember, printFlowEnumBody };
|
||||
export {
|
||||
printEnumDeclaration,
|
||||
printEnumMember,
|
||||
printFlowEnumBody,
|
||||
printLegacyFlowEnumBody,
|
||||
};
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
printEnumDeclaration,
|
||||
printEnumMember,
|
||||
printFlowEnumBody,
|
||||
printLegacyFlowEnumBody,
|
||||
} from "./enum.js";
|
||||
import { printFunction } from "./function.js";
|
||||
import { printFunctionType } from "./function-type.js";
|
||||
@@ -165,12 +166,15 @@ function printFlow(path, options, print, args) {
|
||||
case "EnumDeclaration":
|
||||
return printEnumDeclaration(path, print);
|
||||
|
||||
case "EnumBody":
|
||||
return printFlowEnumBody(path, options, print);
|
||||
|
||||
case "EnumBooleanBody":
|
||||
case "EnumNumberBody":
|
||||
case "EnumBigIntBody":
|
||||
case "EnumStringBody":
|
||||
case "EnumSymbolBody":
|
||||
return printFlowEnumBody(path, options, print);
|
||||
return printLegacyFlowEnumBody(path, options, print);
|
||||
|
||||
case "EnumBooleanMember":
|
||||
case "EnumNumberMember":
|
||||
|
||||
@@ -40,6 +40,7 @@ const isPrintingImportAttributes = createTypeCheckFunction([
|
||||
]);
|
||||
|
||||
const isPrintingFlowEnumBody = createTypeCheckFunction([
|
||||
"EnumBody",
|
||||
"EnumBooleanBody",
|
||||
"EnumNumberBody",
|
||||
"EnumBigIntBody",
|
||||
@@ -54,11 +55,12 @@ const isPrintingFlowEnumBody = createTypeCheckFunction([
|
||||
- `ExportDefaultDeclaration`
|
||||
- `ExportNamedDeclaration`
|
||||
- `ExportAllDeclaration`
|
||||
- `EnumBooleanBody` (Flow)
|
||||
- `EnumNumberBody` (Flow)
|
||||
- `EnumBigIntBody` (Flow)
|
||||
- `EnumStringBody` (Flow)
|
||||
- `EnumSymbolBody` (Flow)
|
||||
- `EnumBody` (Flow)
|
||||
- `EnumBooleanBody` (Flow, removed)
|
||||
- `EnumNumberBody` (Flow, removed)
|
||||
- `EnumBigIntBody` (Flow, removed)
|
||||
- `EnumStringBody` (Flow, removed)
|
||||
- `EnumSymbolBody` (Flow, removed)
|
||||
- `DeclareExportDeclaration` (Flow)
|
||||
- `DeclareExportAllDeclaration` (Flow)
|
||||
- `TSEnumDeclaration`(TypeScript)
|
||||
|
||||
@@ -26,6 +26,9 @@ const additionalVisitorKeys = {
|
||||
// `SatisfiesExpression` is a private feature https://github.com/facebook/hermes/issues/1808#issuecomment-3392476828
|
||||
SatisfiesExpression: ["expression", "typeAnnotation"],
|
||||
|
||||
// https://github.com/facebook/flow/commit/9c815177852e5695c02306c86830a865223c9fb5
|
||||
EnumBody: ["members"],
|
||||
|
||||
DeclareVariable: ["declarations"],
|
||||
};
|
||||
|
||||
|
||||
Vendored
+9
-5
@@ -21,11 +21,15 @@ type PrettierCommentAdditionalProperties = {
|
||||
leading?: boolean;
|
||||
};
|
||||
|
||||
type FlowAdditionalNode = {
|
||||
type: "SatisfiesExpression";
|
||||
expression: FlowESTree.Expression;
|
||||
typeAnnotation: FlowESTree.TypeAnnotationType;
|
||||
};
|
||||
type FlowAdditionalNode =
|
||||
| {
|
||||
type: "SatisfiesExpression";
|
||||
expression: FlowESTree.Expression;
|
||||
typeAnnotation: FlowESTree.TypeAnnotationType;
|
||||
}
|
||||
| ({
|
||||
type: "EnumBody";
|
||||
} & Omit<FlowESTree.EnumDeclaration["body"], "type">);
|
||||
|
||||
type PrettierNode = { type: "JsExpressionRoot"; node: Babel.Expression };
|
||||
|
||||
|
||||
@@ -275,6 +275,9 @@ exports[`visitor keys estree 1`] = `
|
||||
"id",
|
||||
"init",
|
||||
],
|
||||
"EnumBody": [
|
||||
"members",
|
||||
],
|
||||
"EnumBooleanBody": [
|
||||
"members",
|
||||
],
|
||||
|
||||
@@ -5236,10 +5236,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"flow-parser@npm:0.307.0":
|
||||
version: 0.307.0
|
||||
resolution: "flow-parser@npm:0.307.0"
|
||||
checksum: 10/23aca50421ad835eaa308769a16d92fc01aeb5e807fdff45428f2dbd67d48cd1db0a00e6a647ca3ccd25d24453b5c0b5fb5c7d72977106bf1a6cb46ab8a25a75
|
||||
"flow-parser@npm:0.309.0":
|
||||
version: 0.309.0
|
||||
resolution: "flow-parser@npm:0.309.0"
|
||||
checksum: 10/bb3830ee4087562ea6ed37c43812325d1e35797a9e22aecbac27e7103cb5fa17059e0f3885f7459250468327beb1c028ec33a0bd347bf5a5a5298d1577eb342d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -8637,7 +8637,7 @@ __metadata:
|
||||
fast-json-stable-stringify: "npm:2.1.0"
|
||||
file-entry-cache: "npm:11.1.2"
|
||||
find-cache-directory: "npm:6.0.0"
|
||||
flow-parser: "npm:0.307.0"
|
||||
flow-parser: "npm:0.309.0"
|
||||
get-east-asian-width: "npm:1.4.0"
|
||||
get-port: "npm:7.2.0"
|
||||
get-stdin: "npm:9.0.0"
|
||||
|
||||
Reference in new issue
Block a user