Skip to content

Commit 6e1a466

Browse files
committed
removing errant console.log, update lint rules
1 parent c7d2c9d commit 6e1a466

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/Server.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
/* eslint no-console: off, func-names: off */
3+
/* eslint func-names: off */
44
require('./polyfills');
55

66
const fs = require('fs');
@@ -24,6 +24,7 @@ const OptionsValidationError = require('./OptionsValidationError');
2424
const optionsSchema = require('./optionsSchema.json');
2525

2626
const clientStats = { errorDetails: false };
27+
const log = console.log; // eslint-disable-line no-console
2728

2829
function Server(compiler, options) {
2930
// Default options
@@ -275,8 +276,8 @@ function Server(compiler, options) {
275276
app.get('*', express.static(item));
276277
});
277278
} else if (/^(https?:)?\/\//.test(contentBase)) {
278-
console.log('Using a URL as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.');
279-
console.log('proxy: {\n\t"*": "<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
279+
log('Using a URL as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.');
280+
log('proxy: {\n\t"*": "<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
280281
// Redirect every request to contentBase
281282
app.get('*', (req, res) => {
282283
res.writeHead(302, {
@@ -285,8 +286,8 @@ function Server(compiler, options) {
285286
res.end();
286287
});
287288
} else if (typeof contentBase === 'number') {
288-
console.log('Using a number as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.');
289-
console.log('proxy: {\n\t"*": "//localhost:<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
289+
log('Using a number as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.');
290+
log('proxy: {\n\t"*": "//localhost:<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
290291
// Redirect every request to the port contentBase
291292
app.get('*', (req, res) => {
292293
res.writeHead(302, {
@@ -384,14 +385,14 @@ function Server(compiler, options) {
384385

385386
// cert is more than 30 days old, kill it with fire
386387
if ((now - certStat.ctime) / certTtl > 30) {
387-
console.log('SSL Certificate is more than 30 days old. Removing.');
388+
log('SSL Certificate is more than 30 days old. Removing.');
388389
del.sync([certPath], { force: true });
389390
certExists = false;
390391
}
391392
}
392393

393394
if (!certExists) {
394-
console.log('Generating SSL Certificate');
395+
log('Generating SSL Certificate');
395396
const attrs = [{ name: 'commonName', value: 'localhost' }];
396397
const pems = selfsigned.generate(attrs, {
397398
algorithm: 'sha256',
@@ -549,13 +550,12 @@ Server.prototype.listen = function (port, hostname, fn) {
549550
// Limit useless logs
550551
log(severity, line) {
551552
if (severity === 'error') {
552-
console.log(line);
553+
log(line);
553554
}
554555
}
555556
});
556557

557558
sockServer.on('connection', (conn) => {
558-
console.log('connection.remotePort', conn.remotePort);
559559
if (!conn) return;
560560
if (!this.checkHost(conn.headers)) {
561561
this.sockWrite([conn], 'error', 'Invalid Host header');

0 commit comments

Comments
 (0)