Bump prettier to v1.13.2

This commit is contained in:
Brian Ng 2018-05-29 10:00:45 -05:00
parent 62114b807b
commit 5895277b32
10 changed files with 49 additions and 28 deletions

View File

@ -31,7 +31,7 @@
"eslint": "^4.18.2",
"eslint-config-babel": "^7.0.2",
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-prettier": "^2.5.0",
"eslint-plugin-prettier": "^2.6.0",
"flow-bin": "^0.73.0",
"graceful-fs": "^4.1.11",
"gulp": "^4.0.0",
@ -51,7 +51,7 @@
"lodash": "^4.17.5",
"merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0",
"prettier": "1.11.1",
"prettier": "1.13.2",
"pump": "^1.0.2",
"rimraf": "^2.4.3",
"rollup-plugin-babel": "^4.0.0-beta.0",

View File

@ -236,11 +236,13 @@ function babelrcLoadEnabled(
return micromatch(pkgData.directories, babelrcPatterns).length > 0;
}
const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("configfile", file.options),
}));
const validateConfigFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("configfile", file.options),
}),
);
const validateBabelrcFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
@ -250,11 +252,13 @@ const validateBabelrcFile = makeWeakCache(
}),
);
const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("extendsfile", file.options),
}));
const validateExtendFile = makeWeakCache(
(file: ConfigFile): ValidatedFile => ({
filepath: file.filepath,
dirname: file.dirname,
options: validate("extendsfile", file.options),
}),
);
/**
* Build a config chain for just the programmatic options passed into Babel.

View File

@ -62,12 +62,10 @@ function runModuleInTestContext(id: string, relativeFilename: string) {
const src = fs.readFileSync(filename, "utf8");
const code = `(function (exports, require, module, __filename, __dirname) {${src}\n});`;
vm
.runInContext(code, testContext, {
filename,
displayErrors: true,
})
.call(module.exports, module.exports, req, module, filename, dirname);
vm.runInContext(code, testContext, {
filename,
displayErrors: true,
}).call(module.exports, module.exports, req, module, filename, dirname);
return module.exports;
}

View File

@ -616,7 +616,9 @@ export default class StatementParser extends ExpressionParser {
const kind = this.state.type.isLoop
? "loop"
: this.match(tt._switch) ? "switch" : null;
: this.match(tt._switch)
? "switch"
: null;
for (let i = this.state.labels.length - 1; i >= 0; i--) {
const label = this.state.labels[i];
if (label.statementStart === node.start) {

View File

@ -1327,7 +1327,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
const bodilessType =
type === "FunctionDeclaration"
? "TSDeclareFunction"
: type === "ClassMethod" ? "TSDeclareMethod" : undefined;
: type === "ClassMethod"
? "TSDeclareMethod"
: undefined;
if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {
this.finishNode(node, bodilessType);
return;

View File

@ -277,7 +277,12 @@ export default declare((api, options) => {
}
if (path.isClassPrivateProperty()) {
const { static: isStatic, key: { id: { name } } } = path.node;
const {
static: isStatic,
key: {
id: { name },
},
} = path.node;
if (isStatic) {
throw path.buildCodeFrameError(

View File

@ -13,7 +13,15 @@ export default declare(api => {
inherits: syntaxFlow,
visitor: {
Program(path, { file: { ast: { comments } }, opts }) {
Program(
path,
{
file: {
ast: { comments },
},
opts,
},
) {
skipStrip = false;
let directiveFound = false;

View File

@ -101,7 +101,9 @@ function _evaluate(path, state) {
path.get("tag").isMemberExpression()
) {
const object = path.get("tag.object");
const { node: { name } } = object;
const {
node: { name },
} = object;
const property = path.get("tag.property");
if (

View File

@ -17,7 +17,7 @@ Promise.all([utils.getTests(testDir), utils.getWhitelist(whitelistFile)])
const results = tests.map(function(test, idx) {
if (idx % reportInc === 0) {
console.log(`> ${Math.round(100 * idx / total)}% complete`);
console.log(`> ${Math.round((100 * idx) / total)}% complete`);
}
return utils.runTest(test);

View File

@ -3070,7 +3070,7 @@ eslint-plugin-flowtype@^2.20.0:
dependencies:
lodash "^4.15.0"
eslint-plugin-prettier@^2.5.0:
eslint-plugin-prettier@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7"
dependencies:
@ -6497,9 +6497,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@1.11.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
prettier@1.13.2:
version "1.13.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.2.tgz#412b87bc561cb11074d2877a33a38f78c2303cda"
pretty-format@^21.2.1:
version "21.2.1"