Skip to content

Commit b174ee2

Browse files
kassenshramos
authored andcommitted
Update prettier to 1.9.1 (facebook#273)
1 parent c222035 commit b174ee2

9 files changed

+23
-44
lines changed

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"jsxBracketSameLine": true,
44
"parser": "flow",
55
"printWidth": 80,
6-
"proseWrap": false,
6+
"proseWrap": "never",
77
"singleQuote": true,
88
"trailingComma": "es5"
99
}

lib/core/Head.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ class Head extends React.Component {
6060
)}
6161
<link
6262
rel="stylesheet"
63-
href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${
64-
highlightVersion
65-
}/styles/${highlightTheme}.min.css`}
63+
href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/styles/${highlightTheme}.min.css`}
6664
/>
6765
{hasBlog && (
6866
<link

lib/publish-gh-pages.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ let remoteBranch;
5454
if (USE_SSH === 'true') {
5555
remoteBranch = `[email protected]:${ORGANIZATION_NAME}/${PROJECT_NAME}.git`;
5656
} else {
57-
remoteBranch = `https://${GIT_USER}@github.com/${ORGANIZATION_NAME}/${
58-
PROJECT_NAME
59-
}.git`;
57+
remoteBranch = `https://${GIT_USER}@github.com/${ORGANIZATION_NAME}/${PROJECT_NAME}.git`;
6058
}
6159

6260
if (IS_PULL_REQUEST) {
@@ -120,9 +118,7 @@ excludePath = `${PROJECT_NAME}-${DEPLOYMENT_BRANCH}`;
120118
// https://github.com/shelljs/shelljs/issues/79
121119
if (
122120
shell.exec(
123-
`rsync -rt --exclude=${excludePath} --exclude=.DS_Store ${fromPath} ${
124-
toPath
125-
}`
121+
`rsync -rt --exclude=${excludePath} --exclude=.DS_Store ${fromPath} ${toPath}`
126122
).code !== 0
127123
) {
128124
shell.echo(`Error: Copying build assets failed`);
@@ -137,9 +133,7 @@ shell.exec('git add --all');
137133

138134
if (
139135
shell.exec(
140-
`git commit -m "Deploy website" -m "Deploy website version based on ${
141-
currentCommit
142-
}"`
136+
`git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"`
143137
).code !== 0
144138
) {
145139
shell.echo(`Error: Committing static website failed`);

lib/rename-version.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ if (versionIndex < 0) {
7474
console.error(
7575
`${chalk.yellow(
7676
'Version ' + currentVersion + ' does not currently exist!'
77-
)}\n Version ${
78-
currentVersion
79-
} is not in the versions.json file. You can only rename existing versions.`
77+
)}\n Version ${currentVersion} is not in the versions.json file. You can only rename existing versions.`
8078
);
8179
process.exit(1);
8280
}

lib/server/versionFallback.js

+6-18
Original file line numberDiff line numberDiff line change
@@ -98,29 +98,21 @@ files.forEach(file => {
9898

9999
if (!metadata.original_id) {
100100
console.error(
101-
`No 'original_id' field found in ${
102-
file
103-
}. Perhaps you forgot to add it when importing prior versions of your docs?`
101+
`No 'original_id' field found in ${file}. Perhaps you forgot to add it when importing prior versions of your docs?`
104102
);
105103
throw new Error(
106-
`No 'original_id' field found in ${
107-
file
108-
}. Perhaps you forgot to add it when importing prior versions of your docs?`
104+
`No 'original_id' field found in ${file}. Perhaps you forgot to add it when importing prior versions of your docs?`
109105
);
110106
}
111107
if (!metadata.id) {
112108
console.error(`No 'id' field found in ${file}.`);
113109
throw new Error(`No 'id' field found in ${file}.`);
114110
} else if (metadata.id.indexOf('version-') === -1) {
115111
console.error(
116-
`The 'id' field in ${
117-
file
118-
} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
112+
`The 'id' field in ${file} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
119113
);
120114
throw new Error(
121-
`The 'id' field in ${
122-
file
123-
} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
115+
`The 'id' field in ${file} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
124116
);
125117
}
126118

@@ -141,9 +133,7 @@ files.forEach(file => {
141133
function docVersion(id, req_version) {
142134
if (!available[id]) {
143135
throw new Error(
144-
`Document with id '${
145-
id
146-
}' was requested but no document with that id could be located.`
136+
`Document with id '${id}' was requested but no document with that id could be located.`
147137
);
148138
}
149139
// iterate through versions until a version less than or equal to the requested
@@ -286,9 +276,7 @@ function sidebarVersion(req_version) {
286276
}
287277
}
288278
throw new Error(
289-
`No sidebar file available to use for version ${
290-
req_version
291-
}. Verify that 'version-${req_version}-sidebars.json' exists.`
279+
`No sidebar file available to use for version ${req_version}. Verify that 'version-${req_version}-sidebars.json' exists.`
292280
);
293281
}
294282

lib/write-translations.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ function execute() {
9292
if (!file.endsWith('-sidebars.json')) {
9393
if (file.endsWith('-sidebar.json')) {
9494
console.warn(
95-
`Skipping ${
96-
file
97-
}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`
95+
`Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`
9896
);
9997
}
10098
return;

package-lock.json

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"fs-extra": "^3.0.1",
2626
"glob": "^7.1.2",
2727
"highlight.js": "^9.12.0",
28-
"prettier": "1.8.2",
2928
"react": "^15.5.4",
3029
"react-dom": "^15.5.4",
3130
"react-dom-factories": "^1.0.1",
@@ -50,5 +49,8 @@
5049
"docusaurus-version": "./lib/version.js",
5150
"docusaurus-rename-version": "./lib/rename-version.js",
5251
"docusaurus-feed": "./lib/generate-feed.js"
52+
},
53+
"devDependencies": {
54+
"prettier": "^1.9.1"
5355
}
5456
}

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1298,9 +1298,9 @@ performance-now@^2.1.0:
12981298
version "2.1.0"
12991299
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
13001300

1301-
prettier@1.8.2:
1302-
version "1.8.2"
1303-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
1301+
prettier@^1.9.1:
1302+
version "1.9.1"
1303+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70"
13041304

13051305
private@^0.1.6, private@^0.1.7:
13061306
version "0.1.8"

0 commit comments

Comments
 (0)