Skip to content

Commit 1db939b

Browse files
yangshunJoelMarcey
authored andcommitted
Revert yarn prettier addition in yarn ci-check (facebook#543)
1 parent bc3eef1 commit 1db939b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ website/node_modules
1414
website/package-lock.json
1515
website/translated_docs
1616
website/yarn.lock
17+
18+
yarn-error.log

lib/start-server.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,21 @@ const program = require('commander');
3737

3838
program.option('--port <number>', 'Specify port number').parse(process.argv);
3939

40-
var port = process.env.PORT || 3000;
41-
var numAttempts = 0;
42-
var maxAttempts = 10;
40+
let port = process.env.PORT || 3000;
41+
let numAttempts = 0;
42+
const MAX_ATTEMPTS = 10;
4343
checkPort();
4444

4545
function checkPort() {
4646
tcpPortUsed
4747
.check(port, 'localhost')
4848
.then(function(inUse) {
49-
if (inUse && numAttempts >= maxAttempts) {
50-
console.log("Reached max attempts, exiting. Please open up some ports or increase the number of attempts and try again.")
51-
process.exit(1)
49+
if (inUse && numAttempts >= MAX_ATTEMPTS) {
50+
console.log(
51+
'Reached max attempts, exiting. Please open up some ports or ' +
52+
'increase the number of attempts and try again.'
53+
);
54+
process.exit(1);
5255
} else if (inUse) {
5356
console.error(chalk.red('Port ' + port + ' is in use'));
5457
// Try again but with port + 1

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://github.com/facebook/Docusaurus.git"
1515
},
1616
"scripts": {
17-
"ci-check": "yarn prettier && yarn prettier:diff",
17+
"ci-check": "yarn prettier:diff",
1818
"format:source": "prettier --config .prettierrc --write \"lib/**/*.js\"",
1919
"format:examples": "prettier --config .prettierrc --write \"examples/**/*.js\"",
2020
"nit:source": "prettier --config .prettierrc --list-different \"lib/**/*.js\"",

0 commit comments

Comments
 (0)