Linting
This commit is contained in:
parent
3604379b0c
commit
05eaebd697
|
@ -255,7 +255,12 @@
|
|||
"prefer-spread": "error",
|
||||
"prefer-template": "off",
|
||||
"quote-props": "off",
|
||||
"quotes": "off",
|
||||
"quotes": [
|
||||
"error",
|
||||
"double", {
|
||||
"avoidEscape": true
|
||||
}
|
||||
],
|
||||
"radix": [
|
||||
"error",
|
||||
"as-needed"
|
||||
|
|
|
@ -35,8 +35,8 @@ function envTrue(name) {
|
|||
return (process.env[name] || "").toLowerCase() === "true";
|
||||
}
|
||||
|
||||
const DEV_ENABLE_SERVING_FILES = envTrue('DEV_ENABLE_SERVING_FILES');
|
||||
const DEBUG_LOG = DEV_ENABLE_SERVING_FILES || envTrue('DEBUG_LOG');
|
||||
const DEV_ENABLE_SERVING_FILES = envTrue("DEV_ENABLE_SERVING_FILES");
|
||||
const DEBUG_LOG = DEV_ENABLE_SERVING_FILES || envTrue("DEBUG_LOG");
|
||||
|
||||
if (DEV_ENABLE_SERVING_FILES) {
|
||||
console.log("DEV_ENABLE_SERVING_FILES: Serving files in the current directory. Please never do this on a production server, this is for development purposes only.");
|
||||
|
@ -111,7 +111,7 @@ var frValues = {
|
|||
var games = {};
|
||||
var dateNow = 0;
|
||||
|
||||
var saveTo = null;
|
||||
var saveTimeout = null;
|
||||
|
||||
function saveGames() {
|
||||
fs.writeFile("games.backup.json", JSON.stringify(games), function (err) {
|
||||
|
@ -120,7 +120,7 @@ function saveGames() {
|
|||
}
|
||||
});
|
||||
|
||||
saveTo = null;
|
||||
saveTimeout = null;
|
||||
}
|
||||
|
||||
function Game() {
|
||||
|
@ -302,8 +302,8 @@ Game.prototype.commit = function () {
|
|||
}
|
||||
}
|
||||
|
||||
if (saveTo === null) {
|
||||
saveTo = setTimeout(saveGames, SAVE_TIMEOUT);
|
||||
if (saveTimeout === null) {
|
||||
saveTimeout = setTimeout(saveGames, SAVE_TIMEOUT);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -698,7 +698,7 @@ function handleRequest(request, response) {
|
|||
var post = "";
|
||||
var responseAndIsES = [response, false];
|
||||
|
||||
response.on("error", function (e) {
|
||||
response.on("error", function connectionError(e) {
|
||||
console.error("An error occurred while trying to write on a socket", e);
|
||||
stopKeepAlive(responseAndIsES);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue