From c7a9dd1ec4d436c3893e2544d9b13bf46cfab2c8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 8 Nov 2022 17:34:42 +0300 Subject: Cleanup ESLint warnings --- vnext/server/index.js | 7 ++++--- vnext/server/middleware/renderer.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'vnext/server') diff --git a/vnext/server/index.js b/vnext/server/index.js index d393c4bc..95f88cd1 100644 --- a/vnext/server/index.js +++ b/vnext/server/index.js @@ -2,7 +2,8 @@ import express from 'express'; import { raw } from 'body-parser'; import cors from 'cors'; import config from 'config'; -var debug = require('debug')('http'); +import debug from 'debug'; +const log = debug('http'); // we'll talk about this in a minute: import serverRenderer from './middleware/renderer'; @@ -11,7 +12,7 @@ import oembed from './middleware/oembed'; import urlExpand from './middleware/urlexpand'; const PORT = 8081; -const path = require('path'); +import path from 'path'; // initialize the application and create the routes const app = express(); @@ -42,5 +43,5 @@ app.listen(PORT, (error) => { return console.log('something bad happened', error); } - debug('listening on ' + PORT + '...'); + log('listening on ' + PORT + '...'); }); diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js index 339c0449..debba758 100644 --- a/vnext/server/middleware/renderer.js +++ b/vnext/server/middleware/renderer.js @@ -9,8 +9,8 @@ import { getLinks } from '../sape'; import { StaticRouter } from 'react-router-dom/server'; import { VisitorProvider } from '../../src/ui/VisitorContext'; -const path = require('path'); -const fs = require('fs'); +import path from 'path'; +import fs from 'fs'; // convert a Unicode string to a string in which // each 16-bit unit occupies only one byte -- cgit v1.2.3