Skip to content

Commit 514b6d3

Browse files
committed
Bump Prettier dependency to 1.15.0
1 parent fa40f2d commit 514b6d3

24 files changed

Lines changed: 345 additions & 362 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
- Better handling of trailing spaces in Markdown ([#4593](https://github.com/prettier/prettier/pull/4593))
6565
- Fix empty file error in JSON and GraphQL ([#4553](https://github.com/prettier/prettier/pull/4553))
6666
- Preserve decorator on TypeScript interfaces ([#4632](https://github.com/prettier/prettier/pull/4632))
67-
- Inline \_ or $ in the root of a method chain ([#4621](https://github.com/prettier/prettier/pull/4621))
67+
- Inline \_ or \$ in the root of a method chain ([#4621](https://github.com/prettier/prettier/pull/4621))
6868

6969
# 1.13.4
7070

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "1.15.0",
3+
"version": "1.16.0-dev",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": {
66
"prettier": "./bin/prettier.js"
@@ -96,7 +96,7 @@
9696
"jest-snapshot-serializer-raw": "1.1.0",
9797
"jest-watch-typeahead": "0.1.0",
9898
"mkdirp": "0.5.1",
99-
"prettier": "1.14.3",
99+
"prettier": "1.15.0",
100100
"prettylint": "1.0.0",
101101
"rimraf": "2.6.2",
102102
"rollup": "0.47.6",

src/cli/util.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ const CHOICE_USAGE_MARGIN = 3;
2525
const CHOICE_USAGE_INDENTATION = 2;
2626

2727
function getOptions(argv, detailedOptions) {
28-
return detailedOptions.filter(option => option.forwardToApi).reduce(
29-
(current, option) =>
30-
Object.assign(current, {
31-
[option.forwardToApi]: argv[option.name]
32-
}),
33-
{}
34-
);
28+
return detailedOptions
29+
.filter(option => option.forwardToApi)
30+
.reduce(
31+
(current, option) =>
32+
Object.assign(current, {
33+
[option.forwardToApi]: argv[option.name]
34+
}),
35+
{}
36+
);
3537
}
3638

3739
function cliifyOptions(object, apiDetailedOptionMap) {

src/common/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ function printString(raw, options, isDirectiveLiteral) {
476476
options.parser === "json"
477477
? '"'
478478
: options.__isInHtmlAttribute
479-
? "'"
480-
: getPreferredQuote(raw, options.singleQuote ? "'" : '"');
479+
? "'"
480+
: getPreferredQuote(raw, options.singleQuote ? "'" : '"');
481481

482482
// Directives are exact code unit sequences, which means that you can't
483483
// change the escape sequences they use.

src/config/resolve-config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ function _resolveConfig(filePath, opts, sync) {
7878

7979
["plugins", "pluginSearchDirs"].forEach(optionName => {
8080
if (Array.isArray(merged[optionName])) {
81-
merged[optionName] = merged[optionName].map(
82-
value =>
83-
typeof value === "string" && value.startsWith(".") // relative path
84-
? path.resolve(path.dirname(result.filepath), value)
85-
: value
81+
merged[optionName] = merged[optionName].map(value =>
82+
typeof value === "string" && value.startsWith(".") // relative path
83+
? path.resolve(path.dirname(result.filepath), value)
84+
: value
8685
);
8786
}
8887
});

src/doc/doc-debug.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,10 @@ function printDoc(doc) {
7575
return doc.n === -Infinity
7676
? "dedentToRoot(" + printDoc(doc.contents) + ")"
7777
: doc.n < 0
78-
? "dedent(" + printDoc(doc.contents) + ")"
79-
: doc.n.type === "root"
80-
? "markAsRoot(" + printDoc(doc.contents) + ")"
81-
: "align(" +
82-
JSON.stringify(doc.n) +
83-
", " +
84-
printDoc(doc.contents) +
85-
")";
78+
? "dedent(" + printDoc(doc.contents) + ")"
79+
: doc.n.type === "root"
80+
? "markAsRoot(" + printDoc(doc.contents) + ")"
81+
: "align(" + JSON.stringify(doc.n) + ", " + printDoc(doc.contents) + ")";
8682
}
8783

8884
if (doc.type === "if-break") {

src/doc/doc-printer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ function makeAlign(ind, n, options) {
2222
return n === -Infinity
2323
? ind.root || rootIndent()
2424
: n < 0
25-
? generateInd(ind, { type: "dedent" }, options)
26-
: !n
27-
? ind
28-
: n.type === "root"
29-
? Object.assign({}, ind, { root: ind })
30-
: typeof n === "string"
31-
? generateInd(ind, { type: "stringAlign", n }, options)
32-
: generateInd(ind, { type: "numberAlign", n }, options);
25+
? generateInd(ind, { type: "dedent" }, options)
26+
: !n
27+
? ind
28+
: n.type === "root"
29+
? Object.assign({}, ind, { root: ind })
30+
: typeof n === "string"
31+
? generateInd(ind, { type: "stringAlign", n }, options)
32+
: generateInd(ind, { type: "numberAlign", n }, options);
3333
}
3434

3535
function generateInd(ind, newPart, options) {

src/language-css/embed.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ function embed(path, print, textToDoc /*, options */) {
2727
return null;
2828

2929
function replaceNewlinesWithLiterallines(doc) {
30-
return mapDoc(
31-
doc,
32-
currentDoc =>
33-
typeof currentDoc === "string" && currentDoc.includes("\n")
34-
? concat(
35-
currentDoc
36-
.split(/(\n)/g)
37-
.map((v, i) => (i % 2 === 0 ? v : literalline))
38-
)
39-
: currentDoc
30+
return mapDoc(doc, currentDoc =>
31+
typeof currentDoc === "string" && currentDoc.includes("\n")
32+
? concat(
33+
currentDoc
34+
.split(/(\n)/g)
35+
.map((v, i) => (i % 2 === 0 ? v : literalline))
36+
)
37+
: currentDoc
4038
);
4139
}
4240
}

src/language-css/printer-postcss.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,18 @@ function genericPrint(path, options, print) {
164164
node.raws.important
165165
? node.raws.important.replace(/\s*!\s*important/i, " !important")
166166
: node.important
167-
? " !important"
168-
: "",
167+
? " !important"
168+
: "",
169169
node.raws.scssDefault
170170
? node.raws.scssDefault.replace(/\s*!default/i, " !default")
171171
: node.scssDefault
172-
? " !default"
173-
: "",
172+
? " !default"
173+
: "",
174174
node.raws.scssGlobal
175175
? node.raws.scssGlobal.replace(/\s*!global/i, " !global")
176176
: node.scssGlobal
177-
? " !global"
178-
: "",
177+
? " !global"
178+
: "",
179179
node.nodes
180180
? concat([
181181
" {",
@@ -188,8 +188,8 @@ function genericPrint(path, options, print) {
188188
: isTemplatePropNode(node) &&
189189
!parentNode.raws.semicolon &&
190190
options.originalText[options.locEnd(node) - 1] !== ";"
191-
? ""
192-
: ";"
191+
? ""
192+
: ";"
193193
]);
194194
}
195195
case "css-atrule": {
@@ -208,8 +208,8 @@ function genericPrint(path, options, print) {
208208
isDetachedRulesetCallNode(node)
209209
? ""
210210
: isTemplatePlaceholderNode(node)
211-
? node.raws.afterName
212-
: " ",
211+
? node.raws.afterName
212+
: " ",
213213
path.call(print, "params")
214214
])
215215
: "",
@@ -229,8 +229,8 @@ function genericPrint(path, options, print) {
229229
])
230230
)
231231
: node.name === "else"
232-
? " "
233-
: "",
232+
? " "
233+
: "",
234234
node.nodes
235235
? concat([
236236
isSCSSControlDirectiveNode(node) ? "" : " ",
@@ -247,8 +247,8 @@ function genericPrint(path, options, print) {
247247
: isTemplatePlaceholderNode(node) &&
248248
!parentNode.raws.semicolon &&
249249
options.originalText[options.locEnd(node) - 1] !== ";"
250-
? ""
251-
: ";"
250+
? ""
251+
: ";"
252252
]);
253253
}
254254
// postcss-media-query-parser
@@ -343,7 +343,7 @@ function genericPrint(path, options, print) {
343343
? node.value
344344
: adjustNumbers(
345345
isHTMLTag(node.value) ||
346-
isKeyframeAtRuleKeywords(path, node.value)
346+
isKeyframeAtRuleKeywords(path, node.value)
347347
? node.value.toLowerCase()
348348
: node.value
349349
)
@@ -759,8 +759,8 @@ function genericPrint(path, options, print) {
759759
),
760760
ifBreak(
761761
isSCSS(options.parser, options.originalText) &&
762-
isSCSSMapItem &&
763-
shouldPrintComma(options)
762+
isSCSSMapItem &&
763+
shouldPrintComma(options)
764764
? ","
765765
: ""
766766
),

src/language-html/ast.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ function mapNodesIfChanged(nodes, fn) {
9999
}
100100

101101
function cloneAndUpdateNodes(nodes, parent) {
102-
const siblings = nodes.map(
103-
node => (node instanceof Node ? node.clone() : new Node(node))
102+
const siblings = nodes.map(node =>
103+
node instanceof Node ? node.clone() : new Node(node)
104104
);
105105

106106
let prev = null;

0 commit comments

Comments
 (0)