This commit is contained in:
Brian Ng
2018-05-25 16:53:23 -05:00
committed by GitHub
parent f0283572a5
commit f699f1bbbf
7 changed files with 15 additions and 10 deletions

View File

@@ -32,7 +32,7 @@
"eslint-config-babel": "^7.0.2",
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-prettier": "^2.5.0",
"flow-bin": "^0.66.0",
"flow-bin": "^0.73.0",
"graceful-fs": "^4.1.11",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0-beta.2",

View File

@@ -198,8 +198,9 @@ const readConfigJS = makeStrongCache(
const packageToBabelConfig = makeWeakCache(
(file: ConfigFile): ConfigFile | null => {
if (typeof file.options.babel === "undefined") return null;
const babel = file.options.babel;
const babel = file.options[("babel": string)];
if (typeof babel === "undefined") return null;
if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
throw new Error(`${file.filepath}: .babel property must be an object`);

View File

@@ -2043,7 +2043,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>
// add typeParameters if we found them
if (typeParameters) {
// $FlowFixMe (trying to set '.typeParameters' on an expression)
(prop.value || prop).typeParameters = typeParameters;
}
}

View File

@@ -115,7 +115,11 @@ export default class State {
classLevel: number;
// Labels in scope.
labels: Array<{ kind: ?("loop" | "switch"), statementStart?: number }>;
labels: Array<{
kind: ?("loop" | "switch"),
name?: ?string,
statementStart?: number,
}>;
// Leading decorators. Last element of the stack represents the decorators in current context.
// Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}
@@ -140,6 +144,7 @@ export default class State {
start: number,
leadingComments: ?Array<N.Comment>,
trailingComments: ?Array<N.Comment>,
type: string,
}>;
commentPreviousNode: N.Node;

View File

@@ -126,7 +126,7 @@ export const validateModulesOption = (
return modulesOpt;
};
export const objectToBrowserslist = (object: Targets) => {
export const objectToBrowserslist = (object: Targets): Array<string> => {
return Object.keys(object).reduce((list, targetName) => {
if (validBrowserslistTargets.indexOf(targetName) >= 0) {
const targetVersion = object[targetName];

View File

@@ -24,7 +24,7 @@ toFastProperties(NODE_FIELDS);
toFastProperties(BUILDER_KEYS);
toFastProperties(DEPRECATED_KEYS);
const TYPES = Object.keys(VISITOR_KEYS)
const TYPES: Array<string> = Object.keys(VISITOR_KEYS)
.concat(Object.keys(FLIPPED_ALIAS_KEYS))
.concat(Object.keys(DEPRECATED_KEYS));

View File

@@ -3492,9 +3492,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"
flow-bin@^0.66.0:
version "0.66.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.66.0.tgz#a96dde7015dc3343fd552a7b4963c02be705ca26"
flow-bin@^0.73.0:
version "0.73.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.73.0.tgz#da1b90a02b0ef9c439f068c2fc14968db83be425"
flush-write-stream@^1.0.2:
version "1.0.3"