Add .editorconfig; reformat project

This commit is contained in:
Vendicated 2022-09-16 22:59:34 +02:00
parent 5f62d2d3ec
commit 71a60a0359
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
29 changed files with 42 additions and 28 deletions

12
.editorconfig Normal file
View file

@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

3
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": [ "EditorConfig.EditorConfig" ]
}

View file

@ -1 +0,0 @@
{}

View file

@ -9,4 +9,4 @@ import { waitFor } from "./webpack";
export let Components;
waitFor("useState", () => setTimeout(() => import("./components").then(mod => Components = mod), 0));
waitFor("useState", () => setTimeout(() => import("./components").then(mod => Components = mod), 0));

View file

@ -37,4 +37,4 @@ export default {
}
return require(mod);
}
};
};

View file

@ -82,4 +82,4 @@ export function addClickListener(listener: ClickListener) {
export function removeClickListener(listener: ClickListener) {
return listeners.delete(listener);
}
}

View file

@ -1 +1 @@
export * as MessageEvents from "./MessageEvents";
export * as MessageEvents from "./MessageEvents";

View file

@ -98,7 +98,7 @@ type ResolvePropDeep<T, P> = P extends "" ? T :
* whenever Unindent is toggled. Pass an empty string to get notified for all changes
* @param onUpdate Callback function whenever a setting matching path is updated. It gets passed the new value and the path
* to the updated setting. This path will be the same as your path argument, unless it was an empty string.
*
*
* @example addSettingsListener("", (newValue, path) => console.log(`${path} is now ${newValue}`))
* addSettingsListener("plugins.Unindent.enabled", v => console.log("Unindent is now", v ? "enabled" : "disabled"))
*/

View file

@ -68,4 +68,4 @@ export default class ErrorBoundary extends React.Component<React.PropsWithChildr
</Card>
);
}
}
}

View file

@ -115,4 +115,4 @@ export default ErrorBoundary.wrap(function Settings(props) {
}
</Forms.FormSection >
);
});
});

View file

@ -1 +1 @@
export { default as Settings } from "./Settings";
export { default as Settings } from "./Settings";

2
src/globals.d.ts vendored
View file

@ -14,4 +14,4 @@ declare global {
}
}
export { };
export { };

View file

@ -23,7 +23,7 @@ class BrowserWindow extends electron.BrowserWindow {
Object.assign(BrowserWindow, electron.BrowserWindow);
// esbuild may rename our BrowserWindow, which leads to it being excluded
// from getFocusedWindow(), so this is necessary
// https://github.com/discord/electron/blob/13-x-y/lib/browser/api/browser-window.ts#L60-L62
// https://github.com/discord/electron/blob/13-x-y/lib/browser/api/browser-window.ts#L60-L62
Object.defineProperty(BrowserWindow, "name", { value: "BrowserWindow", configurable: true });
// Replace electrons exports with our custom BrowserWindow

View file

@ -11,4 +11,4 @@ export default definePlugin({
replace: ".default=function(){}}"
}
}]
});
});

View file

@ -13,4 +13,4 @@ export default definePlugin({
}
}
],
});
});

View file

@ -56,4 +56,4 @@ export function stopPlugin(p: Plugin) {
return false;
}
}
}
}

View file

@ -41,4 +41,4 @@ export default definePlugin({
document.removeEventListener("keydown", keydown);
document.removeEventListener("keyup", keyup);
}
});
});

View file

@ -37,4 +37,4 @@ export default definePlugin({
}
}]
});
});

View file

@ -44,4 +44,4 @@ export default definePlugin({
removePreSendListener(this.preSend);
removePreEditListener(this.preEdit);
}
});
});

View file

@ -19,4 +19,4 @@ export default strEnum({
SET_SETTINGS: "VencordSetSettings",
OPEN_EXTERNAL: "VencordOpenExternal",
OPEN_PATH: "VencordOpenPath",
} as const);
} as const);

View file

@ -1,2 +1,2 @@
export const WEBPACK_CHUNK = "webpackChunkdiscord_app";
export const REACT_GLOBAL = "Vencord.Webpack.Common.React";
export const REACT_GLOBAL = "Vencord.Webpack.Common.React";

View file

@ -4,4 +4,4 @@ export function debounce<T extends Function>(func: T, delay = 300): T {
clearTimeout(timeout);
timeout = setTimeout(() => { func(...args); }, delay);
} as any;
}
}

View file

@ -30,4 +30,4 @@ export default class Logger {
public debug(...args: any[]) {
this._log("debug", "#eebebe", args);
}
}
}

View file

@ -53,7 +53,7 @@ export function LazyComponent<T = any>(factory: () => React.ComponentType<T>) {
}
/**
* Recursively merges defaults into an object and returns the same object
* Recursively merges defaults into an object and returns the same object
* @param obj Object
* @param defaults Defaults
* @returns obj

View file

@ -31,4 +31,4 @@ export function openModal(Component: React.ComponentType, modalProps: Record<str
*/
export function closeModal(key: string) {
modals.closeModal(key);
}
}

View file

@ -28,4 +28,4 @@ interface PluginDef {
patches?: Omit<Patch, "plugin">[];
dependencies?: string[],
required?: boolean;
}
}

View file

@ -33,4 +33,4 @@ waitFor(["ButtonLooks", "default"], m => {
waitFor(filters.byDisplayName("SwitchItem"), m => Switch = m.default);
waitFor(filters.byDisplayName("Flex"), m => Flex = m.default);
waitFor(filters.byDisplayName("Card"), m => Card = m.default);
waitFor(filters.byDisplayName("Tooltip"), m => Tooltip = m.default);
waitFor(filters.byDisplayName("Tooltip"), m => Tooltip = m.default);

View file

@ -1,2 +1,2 @@
export * from "./webpack";
export * as Common from "./common";
export * as Common from "./common";

View file

@ -112,7 +112,7 @@ export function search(...filters: Array<string | RegExp>) {
* Extract a specific module by id into its own Source File. This has no effect on
* the code, it is only useful to be able to look at a specific module without having
* to view a massive file. extract then returns the extracted module so you can jump to it.
* As mentioned above, note that this extracted module is not actually used,
* As mentioned above, note that this extracted module is not actually used,
* so putting breakpoints or similar will have no effect.
* @param id The id of the module to extract
*/
@ -130,4 +130,4 @@ ${mod.toString()}
`;
const extracted = (0, eval)(code);
return extracted as Function;
}
}