Skip to content

Commit

Permalink
Remove commented code & eslint-disable-next-line...
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavik001 committed Dec 11, 2023
1 parent 23c43f5 commit 011059b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 34 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ module.exports = {
},
rules: {
"no-prototype-builtins": "off",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
semi: ["error", "always"],
"no-cond-assign": ["error", "always"],
curly: "error",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"start": "node ./server/server.js",
"test": "nightwatch tests && nightwatch tests --env jwt",
"prettier-check": "prettier . --check",
"lint": "eslint --config .eslintrc.js \"./server/*.js\" \"tests/*.js\" && prettier . --write",
"prettier": "prettier . --write",
"lint": "eslint --config .eslintrc.js \"./server/*.js\" \"tests/*.js\"",
"lint-fix": "eslint --config .eslintrc.js \"./server/*.js\" \"tests/*.js\" --fix"
},
"main": "./server/server.js",
Expand Down
1 change: 0 additions & 1 deletion server/check_output_directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async function get_error(directory) {
`user with UID ${uid} has access to them. This can be achieved by running the command: chown ${uid}:${gid} on the directory`;
} finally {
console.log(err_msg);
// return err_msg;
}
}
const fileChecks = [];
Expand Down
1 change: 0 additions & 1 deletion server/jwtBoardnameAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function checkBoardnameInToken(url, boardNameIn) {
}

function parse_role(role) {
// eslint-disable-next-line no-unused-vars
let [_, role_name, board_name] = role.match(/^([^:]*):?(.*)$/);
return { role_name, board_name };
}
Expand Down
1 change: 0 additions & 1 deletion server/jwtauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

const config = require("./configuration.js");
// const jsonwebtoken = require("jsonwebtoken");
const { roleInBoard } = require("./jwtBoardnameAuth");
/**
* Validates jwt and returns whether user is a moderator
Expand Down
2 changes: 1 addition & 1 deletion server/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function parse_statsd_url(url) {
if (!match) {
throw new Error("Invalid statsd connection string, doesn't match " + regex);
}
// eslint-disable-next-line no-unused-vars

const [_, protocol, host, port_str] = match;
const tcp = protocol === "tcp";
const port = parseInt(port_str);
Expand Down
3 changes: 1 addition & 2 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ function handleRequest(request, response) {
"board-" + boardName + ".json",
);
jwtBoardName.checkBoardnameInToken(parsedUrl, boardName);
// eslint-disable-next-line no-useless-escape
if (parts.length > 2 && /^[0-9A-Za-z.\-]+$/.test(parts[2])) {
if (parts.length > 2 && /^[0-9A-Za-z.-]+$/.test(parts[2])) {
history_file += "." + parts[2] + ".bak";
}
log("download", { file: history_file });
Expand Down
9 changes: 0 additions & 9 deletions server/sockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,6 @@ async function saveHistory(boardName, message) {
board.processMessage(message);
}

// This is function is declared in board.js file and it is not used here
// function generateUID(prefix, suffix) {
// var uid = Date.now().toString(36); //Create the uids in chronological order
// uid += Math.round(Math.random() * 36).toString(36); //Add a random character at the end
// if (prefix) uid = prefix + uid;
// if (suffix) uid = uid + suffix;
// return uid;
// }

if (exports) {
exports.start = startIO;
}
32 changes: 15 additions & 17 deletions tests/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,21 @@ function testCircle(browser) {
}

function testCursor(browser) {
return (
browser
// eslint-disable-next-line no-unused-vars
.execute(function (done) {
Tools.setColor("#456123"); // Move the cursor over the board
var e = new Event("mousemove");
e.pageX = 150;
e.pageY = 200;
Tools.board.dispatchEvent(e);
})
.assert.cssProperty(
"#cursor-me",
"transform",
"matrix(1, 0, 0, 1, 150, 200)",
)
.assert.attributeEquals("#cursor-me", "fill", "#456123")
);
return browser
.execute(function (done) {
Tools.setColor("#456123"); // Move the cursor over the board
var e = new Event("mousemove");
e.pageX = 150;
e.pageY = 200;
Tools.board.dispatchEvent(e);
done();
})
.assert.cssProperty(
"#cursor-me",
"transform",
"matrix(1, 0, 0, 1, 150, 200)",
)
.assert.attributeEquals("#cursor-me", "fill", "#456123");
}

function testBoard(browser) {
Expand Down

0 comments on commit 011059b

Please sign in to comment.