Add ESLint (#941)

* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
This commit is contained in:
Madeline
2023-01-20 18:10:47 +11:00
committed by GitHub
parent 0c815fde91
commit 084dc0be08
157 changed files with 1905 additions and 668 deletions
+4 -4
View File
@@ -48,10 +48,10 @@ router.post(
if (req.headers.signature !== Config.get().security.requestSignature)
throw new HTTPError("Invalid request signature");
if (!req.file) throw new HTTPError("Missing file");
const { buffer, mimetype, size, originalname, fieldname } = req.file;
const { buffer, size } = req.file;
const { role_id } = req.params;
var hash = crypto
const hash = crypto
.createHash("md5")
.update(Snowflake.generate())
.digest("hex");
@@ -76,7 +76,7 @@ router.post(
);
router.get("/:role_id", async (req: Request, res: Response) => {
var { role_id } = req.params;
const { role_id } = req.params;
//role_id = role_id.split(".")[0]; // remove .file extension
const path = `role-icons/${role_id}`;
@@ -91,7 +91,7 @@ router.get("/:role_id", async (req: Request, res: Response) => {
});
router.get("/:role_id/:hash", async (req: Request, res: Response) => {
var { role_id, hash } = req.params;
const { role_id, hash } = req.params;
//hash = hash.split(".")[0]; // remove .file extension
const path = `role-icons/${role_id}/${hash}`;