Change some jsdoc rule to warn instead of error

pull/3072/head
Louis Lam 9 months ago
parent d33b4f46e4
commit db3a7d69fe

@ -113,7 +113,7 @@ module.exports = {
"error",
{ "noOptionalParamNames": true }
],
"jsdoc/require-throws": "error",
"jsdoc/require-throws": "warn",
"jsdoc/require-jsdoc": [
"error",
{
@ -124,19 +124,20 @@ module.exports = {
}
],
"jsdoc/no-blank-block-descriptions": "error",
"jsdoc/require-returns-description": "warn",
"jsdoc/require-returns-check": [
"error",
{ "reportMissingReturnForUndefinedTypes": false }
],
"jsdoc/require-returns": [
"error",
"warn",
{
"forceRequireReturn": true,
"forceReturnsWithAsync": true
}
],
"jsdoc/require-param-type": "error",
"jsdoc/require-param-description": "error"
"jsdoc/require-param-type": "warn",
"jsdoc/require-param-description": "warn"
},
"overrides": [
{

@ -133,6 +133,9 @@ class Database {
log.info("db", `Data Dir: ${Database.dataDir}`);
}
/**
*
*/
static readDBConfig() {
let dbConfig;
@ -149,6 +152,9 @@ class Database {
return dbConfig;
}
/**
* @param dbConfig
*/
static writeDBConfig(dbConfig) {
fs.writeFileSync(path.join(Database.dataDir, "db-config.json"), JSON.stringify(dbConfig, null, 4));
}
@ -276,6 +282,10 @@ class Database {
}
}
/**
* @param testMode
* @param noLog
*/
static async initSQLite(testMode, noLog) {
await R.exec("PRAGMA foreign_keys = ON");
if (testMode) {
@ -301,6 +311,9 @@ class Database {
}
}
/**
*
*/
static async initMariaDB() {
log.debug("db", "Checking if MariaDB database exists...");
@ -337,7 +350,6 @@ class Database {
}
/**
*
* @returns {Promise<void>}
*/
static async rollbackLatestPatch() {
@ -628,6 +640,9 @@ class Database {
await R.exec("VACUUM");
}
/**
*
*/
static sqlHourOffset() {
if (this.dbConfig.client === "sqlite3") {
return "DATETIME('now', ? || ' hours')";

@ -24,7 +24,6 @@ class EmbeddedMariaDB {
started = false;
/**
*
* @returns {EmbeddedMariaDB}
*/
static getInstance() {
@ -34,6 +33,9 @@ class EmbeddedMariaDB {
return EmbeddedMariaDB.instance;
}
/**
*
*/
static hasInstance() {
return !!EmbeddedMariaDB.instance;
}
@ -100,6 +102,9 @@ class EmbeddedMariaDB {
});
}
/**
*
*/
stop() {
if (this.childProcess) {
this.childProcess.kill("SIGINT");
@ -107,6 +112,9 @@ class EmbeddedMariaDB {
}
}
/**
*
*/
initDB() {
if (!fs.existsSync(this.mariadbDataDir)) {
log.info("mariadb", `Embedded MariaDB: ${this.mariadbDataDir} is not found, create one now.`);
@ -137,6 +145,9 @@ class EmbeddedMariaDB {
}
/**
*
*/
async initDBAfterStarted() {
const connection = mysql.createConnection({
socketPath: this.socketPath,

@ -291,6 +291,9 @@ class Monitor extends BeanModel {
return JSON.parse(this.accepted_statuscodes_json);
}
/**
*
*/
getGameDigGivenPortOnly() {
return Boolean(this.gamedigGivenPortOnly);
}

@ -23,6 +23,10 @@ class SetupDatabase {
server;
/**
* @param args
* @param server
*/
constructor(args, server) {
this.server = server;
@ -72,10 +76,17 @@ class SetupDatabase {
return this.needSetup;
}
/**
*
*/
isEnabledEmbeddedMariaDB() {
return process.env.UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB === "1";
}
/**
* @param hostname
* @param port
*/
start(hostname, port) {
return new Promise((resolve) => {
const app = express();

@ -68,8 +68,7 @@ export default {
/**
* Calculates the amount of beats of padding needed to fill the length of shortBeatList.
*
* @return {number} The amount of beats of padding needed to fill the length of shortBeatList.
* @returns {number} The amount of beats of padding needed to fill the length of shortBeatList.
*/
numPadding() {
if (!this.beatList) {
@ -149,7 +148,7 @@ export default {
/**
* Returns the style object for positioning the time element.
* @return {Object} The style object containing the CSS properties for positioning the time element.
* @returns {object} The style object containing the CSS properties for positioning the time element.
*/
timeStyle() {
return {
@ -159,8 +158,7 @@ export default {
/**
* Calculates the time elapsed since the first valid beat.
*
* @return {string} The time elapsed in minutes or hours.
* @returns {string} The time elapsed in minutes or hours.
*/
timeSinceFirstBeat() {
const firstValidBeat = this.shortBeatList.at(this.numPadding);
@ -174,8 +172,7 @@ export default {
/**
* Calculates the elapsed time since the last valid beat was registered.
*
* @return {string} The elapsed time in a minutes, hours or "now".
* @returns {string} The elapsed time in a minutes, hours or "now".
*/
timeSinceLastBeat() {
const lastValidBeat = this.shortBeatList.at(-1);

@ -120,8 +120,7 @@ export default {
/**
* Returns a sorted list of monitors based on the applied filters and search text.
*
* @return {Array} The sorted list of monitors.
* @returns {Array} The sorted list of monitors.
*/
sortedMonitorList() {
let result = Object.values(this.$root.monitorList);
@ -222,8 +221,7 @@ export default {
/**
* Determines if any filters are active.
*
* @return {boolean} True if any filter is active, false otherwise.
* @returns {boolean} True if any filter is active, false otherwise.
*/
filtersActive() {
return this.filterState.status != null || this.filterState.active != null || this.filterState.tags != null || this.searchText !== "";

Loading…
Cancel
Save