chore(lint): set up .editorconfig, lint all

This commit is contained in:
Ash Monty
2022-07-23 17:24:19 +02:00
parent cfd7aa9625
commit 37256536aa
70 changed files with 10245 additions and 10233 deletions

View File

@@ -149,4 +149,4 @@ async function updateStripeDonationCache() {
module.exports = {
getTrelloCache,
getStripeDonationCache
};
};

View File

@@ -24,4 +24,4 @@ async function connect() {
module.exports = {
connect,
PNID
};
};

View File

@@ -49,4 +49,4 @@ module.exports = {
error,
warn,
info
};
};

View File

@@ -19,4 +19,4 @@ async function sendMail(options) {
module.exports = {
sendMail
};
};

View File

@@ -10,4 +10,4 @@ async function redirectMiddleware(request, response, next) {
return next();
}
module.exports = redirectMiddleware;
module.exports = redirectMiddleware;

View File

@@ -5,7 +5,7 @@ async function renderDataMiddleware(request, response, next) {
if (request.path.startsWith('/assets')) {
return next();
}
// Get user local
const reqLocale = request.locale;
const locale = util.getLocale(reqLocale.region, reqLocale.language);
@@ -40,4 +40,4 @@ async function renderDataMiddleware(request, response, next) {
}
}
module.exports = renderDataMiddleware;
module.exports = renderDataMiddleware;

View File

@@ -7,4 +7,4 @@ async function requireLoginMiddleware(request, response, next) {
return next();
}
module.exports = requireLoginMiddleware;
module.exports = requireLoginMiddleware;

View File

@@ -61,7 +61,7 @@ router.get('/', requireLoginMiddleware, async (request, response) => {
scope: ['identify', 'guilds'],
state: crypto.randomBytes(16).toString('hex'),
});
renderData.discordAuthURL = discordAuthURL;
}
@@ -396,7 +396,7 @@ router.post('/stripe/unsubscribe', requireLoginMiddleware, async (request, respo
logger.error(`Error canceling old user subscription | ${pnid.get('connections.stripe.customer_id')}, ${pid}, ${subscriptionId} | - ${error.message}`);
response.cookie('error_message', 'Error canceling subscription! Contact support if issue persists', { domain: '.pretendo.network' });
return response.redirect('/account');
}
}
@@ -421,4 +421,4 @@ router.post('/stripe/webhook', express.raw({ type: 'application/json' }), async
});
module.exports = router;
module.exports = router;

View File

@@ -23,4 +23,4 @@ const PNIDSchema = new Schema({
}
});
module.exports = PNIDSchema;
module.exports = PNIDSchema;

View File

@@ -144,7 +144,7 @@ app.engine('handlebars', handlebars({
* get the string in the user's locale. If not available, it will return it in
* the default locale.
*/
args.slice(1, -1).forEach(arg => {
userLocaleString = userLocaleString?.[arg];
});

View File

@@ -148,7 +148,7 @@ function nintendoPasswordHash(password, pid) {
Buffer.from('\x02\x65\x43\x46'),
Buffer.from(password)
]);
const hashed = crypto.createHash('sha256').update(unpacked).digest().toString('hex');
return hashed;
@@ -219,7 +219,7 @@ async function handleStripeEvent(event) {
} catch (error) {
logger.error(`Error sending email | ${customer.id}, ${customer.email} | - ${error.message}`);
}
return;
}
@@ -348,4 +348,4 @@ module.exports = {
updateDiscordConnection,
nintendoPasswordHash,
handleStripeEvent
};
};