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