Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettier@1.15.1 #9001

Merged
merged 1 commit into from Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -55,7 +55,7 @@
"lodash": "^4.17.10",
"merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0",
"prettier": "^1.14.3",
"prettier": "^1.15.1",
"pump": "^1.0.2",
"rimraf": "^2.4.3",
"rollup-plugin-babel": "^4.0.0-beta.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -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",
);
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/statement.js
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions packages/babel-parser/src/plugins/typescript.js
Expand Up @@ -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();
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-parser/src/tokenizer/index.js
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this seems to make some of these solidly unreadable. Can we see if this is expected, or a bug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, that's life with Prettier then :P I always thought the excessive nesting was a nice reminder that hey nested ternaries are usually a bad idea. Now they are easy to miss. Alas.

: allowedNumericSeparatorSiblings.bin;

let total = 0;

Expand Down
@@ -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)"
}
}
4 changes: 2 additions & 2 deletions packages/babel-plugin-proposal-decorators/src/transformer.js
Expand Up @@ -82,8 +82,8 @@ function getSingleElementDefinition(path, superRef, classRef, file) {
isMethod
? value(node.body, node.params, node.async, node.generator)
: node.value
? value(template.ast`{ return ${node.value} }`)
: prop("value", scope.buildUndefinedNode()),
? value(template.ast`{ return ${node.value} }`)
: prop("value", scope.buildUndefinedNode()),
].filter(Boolean);

return t.objectExpression(properties);
Expand Down
14 changes: 8 additions & 6 deletions packages/babel-preset-env/scripts/build-data.js
Expand Up @@ -229,13 +229,15 @@ const getLowestImplementedVersion = ({ features }, env) => {
return null;
}

return envTests.map(str => str.replace(env, "")).reduce((a, b) => {
if (b === unreleasedLabelForEnv) {
return b;
}
return envTests
.map(str => str.replace(env, ""))
.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) => {
Expand Down
@@ -1,3 +1,3 @@
{
"throws": "yield is not allowed in the parameters of an arrow function inside a generator (2:8)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "invalid use of await inside of an async function (1:16)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "invalid use of await inside of an async function (2:11)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:23)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token, expected \",\" (1:17)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:7)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "await is not allowed in the parameters of an arrow function inside an async function (2:13)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token, expected \",\" (2:25)"
}
}
@@ -1,3 +1,3 @@
{
"throws": "await is not allowed in async function parameters (1:22)"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -7734,10 +7734,10 @@ preserve@^0.2.0:
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=

prettier@^1.14.3:
version "1.14.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"
integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==
prettier@^1.15.1:
version "1.15.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.1.tgz#06c67106afb1b40e74b002353b2079cc7e0e67bf"
integrity sha512-4rgV2hyc/5Pk0XHH4VjJWHRgVjgRbpMfLQjREAhHBtyW1UvTFkjJEsueGYNYYZd9mn97K+1qv0EBwm11zoaSgA==

pretty-format@^23.6.0:
version "23.6.0"
Expand Down