mirror of
https://github.com/luxfi/pics.git
synced 2026-07-26 21:08:58 +00:00
add eslint rules
no-template-curly-in-string (+find and fix minor bug in redirect) curly no-multiple-empty-lines
This commit is contained in:
@@ -44,6 +44,11 @@
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"curly": ["error"],
|
||||
"no-multiple-empty-lines": ["error", { "max": 1 }],
|
||||
"no-template-curly-in-string": [
|
||||
"error"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ const express = require('express')
|
||||
addStaffController, deleteStaffController, editStaffController, editCustomPageController, editPostController,
|
||||
editRoleController, newCaptchaForm, blockBypassForm, logoutForm, deleteSessionsController } = require(__dirname+'/forms/index.js');
|
||||
|
||||
|
||||
//make new post
|
||||
router.post('/board/:board/post', geoAndTor, fileMiddlewares.postsEarly, torPreBypassCheck, processIp, useSession, sessionRefresh, Boards.exists, calcPerms, banCheck, fileMiddlewares.posts,
|
||||
makePostController.paramConverter, verifyCaptcha, numFiles, blockBypass.middleware, dnsblCheck, imageHashes, makePostController.controller);
|
||||
|
||||
@@ -72,7 +72,6 @@ class syncedField {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
window.addEventListener('settingsReady', () => {
|
||||
|
||||
@@ -95,5 +95,4 @@ module.exports = {
|
||||
return (`${end[0] > 0 ? end[0]+'s' : ''}${Math.trunc(end[1]/1000000)}ms `).padStart(9) + label;
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -12,7 +12,6 @@ const updateReferers = () => {
|
||||
updateReferers();
|
||||
addCallback('config', updateReferers);
|
||||
|
||||
|
||||
module.exports = (req, res, next) => {
|
||||
if (req.method !== 'POST') {
|
||||
return next();
|
||||
|
||||
@@ -7,7 +7,9 @@ const { promisify } = require('util')
|
||||
module.exports = async (min, max) => {
|
||||
min = Math.floor(min);
|
||||
max = Math.floor(max);
|
||||
if (max <= min) return min;
|
||||
if (max <= min) {
|
||||
return min;
|
||||
}
|
||||
const mod = max - min + 1;
|
||||
const div = (((0xffffffff - (mod-1)) / mod) | 0) + 1;
|
||||
let g;
|
||||
|
||||
@@ -38,5 +38,4 @@ describe('link markdown', () => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -29,5 +29,4 @@ describe('name/trip/capcode handler', () => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -104,7 +104,6 @@ module.exports = async (req, res, next) => {
|
||||
messages.push(message);
|
||||
}
|
||||
|
||||
|
||||
if (deleting) {
|
||||
|
||||
//OP delete protection. for old OPs or with a lot of replies
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = async (req, res) => {
|
||||
return dynamicResponse(req, res, 400, 'message', {
|
||||
'title': 'Bad request',
|
||||
'error': 'Custom page does not exist',
|
||||
'redirect': req.headers.referer || '/${req.params.board}/manage/custompages.html'
|
||||
'redirect': req.headers.referer || `/${req.params.board}/manage/custompages.html`
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ module.exports = async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//increase file/reply count in thread we are moving the posts to
|
||||
const { replyposts, replyfiles } = res.locals.posts.reduce((acc, p) => {
|
||||
acc.replyposts += 1;
|
||||
|
||||
@@ -74,5 +74,4 @@ module.exports = async (req, res, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user