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