mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 13:38:33 +02:00
ESLintify Part 1 (#837)
* ESLint-ify * Allow empty try/catch * Escape regexp
This commit is contained in:
parent
128dbfca0a
commit
e8e3f42685
44 changed files with 466 additions and 555 deletions
|
@ -18,13 +18,12 @@ require('babel-register')({
|
|||
presets: ['react', 'env'],
|
||||
});
|
||||
|
||||
// For verifying port usage
|
||||
const tcpPortUsed = require('tcp-port-used');
|
||||
|
||||
// initial check that required files are present
|
||||
const chalk = require('chalk');
|
||||
const fs = require('fs');
|
||||
const program = require('commander');
|
||||
const openBrowser = require('react-dev-utils/openBrowser');
|
||||
const tcpPortUsed = require('tcp-port-used');
|
||||
|
||||
const CWD = process.cwd();
|
||||
const env = require('./server/env.js');
|
||||
|
||||
|
@ -40,8 +39,6 @@ if (env.versioning.enabled && env.versioning.missingVersionsPage) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
const program = require('commander');
|
||||
|
||||
program
|
||||
.option('--port <number>', 'Specify port number')
|
||||
.option('--no-watch', 'Toggle live reload file watching')
|
||||
|
@ -50,7 +47,6 @@ program
|
|||
let port = parseInt(program.port, 10) || process.env.PORT || 3000;
|
||||
let numAttempts = 0;
|
||||
const MAX_ATTEMPTS = 10;
|
||||
checkPort();
|
||||
|
||||
function checkPort() {
|
||||
tcpPortUsed
|
||||
|
@ -84,3 +80,5 @@ function checkPort() {
|
|||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
checkPort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue