Bump prettier (#6991)
This commit is contained in:
parent
d6db5fb1e1
commit
c7980b2b90
@ -51,7 +51,7 @@
|
|||||||
"mocha": "^3.0.0",
|
"mocha": "^3.0.0",
|
||||||
"nyc": "^11.0.3",
|
"nyc": "^11.0.3",
|
||||||
"output-file-sync": "^2.0.0",
|
"output-file-sync": "^2.0.0",
|
||||||
"prettier": "1.7.3",
|
"prettier": "1.9.1",
|
||||||
"pump": "^1.0.2",
|
"pump": "^1.0.2",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
"semver": "^5.0.0",
|
"semver": "^5.0.0",
|
||||||
|
|||||||
@ -88,7 +88,9 @@ class ConfigChainBuilder {
|
|||||||
mergeConfigFile(file: ConfigFile, envName: string) {
|
mergeConfigFile(file: ConfigFile, envName: string) {
|
||||||
if (this.seenFiles.has(file)) {
|
if (this.seenFiles.has(file)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Cycle detected in Babel configuration file through "${file.filepath}".`,
|
`Cycle detected in Babel configuration file through "${
|
||||||
|
file.filepath
|
||||||
|
}".`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -191,9 +191,9 @@ function assertPluginTarget(
|
|||||||
typeof value !== "function"
|
typeof value !== "function"
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`.${key}[${index}]${inArray
|
`.${key}[${index}]${
|
||||||
? `[0]`
|
inArray ? `[0]` : ""
|
||||||
: ""} must be a string, object, function`,
|
} must be a string, object, function`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@ -164,7 +164,9 @@ export default function get(entryLoc): Array<Suite> {
|
|||||||
|
|
||||||
if (minimumVersion == null) {
|
if (minimumVersion == null) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`'minNodeVersion' has invalid semver format: ${taskOpts.minNodeVersion}`,
|
`'minNodeVersion' has invalid semver format: ${
|
||||||
|
taskOpts.minNodeVersion
|
||||||
|
}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,16 +25,16 @@ export default function(api, options) {
|
|||||||
let moduleName = this.getModuleName();
|
let moduleName = this.getModuleName();
|
||||||
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
||||||
|
|
||||||
const {
|
const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(
|
||||||
meta,
|
path,
|
||||||
headers,
|
{
|
||||||
} = rewriteModuleStatementsAndPrepareHeader(path, {
|
|
||||||
loose,
|
loose,
|
||||||
strict,
|
strict,
|
||||||
strictMode,
|
strictMode,
|
||||||
allowTopLevelThis,
|
allowTopLevelThis,
|
||||||
noInterop,
|
noInterop,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const amdArgs = [];
|
const amdArgs = [];
|
||||||
const importNames = [];
|
const importNames = [];
|
||||||
|
|||||||
@ -113,17 +113,17 @@ export default function(api, options) {
|
|||||||
let moduleName = this.getModuleName();
|
let moduleName = this.getModuleName();
|
||||||
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
||||||
|
|
||||||
const {
|
const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(
|
||||||
meta,
|
path,
|
||||||
headers,
|
{
|
||||||
} = rewriteModuleStatementsAndPrepareHeader(path, {
|
|
||||||
exportName: "exports",
|
exportName: "exports",
|
||||||
loose,
|
loose,
|
||||||
strict,
|
strict,
|
||||||
strictMode,
|
strictMode,
|
||||||
allowTopLevelThis,
|
allowTopLevelThis,
|
||||||
noInterop,
|
noInterop,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
for (const [source, metadata] of meta.source) {
|
for (const [source, metadata] of meta.source) {
|
||||||
const loadExpr = t.callExpression(t.identifier("require"), [
|
const loadExpr = t.callExpression(t.identifier("require"), [
|
||||||
|
|||||||
@ -130,16 +130,16 @@ export default function(api, options) {
|
|||||||
let moduleName = this.getModuleName();
|
let moduleName = this.getModuleName();
|
||||||
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
if (moduleName) moduleName = t.stringLiteral(moduleName);
|
||||||
|
|
||||||
const {
|
const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(
|
||||||
meta,
|
path,
|
||||||
headers,
|
{
|
||||||
} = rewriteModuleStatementsAndPrepareHeader(path, {
|
|
||||||
loose,
|
loose,
|
||||||
strict,
|
strict,
|
||||||
strictMode,
|
strictMode,
|
||||||
allowTopLevelThis,
|
allowTopLevelThis,
|
||||||
noInterop,
|
noInterop,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const amdArgs = [];
|
const amdArgs = [];
|
||||||
const commonjsArgs = [];
|
const commonjsArgs = [];
|
||||||
|
|||||||
@ -54,16 +54,15 @@ const byTestSuite = suite => browser => {
|
|||||||
: true;
|
: true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const compatSources = [
|
const compatSources = ["es6", "es2016plus", "esnext"].reduce(
|
||||||
"es6",
|
(result, source) => {
|
||||||
"es2016plus",
|
|
||||||
"esnext",
|
|
||||||
].reduce((result, source) => {
|
|
||||||
const data = require(`compat-table/data-${source}`);
|
const data = require(`compat-table/data-${source}`);
|
||||||
data.browsers = pickBy(envs, byTestSuite(source));
|
data.browsers = pickBy(envs, byTestSuite(source));
|
||||||
result.push(data);
|
result.push(data);
|
||||||
return result;
|
return result;
|
||||||
}, []);
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
const interpolateAllResults = (rawBrowsers, tests) => {
|
const interpolateAllResults = (rawBrowsers, tests) => {
|
||||||
const interpolateResults = res => {
|
const interpolateResults = res => {
|
||||||
|
|||||||
@ -56,9 +56,8 @@ export const isPluginRequired = (
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRequiredForEnvironments: Array<
|
const isRequiredForEnvironments: Array<string> = targetEnvironments.filter(
|
||||||
string,
|
environment => {
|
||||||
> = targetEnvironments.filter(environment => {
|
|
||||||
// Feature is not implemented in that environment
|
// Feature is not implemented in that environment
|
||||||
if (!plugin[environment]) {
|
if (!plugin[environment]) {
|
||||||
return true;
|
return true;
|
||||||
@ -85,7 +84,8 @@ export const isPluginRequired = (
|
|||||||
semverify(lowestImplementedVersion),
|
semverify(lowestImplementedVersion),
|
||||||
lowestTargetedVersion,
|
lowestTargetedVersion,
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return isRequiredForEnvironments.length > 0;
|
return isRequiredForEnvironments.length > 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -37,9 +37,8 @@ export const statements: Formatter<
|
|||||||
Array<BabelNodeStatement>,
|
Array<BabelNodeStatement>,
|
||||||
> = makeStatementFormatter(body => body);
|
> = makeStatementFormatter(body => body);
|
||||||
|
|
||||||
export const statement: Formatter<
|
export const statement: Formatter<BabelNodeStatement> = makeStatementFormatter(
|
||||||
BabelNodeStatement,
|
body => {
|
||||||
> = makeStatementFormatter(body => {
|
|
||||||
// We do this validation when unwrapping since the replacement process
|
// We do this validation when unwrapping since the replacement process
|
||||||
// could have added or removed statements.
|
// could have added or removed statements.
|
||||||
if (body.length === 0) {
|
if (body.length === 0) {
|
||||||
@ -50,7 +49,8 @@ export const statement: Formatter<
|
|||||||
}
|
}
|
||||||
|
|
||||||
return body[0];
|
return body[0];
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
export const expression: Formatter<BabelNodeExpression> = {
|
export const expression: Formatter<BabelNodeExpression> = {
|
||||||
code: str => `(\n${str}\n)`,
|
code: str => `(\n${str}\n)`,
|
||||||
|
|||||||
@ -38,7 +38,9 @@ export default function populatePlaceholders(
|
|||||||
(replacements && replacements[placeholder.name]) || null,
|
(replacements && replacements[placeholder.name]) || null,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
e.message = `babel-template placeholder "${placeholder.name}": ${e.message}`;
|
e.message = `babel-template placeholder "${placeholder.name}": ${
|
||||||
|
e.message
|
||||||
|
}`;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -24,7 +24,9 @@ export default function traverse(
|
|||||||
if (parent.type !== "Program" && parent.type !== "File") {
|
if (parent.type !== "Program" && parent.type !== "File") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"You must pass a scope and parentPath unless traversing a Program/File. " +
|
"You must pass a scope and parentPath unless traversing a Program/File. " +
|
||||||
`Instead of that you tried to traverse a ${parent.type} node without ` +
|
`Instead of that you tried to traverse a ${
|
||||||
|
parent.type
|
||||||
|
} node without ` +
|
||||||
"passing scope and parentPath.",
|
"passing scope and parentPath.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ export default function builder(type: string, ...args: Array<any>): Object {
|
|||||||
const countArgs = args.length;
|
const countArgs = args.length;
|
||||||
if (countArgs > keys.length) {
|
if (countArgs > keys.length) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`,
|
`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${
|
||||||
|
keys.length
|
||||||
|
}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,9 +61,10 @@ export function assertNodeType(...types: Array<string>): Function {
|
|||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
`Property ${key} of ${
|
||||||
types,
|
node.type
|
||||||
)} ` + `but instead got ${JSON.stringify(val && val.type)}`,
|
} expected node to be of a type ${JSON.stringify(types)} ` +
|
||||||
|
`but instead got ${JSON.stringify(val && val.type)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,9 +87,10 @@ export function assertNodeOrValueType(...types: Array<string>): Function {
|
|||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
`Property ${key} of ${
|
||||||
types,
|
node.type
|
||||||
)} ` + `but instead got ${JSON.stringify(val && val.type)}`,
|
} expected node to be of a type ${JSON.stringify(types)} ` +
|
||||||
|
`but instead got ${JSON.stringify(val && val.type)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -885,7 +885,9 @@ export default class ExpressionParser extends LValParser {
|
|||||||
if (node.property.name !== propertyName) {
|
if (node.property.name !== propertyName) {
|
||||||
this.raise(
|
this.raise(
|
||||||
node.property.start,
|
node.property.start,
|
||||||
`The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`,
|
`The only valid meta property for ${meta.name} is ${
|
||||||
|
meta.name
|
||||||
|
}.${propertyName}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,9 +124,9 @@ for (const type in t.NODE_FIELDS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < t.TYPES.length; i++) {
|
for (let i = 0; i < t.TYPES.length; i++) {
|
||||||
let decl = `declare function is${t.TYPES[
|
let decl = `declare function is${
|
||||||
i
|
t.TYPES[i]
|
||||||
]}(node: Object, opts?: ?Object): boolean`;
|
}(node: Object, opts?: ?Object): boolean`;
|
||||||
|
|
||||||
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
if (t.NODE_FIELDS[t.TYPES[i]]) {
|
||||||
decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`;
|
decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`;
|
||||||
|
|||||||
@ -5059,9 +5059,9 @@ preserve@^0.2.0:
|
|||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||||
|
|
||||||
prettier@1.7.3:
|
prettier@1.9.1:
|
||||||
version "1.7.3"
|
version "1.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.3.tgz#8e6974725273914b1c47439959dd3d3ba53664b6"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70"
|
||||||
|
|
||||||
pretty-format@^21.2.1:
|
pretty-format@^21.2.1:
|
||||||
version "21.2.1"
|
version "21.2.1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user