linting
parent
52d1e87c4e
commit
78344b4e35
|
|
@ -21,6 +21,7 @@
|
|||
],
|
||||
"rules": {
|
||||
"node/no-missing-import": "off",
|
||||
"node/no-unpublished-import": "off",
|
||||
"unicorn/consistent-function-scoping": "warn",
|
||||
"unicorn/empty-brace-spaces": "off",
|
||||
"unicorn/filename-case": [
|
||||
|
|
|
|||
8
app.js
8
app.js
|
|
@ -130,10 +130,10 @@ app.all(urlPrefix + "/keepAlive", (_request, response) => {
|
|||
app.use(urlPrefix + "/login", routerLogin);
|
||||
app.get(urlPrefix + "/logout", (request, response) => {
|
||||
if (request.session.user && request.cookies[sessionCookieName]) {
|
||||
request.session.destroy(null);
|
||||
request.session = undefined;
|
||||
response.clearCookie(sessionCookieName);
|
||||
response.redirect(urlPrefix + "/");
|
||||
request.session.destroy(() => {
|
||||
response.clearCookie(sessionCookieName);
|
||||
response.redirect(urlPrefix + "/");
|
||||
});
|
||||
}
|
||||
else {
|
||||
response.redirect(urlPrefix + "/login");
|
||||
|
|
|
|||
9
app.ts
9
app.ts
|
|
@ -233,11 +233,10 @@ app.use(urlPrefix + "/login", routerLogin);
|
|||
|
||||
app.get(urlPrefix + "/logout", (request, response) => {
|
||||
if (request.session.user && request.cookies[sessionCookieName]) {
|
||||
// eslint-disable-next-line unicorn/no-null
|
||||
request.session.destroy(null);
|
||||
request.session = undefined;
|
||||
response.clearCookie(sessionCookieName);
|
||||
response.redirect(urlPrefix + "/");
|
||||
request.session.destroy(() => {
|
||||
response.clearCookie(sessionCookieName);
|
||||
response.redirect(urlPrefix + "/");
|
||||
});
|
||||
} else {
|
||||
response.redirect(urlPrefix + "/login");
|
||||
}
|
||||
|
|
|
|||
16
bin/www.js
16
bin/www.js
|
|
@ -10,20 +10,25 @@ const onError = (error) => {
|
|||
throw error;
|
||||
}
|
||||
switch (error.code) {
|
||||
case "EACCES":
|
||||
case "EACCES": {
|
||||
debugWWW("Requires elevated privileges");
|
||||
process.exit(1);
|
||||
case "EADDRINUSE":
|
||||
}
|
||||
case "EADDRINUSE": {
|
||||
debugWWW("Port is already in use.");
|
||||
process.exit(1);
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
const onListening = (server) => {
|
||||
const addr = server.address();
|
||||
const bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port.toString();
|
||||
debugWWW("Listening on " + bind);
|
||||
if (addr) {
|
||||
const bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port.toString();
|
||||
debugWWW("Listening on " + bind);
|
||||
}
|
||||
};
|
||||
const httpPort = configFunctions.getProperty("application.httpPort");
|
||||
if (httpPort) {
|
||||
|
|
@ -39,6 +44,5 @@ exitHook(() => {
|
|||
if (httpServer) {
|
||||
debugWWW("Closing HTTP");
|
||||
httpServer.close();
|
||||
httpServer = undefined;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
21
bin/www.ts
21
bin/www.ts
|
|
@ -26,29 +26,33 @@ const onError = (error: ServerError) => {
|
|||
// handle specific listen errors with friendly messages
|
||||
switch (error.code) {
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case "EACCES":
|
||||
case "EACCES": {
|
||||
debugWWW("Requires elevated privileges");
|
||||
process.exit(1);
|
||||
// break;
|
||||
// break;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case "EADDRINUSE":
|
||||
case "EADDRINUSE": {
|
||||
debugWWW("Port is already in use.");
|
||||
process.exit(1);
|
||||
// break;
|
||||
// break;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
default:
|
||||
default: {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const onListening = (server: http.Server) => {
|
||||
const addr = server.address();
|
||||
|
||||
const bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port.toString();
|
||||
|
||||
debugWWW("Listening on " + bind);
|
||||
if (addr) {
|
||||
const bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port.toString();
|
||||
debugWWW("Listening on " + bind);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -74,6 +78,5 @@ exitHook(() => {
|
|||
if (httpServer) {
|
||||
debugWWW("Closing HTTP");
|
||||
httpServer.close();
|
||||
httpServer = undefined;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable node/no-unpublished-import */
|
||||
|
||||
import { defineConfig } from "cypress";
|
||||
|
||||
export default defineConfig({
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ router
|
|||
isAuthenticated = await authenticationFunctions.authenticate(userName, passwordPlain);
|
||||
}
|
||||
|
||||
let userObject: recordTypes.User;
|
||||
let userObject: recordTypes.User | undefined;
|
||||
|
||||
if (isAuthenticated) {
|
||||
const userNameLowerCase = userName.toLowerCase();
|
||||
|
|
|
|||
|
|
@ -4,9 +4,12 @@ export interface LOS {
|
|||
mapKey: string,
|
||||
contextualClass: "success" | "danger"
|
||||
) => void;
|
||||
|
||||
initializeDatePickers: (containerElement: HTMLElement) => void;
|
||||
initializeTimePickers: (containerElement: HTMLElement) => void;
|
||||
|
||||
initializeUnlockFieldButtons: (containerElement: HTMLElement) => void;
|
||||
|
||||
populateAliases: (containerElement: HTMLElement) => void;
|
||||
getRandomColor: (seedString: string) => string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue