prettier@1.15.1 (#9001)
This commit is contained in:
@@ -332,8 +332,8 @@ export default class ExpressionParser extends LValParser {
|
||||
this.finishNode(
|
||||
node,
|
||||
op === tt.logicalOR ||
|
||||
op === tt.logicalAND ||
|
||||
op === tt.nullishCoalescing
|
||||
op === tt.logicalAND ||
|
||||
op === tt.nullishCoalescing
|
||||
? "LogicalExpression"
|
||||
: "BinaryExpression",
|
||||
);
|
||||
|
||||
@@ -619,8 +619,8 @@ export default class StatementParser extends ExpressionParser {
|
||||
const kind = this.state.type.isLoop
|
||||
? "loop"
|
||||
: this.match(tt._switch)
|
||||
? "switch"
|
||||
: null;
|
||||
? "switch"
|
||||
: null;
|
||||
for (let i = this.state.labels.length - 1; i >= 0; i--) {
|
||||
const label = this.state.labels[i];
|
||||
if (label.statementStart === node.start) {
|
||||
|
||||
@@ -597,8 +597,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
const type = this.match(tt._void)
|
||||
? "TSVoidKeyword"
|
||||
: this.match(tt._null)
|
||||
? "TSNullKeyword"
|
||||
: keywordTypeFromName(this.state.value);
|
||||
? "TSNullKeyword"
|
||||
: keywordTypeFromName(this.state.value);
|
||||
if (type !== undefined && this.lookahead().type !== tt.dot) {
|
||||
const node: N.TsKeywordType = this.startNode();
|
||||
this.next();
|
||||
@@ -691,8 +691,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return operator
|
||||
? this.tsParseTypeOperator(operator)
|
||||
: this.isContextual("infer")
|
||||
? this.tsParseInferType()
|
||||
: this.tsParseArrayTypeOrHigher();
|
||||
? this.tsParseInferType()
|
||||
: this.tsParseArrayTypeOrHigher();
|
||||
}
|
||||
|
||||
tsParseUnionOrIntersectionType(
|
||||
@@ -1381,8 +1381,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
type === "FunctionDeclaration"
|
||||
? "TSDeclareFunction"
|
||||
: type === "ClassMethod"
|
||||
? "TSDeclareMethod"
|
||||
: undefined;
|
||||
? "TSDeclareMethod"
|
||||
: undefined;
|
||||
if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {
|
||||
this.finishNode(node, bodilessType);
|
||||
return;
|
||||
|
||||
@@ -881,10 +881,10 @@ export default class Tokenizer extends LocationParser {
|
||||
radix === 16
|
||||
? allowedNumericSeparatorSiblings.hex
|
||||
: radix === 10
|
||||
? allowedNumericSeparatorSiblings.dec
|
||||
: radix === 8
|
||||
? allowedNumericSeparatorSiblings.oct
|
||||
: allowedNumericSeparatorSiblings.bin;
|
||||
? allowedNumericSeparatorSiblings.dec
|
||||
: radix === 8
|
||||
? allowedNumericSeparatorSiblings.oct
|
||||
: allowedNumericSeparatorSiblings.bin;
|
||||
|
||||
let total = 0;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": [
|
||||
"jsx",
|
||||
"flow"
|
||||
],
|
||||
"plugins": ["jsx", "flow"],
|
||||
"throws": "Cannot overwrite reserved type _ (2:5)"
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": [
|
||||
"jsx",
|
||||
"flow"
|
||||
],
|
||||
"plugins": ["jsx", "flow"],
|
||||
"throws": "Cannot overwrite reserved type _ (2:13)"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"sourceType": "script",
|
||||
"plugins": ["jsx", "flow"]
|
||||
}
|
||||
"sourceType": "script",
|
||||
"plugins": ["jsx", "flow"]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
{
|
||||
"plugins": [
|
||||
"typescript",
|
||||
["decorators", { "decoratorsBeforeExport": true }]
|
||||
],
|
||||
"plugins": ["typescript", ["decorators", { "decoratorsBeforeExport": true }]],
|
||||
"throws": "Unexpected token, expected \"(\" (2:0)"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{
|
||||
"plugins": [
|
||||
"typescript",
|
||||
["decorators", { "decoratorsBeforeExport": true }]
|
||||
]
|
||||
"plugins": ["typescript", ["decorators", { "decoratorsBeforeExport": true }]]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": [
|
||||
"typescript"
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"throws": "A required element cannot follow an optional element. (1:17)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": [
|
||||
"typescript"
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"throws": "A rest element must be last in a tuple type. (1:8)"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user