prettier@1.15.1 (#9001)

This commit is contained in:
Brian Ng 2018-11-09 15:25:13 -06:00 committed by GitHub
parent 504b331da4
commit 4f206b2416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 49 additions and 63 deletions

View File

@ -55,7 +55,7 @@
"lodash": "^4.17.10", "lodash": "^4.17.10",
"merge-stream": "^1.0.1", "merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0", "output-file-sync": "^2.0.0",
"prettier": "^1.14.3", "prettier": "^1.15.1",
"pump": "^1.0.2", "pump": "^1.0.2",
"rimraf": "^2.4.3", "rimraf": "^2.4.3",
"rollup-plugin-babel": "^4.0.0-beta.0", "rollup-plugin-babel": "^4.0.0-beta.0",

View File

@ -332,8 +332,8 @@ export default class ExpressionParser extends LValParser {
this.finishNode( this.finishNode(
node, node,
op === tt.logicalOR || op === tt.logicalOR ||
op === tt.logicalAND || op === tt.logicalAND ||
op === tt.nullishCoalescing op === tt.nullishCoalescing
? "LogicalExpression" ? "LogicalExpression"
: "BinaryExpression", : "BinaryExpression",
); );

View File

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

View File

@ -597,8 +597,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
const type = this.match(tt._void) const type = this.match(tt._void)
? "TSVoidKeyword" ? "TSVoidKeyword"
: this.match(tt._null) : this.match(tt._null)
? "TSNullKeyword" ? "TSNullKeyword"
: keywordTypeFromName(this.state.value); : keywordTypeFromName(this.state.value);
if (type !== undefined && this.lookahead().type !== tt.dot) { if (type !== undefined && this.lookahead().type !== tt.dot) {
const node: N.TsKeywordType = this.startNode(); const node: N.TsKeywordType = this.startNode();
this.next(); this.next();
@ -691,8 +691,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
return operator return operator
? this.tsParseTypeOperator(operator) ? this.tsParseTypeOperator(operator)
: this.isContextual("infer") : this.isContextual("infer")
? this.tsParseInferType() ? this.tsParseInferType()
: this.tsParseArrayTypeOrHigher(); : this.tsParseArrayTypeOrHigher();
} }
tsParseUnionOrIntersectionType( tsParseUnionOrIntersectionType(
@ -1381,8 +1381,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
type === "FunctionDeclaration" type === "FunctionDeclaration"
? "TSDeclareFunction" ? "TSDeclareFunction"
: type === "ClassMethod" : type === "ClassMethod"
? "TSDeclareMethod" ? "TSDeclareMethod"
: undefined; : undefined;
if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {
this.finishNode(node, bodilessType); this.finishNode(node, bodilessType);
return; return;

View File

@ -881,10 +881,10 @@ export default class Tokenizer extends LocationParser {
radix === 16 radix === 16
? allowedNumericSeparatorSiblings.hex ? allowedNumericSeparatorSiblings.hex
: radix === 10 : radix === 10
? allowedNumericSeparatorSiblings.dec ? allowedNumericSeparatorSiblings.dec
: radix === 8 : radix === 8
? allowedNumericSeparatorSiblings.oct ? allowedNumericSeparatorSiblings.oct
: allowedNumericSeparatorSiblings.bin; : allowedNumericSeparatorSiblings.bin;
let total = 0; let total = 0;

View File

@ -1,8 +1,5 @@
{ {
"sourceType": "module", "sourceType": "module",
"plugins": [ "plugins": ["jsx", "flow"],
"jsx",
"flow"
],
"throws": "Cannot overwrite reserved type _ (2:5)" "throws": "Cannot overwrite reserved type _ (2:5)"
} }

View File

@ -1,8 +1,5 @@
{ {
"sourceType": "module", "sourceType": "module",
"plugins": [ "plugins": ["jsx", "flow"],
"jsx",
"flow"
],
"throws": "Cannot overwrite reserved type _ (2:13)" "throws": "Cannot overwrite reserved type _ (2:13)"
} }

View File

@ -1,4 +1,4 @@
{ {
"sourceType": "script", "sourceType": "script",
"plugins": ["jsx", "flow"] "plugins": ["jsx", "flow"]
} }

View File

@ -1,7 +1,4 @@
{ {
"plugins": [ "plugins": ["typescript", ["decorators", { "decoratorsBeforeExport": true }]],
"typescript",
["decorators", { "decoratorsBeforeExport": true }]
],
"throws": "Unexpected token, expected \"(\" (2:0)" "throws": "Unexpected token, expected \"(\" (2:0)"
} }

View File

@ -1,6 +1,3 @@
{ {
"plugins": [ "plugins": ["typescript", ["decorators", { "decoratorsBeforeExport": true }]]
"typescript",
["decorators", { "decoratorsBeforeExport": true }]
]
} }

View File

@ -1,7 +1,5 @@
{ {
"sourceType": "module", "sourceType": "module",
"plugins": [ "plugins": ["typescript"],
"typescript"
],
"throws": "A required element cannot follow an optional element. (1:17)" "throws": "A required element cannot follow an optional element. (1:17)"
} }

View File

@ -1,7 +1,5 @@
{ {
"sourceType": "module", "sourceType": "module",
"plugins": [ "plugins": ["typescript"],
"typescript"
],
"throws": "A rest element must be last in a tuple type. (1:8)" "throws": "A rest element must be last in a tuple type. (1:8)"
} }

View File

@ -82,8 +82,8 @@ function getSingleElementDefinition(path, superRef, classRef, file) {
isMethod isMethod
? value(node.body, node.params, node.async, node.generator) ? value(node.body, node.params, node.async, node.generator)
: node.value : node.value
? value(template.ast`{ return ${node.value} }`) ? value(template.ast`{ return ${node.value} }`)
: prop("value", scope.buildUndefinedNode()), : prop("value", scope.buildUndefinedNode()),
].filter(Boolean); ].filter(Boolean);
return t.objectExpression(properties); return t.objectExpression(properties);

View File

@ -229,13 +229,15 @@ const getLowestImplementedVersion = ({ features }, env) => {
return null; return null;
} }
return envTests.map(str => str.replace(env, "")).reduce((a, b) => { return envTests
if (b === unreleasedLabelForEnv) { .map(str => str.replace(env, ""))
return b; .reduce((a, b) => {
} if (b === unreleasedLabelForEnv) {
return b;
}
return semver.lt(semver.coerce(a), semver.coerce(b)) ? b : a; return semver.lt(semver.coerce(a), semver.coerce(b)) ? b : a;
}); });
}; };
const generateData = (environments, features) => { const generateData = (environments, features) => {

View File

@ -1,3 +1,3 @@
{ {
"throws": "yield is not allowed in the parameters of an arrow function inside a generator (2:8)" "throws": "yield is not allowed in the parameters of an arrow function inside a generator (2:8)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "invalid use of await inside of an async function (1:16)" "throws": "invalid use of await inside of an async function (1:16)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "invalid use of await inside of an async function (2:11)" "throws": "invalid use of await inside of an async function (2:11)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:23)" "throws": "await is not allowed in the parameters of an arrow function inside an async function (2:23)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "Unexpected token, expected \",\" (1:17)" "throws": "Unexpected token, expected \",\" (1:17)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:7)" "throws": "await is not allowed in the parameters of an arrow function inside an async function (2:7)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:13)" "throws": "await is not allowed in the parameters of an arrow function inside an async function (2:13)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "Unexpected token, expected \",\" (2:25)" "throws": "Unexpected token, expected \",\" (2:25)"
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "await is not allowed in async function parameters (1:22)" "throws": "await is not allowed in async function parameters (1:22)"
} }

View File

@ -7734,10 +7734,10 @@ preserve@^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"
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=
prettier@^1.14.3: prettier@^1.15.1:
version "1.14.3" version "1.15.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.1.tgz#06c67106afb1b40e74b002353b2079cc7e0e67bf"
integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== integrity sha512-4rgV2hyc/5Pk0XHH4VjJWHRgVjgRbpMfLQjREAhHBtyW1UvTFkjJEsueGYNYYZd9mn97K+1qv0EBwm11zoaSgA==
pretty-format@^23.6.0: pretty-format@^23.6.0:
version "23.6.0" version "23.6.0"