Skip to content

Commit

Permalink
prettierx: add & update a few more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brodybits committed Aug 10, 2020
1 parent 007ad9e commit 601d1e3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/common-options.js
Expand Up @@ -12,6 +12,7 @@ module.exports = {
description: "Print spaces between brackets.",
oppositeDescription: "Do not print spaces between brackets.",
},
// [prettierx]
parenSpacing: {
since: "0.0.0",
category: CATEGORY_COMMON,
Expand Down
3 changes: 1 addition & 2 deletions src/document/doc-builders.js
Expand Up @@ -83,10 +83,9 @@ function group(contents, opts) {
return {
type: "group",
id: opts.id,
// [prettierx merge ...]
contents,
break: !!opts.shouldBreak,
// [prettierx merge from prettier@2.0.5 / support --paren-spacing]
// [prettierx] --paren-spacing option support (...)
addedLine: !!opts.addedLine,
expandedStates: opts.expandedStates,
};
Expand Down
1 change: 1 addition & 0 deletions src/document/doc-debug.js
Expand Up @@ -104,6 +104,7 @@ function printDoc(doc) {

return (
(doc.break ? "wrappedGroup" : "group") +
// [prettierx] --paren-spacing option (...)
(doc.addedLine ? "WithTrailingLine" : "") +
"(" +
printDoc(doc.contents) +
Expand Down
1 change: 1 addition & 0 deletions src/language-js/embed.js
Expand Up @@ -265,6 +265,7 @@ function transformCssDoc(quasisDoc, path, print, options) {
// and replace them with the expression docs one by one
// returns a new doc with all the placeholders replaced,
// or null if it couldn't replace any expression
// [prettierx] with --paren-spacing option support (...)
function replacePlaceholders(quasisDoc, expressionDocs, options) {
if (!expressionDocs || !expressionDocs.length) {
return quasisDoc;
Expand Down
2 changes: 2 additions & 0 deletions src/language-js/options.js
Expand Up @@ -27,6 +27,7 @@ module.exports = {
],
},
bracketSpacing: commonOptions.bracketSpacing,
// [prettierx ...]
indentChains: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
Expand Down Expand Up @@ -69,6 +70,7 @@ module.exports = {
oppositeDescription:
"Do not print semicolons, except at the beginning of lines which may need them.",
},
// [prettierx ...]
alignObjectProperties: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
Expand Down
1 change: 1 addition & 0 deletions src/main/comments.js
Expand Up @@ -450,6 +450,7 @@ function printTrailingComment(commentPath, print, options) {
concat([hardline, isLineBeforeEmpty ? hardline : "", contents])
);
} else if (
// [prettierx]: --break-before-else option (...)
options.breakBeforeElse &&
parentParentNode.type === "IfStatement" &&
parentParentNode.alternate
Expand Down

0 comments on commit 601d1e3

Please sign in to comment.