Skip to content

Commit

Permalink
Bump own prettier dependency to 1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
suchipi committed Apr 12, 2018
1 parent 6ae20cb commit bdc5e00
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 22 deletions.
5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -73,7 +73,7 @@
"eslint-plugin-react": "7.7.0",
"jest": "21.1.0",
"mkdirp": "0.5.1",
"prettier": "1.11.1",
"prettier": "1.12.0",
"prettylint": "1.0.0",
"rimraf": "2.6.2",
"rollup": "0.47.6",
Expand All @@ -96,8 +96,7 @@
"test": "jest",
"test:dist": "node ./scripts/test-dist.js",
"test-integration": "jest tests_integration",
"lint":
"cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
"lint-docs": "prettylint {.,docs,website,website/blog}/*.md",
"build": "node ./scripts/build/build.js",
"build-docs": "node ./scripts/build/build-docs.js",
Expand Down
4 changes: 3 additions & 1 deletion src/common/util.js
Expand Up @@ -500,7 +500,9 @@ function printString(raw, options, isDirectiveLiteral) {
const enclosingQuote =
options.parser === "json"
? double.quote
: shouldUseAlternateQuote ? alternate.quote : preferred.quote;
: shouldUseAlternateQuote
? alternate.quote
: preferred.quote;

// Directives are exact code unit sequences, which means that you can't
// change the escape sequences they use.
Expand Down
20 changes: 15 additions & 5 deletions src/language-css/printer-postcss.js
Expand Up @@ -110,13 +110,19 @@ function genericPrint(path, options, print) {
: path.call(print, "value"),
node.raws.important
? node.raws.important.replace(/\s*!\s*important/i, " !important")
: node.important ? " !important" : "",
: node.important
? " !important"
: "",
node.raws.scssDefault
? node.raws.scssDefault.replace(/\s*!default/i, " !default")
: node.scssDefault ? " !default" : "",
: node.scssDefault
? " !default"
: "",
node.raws.scssGlobal
? node.raws.scssGlobal.replace(/\s*!global/i, " !global")
: node.scssGlobal ? " !global" : "",
: node.scssGlobal
? " !global"
: "",
node.nodes
? concat([
" {",
Expand Down Expand Up @@ -163,11 +169,15 @@ function genericPrint(path, options, print) {
" ",
path.call(print, "value"),
isControlDirectiveNode(node)
? hasParensAround ? " " : line
? hasParensAround
? " "
: line
: ""
])
)
: node.name === "else" ? " " : "",
: node.name === "else"
? " "
: "",
node.nodes
? concat([
isControlDirectiveNode(node) ? "" : " ",
Expand Down
8 changes: 6 additions & 2 deletions src/language-js/printer-estree.js
Expand Up @@ -283,7 +283,9 @@ function formatTernaryOperator(path, options, print, operatorOptions) {
// outer-most ConditionalExpression.
const maybeGroup = doc =>
operatorOpts.breakNested
? parent === firstNonConditionalParent ? group(doc) : doc
? parent === firstNonConditionalParent
? group(doc)
: doc
: group(doc); // Always group in normal mode.

// Break the closing paren to keep the chain right after it:
Expand Down Expand Up @@ -1938,7 +1940,9 @@ function printPathNoParens(path, options, print, args) {
concat([
hasOwnLineComment
? hardline
: hasComment && !isOpeningFragment ? " " : "",
: hasComment && !isOpeningFragment
? " "
: "",
comments.printDanglingComments(path, options, true)
])
),
Expand Down
30 changes: 23 additions & 7 deletions src/language-markdown/printer-markdown.js
Expand Up @@ -58,7 +58,9 @@ function genericPrint(path, options, print) {
node =>
node.type === "word"
? node.value
: node.value === "" ? "" : printLine(path, node.value, options)
: node.value === ""
? ""
: printLine(path, node.value, options)
)
);
}
Expand Down Expand Up @@ -249,9 +251,13 @@ function genericPrint(path, options, print) {
const rawPrefix = node.ordered
? (index === 0
? node.start
: isGitDiffFriendlyOrderedList ? 1 : node.start + index) +
: isGitDiffFriendlyOrderedList
? 1
: node.start + index) +
(nthSiblingIndex % 2 === 0 ? ". " : ") ")
: nthSiblingIndex % 2 === 0 ? "* " : "- ";
: nthSiblingIndex % 2 === 0
? "* "
: "- ";

// do not print trailing spaces for empty list item since it might be treated as `break` node
// by [doc-printer](https://github.com/prettier/prettier/blob/1.10.2/src/doc/doc-printer.js#L395-L405),
Expand Down Expand Up @@ -282,7 +288,9 @@ function genericPrint(path, options, print) {
"]",
node.referenceType === "full"
? concat(["[", node.identifier, "]"])
: node.referenceType === "collapsed" ? "[]" : ""
: node.referenceType === "collapsed"
? "[]"
: ""
]);
case "imageReference":
switch (node.referenceType) {
Expand Down Expand Up @@ -442,8 +450,12 @@ function printLine(path, value, options) {
options.proseWrap === "always" &&
!getAncestorNode(path, SINGLE_LINE_NODE_TYPES);
return value !== ""
? isBreakable ? line : " "
: isBreakable ? softline : "";
? isBreakable
? line
: " "
: isBreakable
? softline
: "";
}

function printTable(path, options, print) {
Expand Down Expand Up @@ -752,7 +764,11 @@ function printTitle(title, options) {
const quote =
singleCount > doubleCount
? '"'
: doubleCount > singleCount ? "'" : options.singleQuote ? "'" : '"';
: doubleCount > singleCount
? "'"
: options.singleQuote
? "'"
: '"';
title = title.replace(new RegExp(`(${quote})`, "g"), "\\$1");
return ` ${quote}${title}${quote}`;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/options-normalizer.js
Expand Up @@ -9,7 +9,9 @@ function normalizeOptions(options, optionInfos, opts) {
const logger =
opts.logger === false
? { warn() {} }
: opts.logger !== undefined ? opts.logger : console;
: opts.logger !== undefined
? opts.logger
: console;
const descriptor = opts.descriptor || descriptors.apiDescriptor;
const passThrough = opts.passThrough || [];

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -3778,9 +3778,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.12.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.0.tgz#d26fc5894b9230de97629b39cae225b503724ce8"

pretty-format@21.3.0-beta.15:
version "21.3.0-beta.15"
Expand Down

0 comments on commit bdc5e00

Please sign in to comment.