Added JSDoc to ESLint (#3529)

* Added JSDoc to eslint rules

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>

* Fixed JSDoc eslint errors

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>

* Update the check-linters workflow to Node.js 20

---------

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Co-authored-by: Louis Lam <louislam@users.noreply.github.com>
This commit is contained in:
Matthew Nickson 2023-08-11 09:46:41 +02:00 committed by GitHub
parent da4f4e3d76
commit 8a92054c2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
153 changed files with 1505 additions and 574 deletions

View file

@ -101,7 +101,8 @@ class Database {
/**
* Initialize the data directory
* @param {Object} args Arguments to initialize DB with
* @param {object} args Arguments to initialize DB with
* @returns {void}
*/
static initDataDir(args) {
// Data Directory (must be end with "/")
@ -154,11 +155,11 @@ class Database {
/**
* Connect to the database
* @param {boolean} [testMode=false] Should the connection be
* @param {boolean} testMode Should the connection be
* started in test mode?
* @param {boolean} [autoloadModels=true] Should models be
* @param {boolean} autoloadModels Should models be
* automatically loaded?
* @param {boolean} [noLog=false] Should logs not be output?
* @param {boolean} noLog Should logs not be output?
* @returns {Promise<void>}
*/
static async connect(testMode = false, autoloadModels = true, noLog = false) {
@ -312,6 +313,10 @@ class Database {
}
}
/**
* Patch the database
* @returns {void}
*/
static async patch() {
// Still need to keep this for old versions of Uptime Kuma
if (Database.dbConfig.type === "sqlite") {
@ -497,8 +502,8 @@ class Database {
* Patch database using new patching process
* Used it patch2() only
* @private
* @param sqlFilename
* @param databasePatchedFiles
* @param {string} sqlFilename Name of SQL file to load
* @param {object} databasePatchedFiles Patch status of database files
* @returns {Promise<void>}
*/
static async patch2Recursion(sqlFilename, databasePatchedFiles) {
@ -533,7 +538,7 @@ class Database {
/**
* Load an SQL file and execute it
* @param filename Filename of SQL file to import
* @param {string} filename Filename of SQL file to import
* @returns {Promise<void>}
*/
static async importSQLFile(filename) {
@ -567,7 +572,7 @@ class Database {
/**
* Aquire a direct connection to database
* @returns {any}
* @returns {any} Database connection
*/
static getBetterSQLite3Database() {
return R.knex.client.acquireConnection();
@ -604,7 +609,10 @@ class Database {
process.removeListener("unhandledRejection", listener);
}
/** Get the size of the database */
/**
* Get the size of the database
* @returns {number} Size of database
*/
static getSize() {
log.debug("db", "Database.getSize()");
let stats = fs.statSync(Database.sqlitePath);