Skip to content

Commit

Permalink
Fix quote style to satisfy ESLint (webpack#1098)
Browse files Browse the repository at this point in the history
* Fixed quotes.

* Removed "eslint-enable/disable quotes" directives and fixed some more quotes.
  • Loading branch information
lbogdan authored and shellscape committed Sep 18, 2017
1 parent bc22935 commit 3e24ac4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/Server.js
Expand Up @@ -103,14 +103,13 @@ function Server(compiler, options) {

app.get('/webpack-dev-server', (req, res) => {
res.setHeader('Content-Type', 'text/html');
/* eslint-disable quotes */
res.write('<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body>');
const outputPath = this.middleware.getFilenameFromUrl(options.publicPath || "/");
const outputPath = this.middleware.getFilenameFromUrl(options.publicPath || '/');
const filesystem = this.middleware.fileSystem;

function writeDirectory(baseUrl, basePath) {
const content = filesystem.readdirSync(basePath);
res.write("<ul>");
res.write('<ul>');
content.forEach((item) => {
const p = `${basePath}/${item}`;
if (filesystem.statSync(p).isFile()) {
Expand Down Expand Up @@ -139,9 +138,8 @@ function Server(compiler, options) {
res.write('</li>');
}
});
res.write("</ul>");
res.write('</ul>');
}
/* eslint-enable quotes */
writeDirectory(options.publicPath || '/', outputPath);
res.end('</body></html>');
});
Expand Down Expand Up @@ -624,13 +622,11 @@ Server.prototype.serveMagicHtml = function (req, res, next) {
try {
if (!this.middleware.fileSystem.statSync(this.middleware.getFilenameFromUrl(`${_path}.js`)).isFile()) { return next(); }
// Serve a page that executes the javascript
/* eslint-disable quotes */
res.write('<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body><script type="text/javascript" charset="utf-8" src="');
res.write(_path);
res.write('.js');
res.write(req._parsedUrl.search || "");
res.write(req._parsedUrl.search || '');
res.end('"></script></body></html>');
/* eslint-enable quotes */
} catch (e) {
return next();
}
Expand Down

0 comments on commit 3e24ac4

Please sign in to comment.