Lint and audit

This commit is contained in:
Zack Rauen 2022-01-28 14:39:17 -05:00
parent f078e3b2dc
commit f5f1220ecc
14 changed files with 71 additions and 106 deletions

View File

@ -5,6 +5,8 @@
"rules": { "rules": {
"indentation": [4, {"except": ["value"], "severity": "warning"}], "indentation": [4, {"except": ["value"], "severity": "warning"}],
"selector-type-case": ["lower", {"ignoreTypes": ["foreignObject"]}], "selector-type-case": ["lower", {"ignoreTypes": ["foreignObject"]}],
"color-hex-length": "long",
"color-hex-case": "upper",
"no-missing-end-of-source-newline": null "no-missing-end-of-source-newline": null
} }
} }

View File

@ -5373,9 +5373,9 @@
"dev": true "dev": true
}, },
"nanoid": { "nanoid": {
"version": "3.1.23", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
"dev": true "dev": true
}, },
"nanomatch": { "nanomatch": {

View File

@ -3,7 +3,7 @@ import DOMManager from "./dommanager";
export default new class Editor { export default new class Editor {
async initialize() { async initialize() {
const baseUrl = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min" const baseUrl = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min";
Object.defineProperty(window, "MonacoEnvironment", { Object.defineProperty(window, "MonacoEnvironment", {
value: { value: {

View File

@ -177,44 +177,6 @@ BdApi.deleteData = function(pluginName, key) {
}; };
// Patches other functions // Patches other functions
// BdApi.monkeyPatch = function(what, methodName, options) {
// const {before, after, instead, once = false, silent = false, force = false} = options;
// const displayName = options.displayName || what.displayName || what.name || what.constructor.displayName || what.constructor.name;
// if (!silent) console.log("patch", methodName, "of", displayName); // eslint-disable-line no-console
// if (!what[methodName]) {
// if (force) what[methodName] = function() {};
// else return console.error(methodName, "does not exist for", displayName); // eslint-disable-line no-console
// }
// const origMethod = what[methodName];
// const cancel = () => {
// if (!silent) console.log("unpatch", methodName, "of", displayName); // eslint-disable-line no-console
// what[methodName] = origMethod;
// };
// what[methodName] = function() {
// const data = {
// thisObject: this,
// methodArguments: arguments,
// cancelPatch: cancel,
// originalMethod: origMethod,
// callOriginalMethod: () => data.returnValue = data.originalMethod.apply(data.thisObject, data.methodArguments)
// };
// if (instead) {
// const tempRet = Utilities.suppressErrors(instead, "`instead` callback of " + what[methodName].displayName)(data);
// if (tempRet !== undefined) data.returnValue = tempRet;
// }
// else {
// if (before) Utilities.suppressErrors(before, "`before` callback of " + what[methodName].displayName)(data);
// data.callOriginalMethod();
// if (after) Utilities.suppressErrors(after, "`after` callback of " + what[methodName].displayName)(data);
// }
// if (once) cancel();
// return data.returnValue;
// };
// what[methodName].__monkeyPatched = true;
// if (!what[methodName].__originalMethod) what[methodName].__originalMethod = origMethod;
// what[methodName].displayName = "patched " + (what[methodName].displayName || methodName);
// return cancel;
// };
BdApi.monkeyPatch = function(what, methodName, options) { BdApi.monkeyPatch = function(what, methodName, options) {
const {before, after, instead, once = false, callerId = "BdApi"} = options; const {before, after, instead, once = false, callerId = "BdApi"} = options;
const patchType = before ? "before" : after ? "after" : instead ? "instead" : ""; const patchType = before ? "before" : after ? "after" : instead ? "instead" : "";
@ -234,7 +196,7 @@ BdApi.monkeyPatch = function(what, methodName, options) {
return patchReturn; return patchReturn;
} }
catch (err) { catch (err) {
Logger.err(`${callerId}:monkeyPatch`, `Error in the ${patchType} of ${methodName}`); Logger.stacktrace(`${callerId}:monkeyPatch`, `Error in the ${patchType} of ${methodName}`, err);
} }
}); });
return data.cancelPatch; return data.cancelPatch;

View File

@ -250,12 +250,13 @@ export default class WebpackModules {
static get require() { static get require() {
if (this._require) return this._require; if (this._require) return this._require;
const id = "bd-webpackmodules"; const id = "bd-webpackmodules";
let __webpack_require__ = undefined; let __webpack_require__;
if (typeof (webpackJsonp) !== "undefined") { if (typeof(webpackJsonp) !== "undefined") {
__webpack_require__ = window.webpackJsonp.push([[], { __webpack_require__ = window.webpackJsonp.push([[], {
[id]: (module, exports, __internal_require__) => module.exports = __internal_require__ [id]: (module, exports, __internal_require__) => module.exports = __internal_require__
}, [[id]]]); }, [[id]]]);
} else if (typeof (window[this.chunkName]) !== "undefined") { }
else if (typeof(window[this.chunkName]) !== "undefined") {
window[this.chunkName].push([[id], window[this.chunkName].push([[id],
{}, {},
__internal_require__ => __webpack_require__ = __internal_require__ __internal_require__ => __webpack_require__ = __internal_require__

View File

@ -29,8 +29,8 @@
} }
#bd-pub-button:hover { #bd-pub-button:hover {
color: #fff; color: #FFFFFF;
background-color: #3e82e5; background-color: #3E82E5;
} }
#bd-connection { #bd-connection {
@ -38,7 +38,7 @@
} }
.bd-footnote { .bd-footnote {
color: #b9bbbe; color: #B9BBBE;
font-size: 11px; font-size: 11px;
} }
@ -204,7 +204,7 @@
} }
.bd-server-count-dot { .bd-server-count-dot {
background-color: #43b581; background-color: #43B581;
border-radius: 50%; border-radius: 50%;
width: 8px; width: 8px;
height: 8px; height: 8px;
@ -213,7 +213,7 @@
} }
.bd-server-count + .bd-server-count .bd-server-count-dot { .bd-server-count + .bd-server-count .bd-server-count-dot {
background-color: #b9bbbe; background-color: #B9BBBE;
} }
.bd-server-count-text { .bd-server-count-text {
@ -235,8 +235,8 @@
padding: 0 4px; padding: 0 4px;
margin-top: 1px; margin-top: 1px;
border-radius: 3px; border-radius: 3px;
background: #3e82e5; background: #3E82E5;
color: #fff; color: #FFFFFF;
} }
.bd-pagination { .bd-pagination {

View File

@ -2,27 +2,27 @@
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: #3e82e5; background-color: #3E82E5;
color: #fff; color: #FFFFFF;
border-radius: 3px; border-radius: 3px;
padding: 4px 8px; padding: 4px 8px;
transition: background-color 0.17s ease, color 0.17s ease, opacity 250ms ease; transition: background-color 0.17s ease, color 0.17s ease, opacity 250ms ease;
} }
.bd-button:hover { .bd-button:hover {
background-color: #3875ce; background-color: #3875CE;
} }
.bd-button:active { .bd-button:active {
background-color: #3268b7; background-color: #3268B7;
} }
.bd-button.bd-button-success { .bd-button.bd-button-success {
background-color: #43b581; background-color: #43B581;
} }
.bd-button.bd-button-success:hover { .bd-button.bd-button-success:hover {
background-color: #3ca374; background-color: #3CA374;
} }
.bd-button.bd-button-success:active { .bd-button.bd-button-success:active {
@ -30,27 +30,27 @@
} }
.bd-button.bd-button-warning { .bd-button.bd-button-warning {
background-color: #faa61a; background-color: #FAA61A;
} }
.bd-button.bd-button-warning:hover { .bd-button.bd-button-warning:hover {
background-color: #e19517; background-color: #E19517;
} }
.bd-button.bd-button-warning:active { .bd-button.bd-button-warning:active {
background-color: #c88515; background-color: #C88515;
} }
.bd-button.bd-button-danger { .bd-button.bd-button-danger {
background-color: #f04747; background-color: #F04747;
} }
.bd-button.bd-button-danger:hover { .bd-button.bd-button-danger:hover {
background-color: #d84040; background-color: #D84040;
} }
.bd-button.bd-button-danger:active { .bd-button.bd-button-danger:active {
background-color: #c03939; background-color: #C03939;
} }
.bd-button-disabled { .bd-button-disabled {

View File

@ -6,7 +6,7 @@
.bd-cube1, .bd-cube1,
.bd-cube2 { .bd-cube2 {
background-color: #3e82e5; background-color: #3E82E5;
width: 10px; width: 10px;
height: 10px; height: 10px;
position: absolute; position: absolute;

View File

@ -1,11 +1,11 @@
.bd-reload { .bd-reload {
cursor: pointer; cursor: pointer;
vertical-align: top; vertical-align: top;
fill: #dcddde; fill: #DCDDDE;
} }
.bd-reload:hover { .bd-reload:hover {
fill: #fff; fill: #FFFFFF;
} }
.bd-reload-header { .bd-reload-header {
@ -156,7 +156,7 @@
} }
.bd-controls > .bd-addon-button svg { .bd-controls > .bd-addon-button svg {
fill: #fff; fill: #FFFFFF;
} }
.bd-controls > .bd-addon-button:first-of-type { .bd-controls > .bd-addon-button:first-of-type {
@ -214,7 +214,7 @@
} }
.bd-addon-modal-footer .bd-button { .bd-addon-modal-footer .bd-button {
background-color: #3e82e5; background-color: #3E82E5;
} }
.bd-addon-modal-footer .bd-button:hover { .bd-addon-modal-footer .bd-button:hover {
@ -240,7 +240,7 @@
} }
.bd-addon-views .bd-view-button.selected svg { .bd-addon-views .bd-view-button.selected svg {
fill: #fff; fill: #FFFFFF;
} }
.bd-addon-views .bd-view-button:hover { .bd-addon-views .bd-view-button:hover {
@ -252,7 +252,7 @@
} }
.bd-addon-views .bd-view-button.selected { .bd-addon-views .bd-view-button.selected {
background-color: #3e82e5; background-color: #3E82E5;
} }
.bd-addon-views .bd-view-button + .bd-view-button { .bd-addon-views .bd-view-button + .bd-view-button {

View File

@ -1,9 +1,9 @@
.theme-dark .bd-social-logo path { .theme-dark .bd-social-logo path {
fill: #adadad; fill: #ADADAD;
} }
.theme-light .bd-social-logo path { .theme-light .bd-social-logo path {
fill: #b9bbbe; fill: #B9BBBE;
} }
.bd-social-link:hover .bd-social-logo { .bd-social-link:hover .bd-social-logo {
@ -11,7 +11,7 @@
} }
.bd-social-link:hover .bd-social-logo path:first-of-type { .bd-social-link:hover .bd-social-logo path:first-of-type {
fill: #3e82e5; fill: #3E82E5;
} }
.bd-button-title { .bd-button-title {
@ -160,6 +160,19 @@
overflow: visible; overflow: visible;
} }
.bd-settings-title {
color: #FFFFFF;
font-weight: 600;
cursor: default;
flex: 1;
}
.bd-settings-title:not(.bd-settings-group-title) {
margin-bottom: 20px;
font-size: 20px;
line-height: 24px;
}
.bd-settings-group.collapsible .bd-settings-title { .bd-settings-group.collapsible .bd-settings-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -204,19 +217,6 @@
margin-top: 0; margin-top: 0;
} }
.bd-settings-title {
color: #ffffff;
font-weight: 600;
cursor: default;
flex: 1;
}
.bd-settings-title:not(.bd-settings-group-title) {
margin-bottom: 20px;
font-size: 20px;
line-height: 24px;
}
.bd-settings-title.bd-settings-group-title { .bd-settings-title.bd-settings-group-title {
margin-bottom: 10px; margin-bottom: 10px;
text-transform: uppercase; text-transform: uppercase;

View File

@ -38,7 +38,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
color: #fff; color: #FFFFFF;
background: var(--background-tertiary); /* #2F3129background-color: #202225; */ background: var(--background-tertiary); /* #2F3129background-color: #202225; */
} }
@ -46,7 +46,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: var(--background-secondary); background: var(--background-secondary);
color: #fff; color: #FFFFFF;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
} }
@ -88,8 +88,8 @@
} }
.floating-window-buttons .close-button:hover { .floating-window-buttons .close-button:hover {
background: #f04747; background: #F04747;
color: #fff; color: #FFFFFF;
} }
.floating-window-content #bd-editor-panel { .floating-window-content #bd-editor-panel {

View File

@ -1,5 +1,5 @@
.bd-notice-success { .bd-notice-success {
--color: #3ba55d; --color: #3BA55D;
} }
.bd-notice-error { .bd-notice-error {
@ -40,7 +40,7 @@
flex-shrink: 0; flex-shrink: 0;
flex-grow: 0; flex-grow: 0;
box-shadow: var(--elevation-low); box-shadow: var(--elevation-low);
color: #fff; color: #FFFFFF;
background: var(--color, var(--brand-experiment-600, #3C45A5)); background: var(--color, var(--brand-experiment-600, #3C45A5));
} }
@ -57,8 +57,8 @@
background: url(https://discord.com/assets/7731c77d99babca1a8faec204d98c380.svg) no-repeat; background: url(https://discord.com/assets/7731c77d99babca1a8faec204d98c380.svg) no-repeat;
background-position: 50% 55%; background-position: 50% 55%;
background-size: 10px 10px; background-size: 10px 10px;
opacity: .5; opacity: 0.5;
transition: opacity .2s; transition: opacity 0.2s;
cursor: pointer; cursor: pointer;
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
@ -69,7 +69,7 @@
position: relative; position: relative;
top: 6px; top: 6px;
border: 1px solid; border: 1px solid;
color: #fff; color: #FFFFFF;
border-radius: 3px; border-radius: 3px;
height: 24px; height: 24px;
padding: 0 10px; padding: 0 10px;
@ -78,15 +78,15 @@
vertical-align: top; vertical-align: top;
margin-left: 10px; margin-left: 10px;
line-height: 22px; line-height: 22px;
transition: background-color .2s ease,color .2s ease,border-color .2s ease; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
border-color: #fff; border-color: #FFFFFF;
background: transparent; background: transparent;
} }
.bd-notice-button:hover { .bd-notice-button:hover {
color: var(--color, var(--background-mobile-primary)); color: var(--color, var(--background-mobile-primary));
background: #fff; background: #FFFFFF;
} }
.bd-notice-close:hover { .bd-notice-close:hover {

View File

@ -45,7 +45,7 @@
.bd-toast.toast-error, .bd-toast.toast-error,
.bd-toast.toast-warning, .bd-toast.toast-warning,
.bd-toast.toast-warn { .bd-toast.toast-warn {
color: #fff; color: #FFFFFF;
} }
.bd-toast.closing { .bd-toast.closing {
@ -63,7 +63,7 @@
} }
.bd-toast.toast-info { .bd-toast.toast-info {
background-color: #4a90e2; background-color: #4A90E2;
} }
.bd-toast.toast-info.icon { .bd-toast.toast-info.icon {
@ -71,7 +71,7 @@
} }
.bd-toast.toast-success { .bd-toast.toast-success {
background-color: #43b581; background-color: #43B581;
} }
.bd-toast.toast-success.icon { .bd-toast.toast-success.icon {
@ -80,7 +80,7 @@
.bd-toast.toast-danger, .bd-toast.toast-danger,
.bd-toast.toast-error { .bd-toast.toast-error {
background-color: #f04747; background-color: #F04747;
} }
.bd-toast.toast-danger.icon, .bd-toast.toast-danger.icon,
@ -90,7 +90,7 @@
.bd-toast.toast-warning, .bd-toast.toast-warning,
.bd-toast.toast-warn { .bd-toast.toast-warn {
background-color: #ffa600; background-color: #FFA600;
} }
.bd-toast.toast-warning.icon, .bd-toast.toast-warning.icon,

View File

@ -23,7 +23,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #3e82e5; background: #3E82E5;
padding: 20px; padding: 20px;
border-radius: 20px; border-radius: 20px;
} }