mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-09 16:40:10 +01:00
Enable no-empty lint
This commit is contained in:
parent
367f3dba27
commit
60ac1aa1c7
@ -66,7 +66,6 @@ module.exports = {
|
|||||||
'use-isnan': 'off',
|
'use-isnan': 'off',
|
||||||
'no-self-assign': 'off',
|
'no-self-assign': 'off',
|
||||||
'no-unsafe-negation': 'off',
|
'no-unsafe-negation': 'off',
|
||||||
'no-constant-condition': 'off',
|
'no-constant-condition': 'off'
|
||||||
'no-empty': 'off'
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,9 @@ export function formatKoboldUrl(value) {
|
|||||||
url.pathname = '/api';
|
url.pathname = '/api';
|
||||||
}
|
}
|
||||||
return url.toString();
|
return url.toString();
|
||||||
} catch { } // Just using URL as a validation check
|
} catch {
|
||||||
|
// Just using URL as a validation check
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,9 @@ function formatTextGenURL(value) {
|
|||||||
url.pathname = '/api';
|
url.pathname = '/api';
|
||||||
}
|
}
|
||||||
return url.toString();
|
return url.toString();
|
||||||
} catch { } // Just using URL as a validation check
|
} catch {
|
||||||
|
// Just using URL as a validation check
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,9 @@ if (fs.existsSync(whitelistPath)) {
|
|||||||
try {
|
try {
|
||||||
let whitelistTxt = fs.readFileSync(whitelistPath, 'utf-8');
|
let whitelistTxt = fs.readFileSync(whitelistPath, 'utf-8');
|
||||||
whitelist = whitelistTxt.split("\n").filter(ip => ip).map(ip => ip.trim());
|
whitelist = whitelistTxt.split("\n").filter(ip => ip).map(ip => ip.trim());
|
||||||
} catch (e) { }
|
} catch (e) {
|
||||||
|
// Ignore errors that may occur when reading the whitelist (e.g. permissions)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const whitelistMode = getConfigValue('whitelistMode', true);
|
const whitelistMode = getConfigValue('whitelistMode', true);
|
||||||
@ -781,7 +783,7 @@ app.post("/getchat", jsonParser, function (request, response) {
|
|||||||
const lines = data.split('\n');
|
const lines = data.split('\n');
|
||||||
|
|
||||||
// Iterate through the array of strings and parse each line as JSON
|
// Iterate through the array of strings and parse each line as JSON
|
||||||
const jsonData = lines.map((l) => { try { return JSON.parse(l); } catch (_) { } }).filter(x => x);
|
const jsonData = lines.map((l) => { try { return JSON.parse(l); } catch (_) { return; } }).filter(x => x);
|
||||||
return response.send(jsonData);
|
return response.send(jsonData);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user