优化 No unused 注解

This commit is contained in:
Suwings 2020-10-08 18:18:07 +08:00
parent a1e5dfa35d
commit f4d32c780a
9 changed files with 10 additions and 17 deletions

View File

@ -21,6 +21,7 @@ module.exports = {
"$": "writeable",
"WS": "readonly",
"hex_md5": "readonly",
"process": "readonly"
},
"parserOptions": {

View File

@ -41,6 +41,7 @@ class DataModel {
upload(that, needkey) {
let key = null;
if (needkey == undefined) {
// eslint-disable-next-line no-unused-vars
for (var mineKey in this) {
that[key] = this[key];
}

View File

@ -187,6 +187,7 @@ class ServerManager extends EventEmitter {
getServerCounter() {
let tmp = 0;
// eslint-disable-next-line no-unused-vars
for (let k in this.serverList) tmp++;
return tmp;
}

View File

@ -1,7 +1,7 @@
//用户模型
const DataModel = require("../DataModel");
const { md5, createPassword, randomString } = require("./CryptoMine");
const { createPassword } = require("./CryptoMine");
const fs = require("fs");
const uuid = require("uuid");

View File

@ -144,6 +144,7 @@ class UserCenter {
getUserCounter() {
let tmp = 0;
// eslint-disable-next-line no-unused-vars
for (let k in this.userList) tmp++;
return tmp;
}

View File

@ -4,9 +4,9 @@ var ftpdzz = require("ftpd");
var options = null;
var FTPserver = null;
var rootCwdListener = () => {
return "/";
}; //默认
// var rootCwdListener = () => {
// return "/";
// }; //默认
module.exports.initFTPdServerOptions = (_options) => {
options = _options;

View File

@ -50,6 +50,7 @@ module.exports.init = () => {
//计次型任务
function createScheduleJobCount(id, time, count, commande, servername, callback, _save = true) {
let lco = 0;
// eslint-disable-next-line no-unused-vars
let mask = (MCSERVER.Schedule.container[id] = schedule.scheduleJob(time, (fireDate) => {
if (lco >= count && count > 0) {
deleteScheduleJob(id);

View File

@ -2,14 +2,13 @@ const { WebSocketObserver } = require("../../model/WebSocketModel");
const counter = require("../../core/counter");
const tools = require("../../core/tools");
const response = require("../../helper/Response");
const serverModel = require("../../model/ServerModel");
const permssion = require("../../helper/Permission");
const userModel = require("../../model/UserModel");
const os = require("os");
const mversion = require("../../helper/version");
const MB_SIZE = 1024 * 1024;
let serverM = serverModel.ServerManager();
let userM = userModel.userCenter();
@ -23,16 +22,6 @@ counter.initData(() => {
counter.set("csrfCounter", 0);
});
// var pusage = require('pidusage');
// //CPU
// //需要刷新的CPU
// var cacheCPU = 0;
// setInterval(() => {
// pusage.stat(process.pid, function(err, stat) {
// cacheCPU = stat.cpu.toFixed(1);
// })
// }, 3000);
const osUtils = require("os-utils");
//系统CPU
var cacheCPU = 0;

View File

@ -1,7 +1,6 @@
const { WebSocketObserver } = require("../../../model/WebSocketModel");
const response = require("../../../helper/Response");
var serverModel = require("../../../model/ServerModel");
var userModel = require("../../../model/UserModel");
const permssion = require("../../../helper/Permission");
const mcPingProtocol = require("../../../helper/MCPingProtocol");