aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-08-21 10:57:53 -0400
committerbobzel <zzzman@gmail.com>2024-08-21 10:57:53 -0400
commit166d40bd856b85bd4bbde9f9ffe2c1ec0fb648d5 (patch)
treef6cfa4c2bd5c5a865d82c7e3806100f4a7719450 /src
parent27c4292e709e6bbba449e940d61d54b157092296 (diff)
more lint fixes after update
Diffstat (limited to 'src')
-rw-r--r--src/ClientUtils.ts1
-rw-r--r--src/ServerUtils.ts1
-rw-r--r--src/client/Network.ts2
-rw-r--r--src/client/documents/DocUtils.ts3
-rw-r--r--src/client/documents/Documents.ts4
-rw-r--r--src/client/util/DictationManager.ts4
-rw-r--r--src/client/util/DragManager.ts1
-rw-r--r--src/client/util/History.ts1
-rw-r--r--src/client/util/InteractionUtils.tsx1
-rw-r--r--src/client/util/ScriptingGlobals.ts2
-rw-r--r--src/client/util/SearchUtil.ts1
-rw-r--r--src/client/util/SerializationHelper.ts1
-rw-r--r--src/client/util/UndoManager.ts1
-rw-r--r--src/client/views/DocViewUtils.ts1
-rw-r--r--src/pen-gestures/GestureUtils.ts1
-rw-r--r--src/server/DashStats.ts2
-rw-r--r--src/server/DashUploadUtils.ts1
-rw-r--r--src/server/Message.ts1
-rw-r--r--src/server/Search.ts1
-rw-r--r--src/server/SharedMediaTypes.ts2
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts2
-rw-r--r--src/server/server_Initialization.ts9
-rw-r--r--src/server/websocket.ts1
23 files changed, 15 insertions, 29 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index fc048b155..55801df81 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -82,7 +82,6 @@ export function returnEmptyFilter() {
return [] as string[];
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace ClientUtils {
export const CLICK_TIME = 300;
export const DRAG_THRESHOLD = 4;
diff --git a/src/ServerUtils.ts b/src/ServerUtils.ts
index 8b2d0b9f6..715341ab3 100644
--- a/src/ServerUtils.ts
+++ b/src/ServerUtils.ts
@@ -2,7 +2,6 @@ import { Socket } from 'socket.io';
import { Message } from './server/Message';
import { Utils } from './Utils';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace ServerUtils {
export function Emit<T>(socket: Socket, message: Message<T>, args: T) {
Utils.log('Emit', message.Name, args, false);
diff --git a/src/client/Network.ts b/src/client/Network.ts
index 8876d8190..6c60c4151 100644
--- a/src/client/Network.ts
+++ b/src/client/Network.ts
@@ -8,7 +8,7 @@ import { Upload } from '../server/SharedMediaTypes';
* mainly provides methods that the client can use to begin the process of
* interacting with the server, such as fetching or uploading files.
*/
-// eslint-disable-next-line @typescript-eslint/no-namespace
+
export namespace Networking {
export async function FetchFromServer(relativeRoute: string) {
return (await fetch(relativeRoute)).text();
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts
index a503d732b..5ee7d0f9c 100644
--- a/src/client/documents/DocUtils.ts
+++ b/src/client/documents/DocUtils.ts
@@ -40,7 +40,6 @@ const { DFLT_IMAGE_NATIVE_DIM } = require('../views/global/globalCssVariables.mo
const defaultNativeImageDim = Number(DFLT_IMAGE_NATIVE_DIM.replace('px', ''));
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DocUtils {
function matchFieldValue(doc: Doc, key: string, valueIn: unknown): boolean {
let value = valueIn;
@@ -467,7 +466,7 @@ export namespace DocUtils {
.concat(userTypes)
.concat(clickFuncs)
.map(btnDoc => (btnDoc.dragFactory as Doc) || btnDoc)
- .filter(doc => doc.isTemplateDoc);
+ .filter(d => d.isTemplateDoc);
// bcz: this is hacky -- want to have different templates be applied depending on the "type" of a document. but type is not reliable and there could be other types of template searches so this should be generalized
// first try to find a template that matches the specific document type (<typeName>_<templateName>). otherwise, fallback to a general match on <templateName>
!docLayoutTemplate &&
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index b108b73db..41c6ce39b 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -487,9 +487,7 @@ export class DocumentOptions {
export const DocOptions = new DocumentOptions();
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Docs {
- // eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Prototypes {
type LayoutSource = { LayoutString: (key: string) => string };
type PrototypeTemplate = {
@@ -647,7 +645,7 @@ export namespace Docs {
* Encapsulates the factory used to create new document instances
* delegated from top-level prototypes
*/
- // eslint-disable-next-line @typescript-eslint/no-namespace
+
export namespace Create {
/**
* This function receives the relevant document prototype and uses
diff --git a/src/client/util/DictationManager.ts b/src/client/util/DictationManager.ts
index 16a0df120..a0e1413b6 100644
--- a/src/client/util/DictationManager.ts
+++ b/src/client/util/DictationManager.ts
@@ -32,14 +32,12 @@ import { UndoManager } from './UndoManager';
* to add new commands as classes or components are constructed.
*/
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DictationManager {
/**
* Some type maneuvering to access Webkit's built-in
* speech recognizer.
*/
- // eslint-disable-next-line @typescript-eslint/no-namespace
namespace CORE {
export interface IWindow extends Window {
webkitSpeechRecognition: { new (): SpeechRecognition };
@@ -48,7 +46,6 @@ export namespace DictationManager {
const { webkitSpeechRecognition }: CORE.IWindow = window as unknown as CORE.IWindow;
export const placeholder = 'Listening...';
- // eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Controls {
export const Infringed = 'unable to process: dictation manager still involved in previous session';
const browser = (() => {
@@ -230,7 +227,6 @@ export namespace DictationManager {
};
}
- // eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Commands {
export const dictationFadeDuration = 2000;
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index c237a75de..7db13689d 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -70,7 +70,6 @@ export function SetupDrag(_reference: React.RefObject<HTMLElement>, docFunc: ()
return onItemDown;
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DragManager {
export const dragClassName = 'collectionFreeFormDocumentView-container';
let dragDiv: HTMLDivElement;
diff --git a/src/client/util/History.ts b/src/client/util/History.ts
index 067c28c6b..0d0c056a4 100644
--- a/src/client/util/History.ts
+++ b/src/client/util/History.ts
@@ -10,7 +10,6 @@ import { OmitKeys, ClientUtils } from '../../ClientUtils';
import { DocServer } from '../DocServer';
import { DashboardView } from '../views/DashboardView';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace HistoryUtil {
export interface DocInitializerList {
[key: string]: string | number;
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx
index f3ede596d..4231c2ca8 100644
--- a/src/client/util/InteractionUtils.tsx
+++ b/src/client/util/InteractionUtils.tsx
@@ -4,7 +4,6 @@ import { Utils } from '../../Utils';
import { Gestures } from '../../pen-gestures/GestureTypes';
import './InteractionUtils.scss';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace InteractionUtils {
export const MOUSETYPE = 'mouse';
export const TOUCHTYPE = 'touch';
diff --git a/src/client/util/ScriptingGlobals.ts b/src/client/util/ScriptingGlobals.ts
index 4a1a70633..444e8fc0a 100644
--- a/src/client/util/ScriptingGlobals.ts
+++ b/src/client/util/ScriptingGlobals.ts
@@ -6,7 +6,7 @@ const _scriptingGlobals: { [name: string]: unknown } = {};
const _scriptingDescriptions: { [name: string]: string } = {};
const _scriptingParams: { [name: string]: string } = {};
export let scriptingGlobals: { [name: string]: unknown } = _scriptingGlobals;
-// eslint-disable-next-line @typescript-eslint/no-namespace
+
export namespace ScriptingGlobals {
export function getGlobals() { return Object.keys(_scriptingGlobals); } // prettier-ignore
export function getGlobalObj() { return _scriptingGlobals; } // prettier-ignore
diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts
index 6cad7060b..733eae5f4 100644
--- a/src/client/util/SearchUtil.ts
+++ b/src/client/util/SearchUtil.ts
@@ -5,7 +5,6 @@ import { StrCast } from '../../fields/Types';
import { DocumentType } from '../documents/DocumentTypes';
import { DocOptions, FInfo } from '../documents/Documents';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace SearchUtil {
export type HighlightingResult = { [id: string]: { [key: string]: string[] } };
diff --git a/src/client/util/SerializationHelper.ts b/src/client/util/SerializationHelper.ts
index 0386b2455..ccb02fb79 100644
--- a/src/client/util/SerializationHelper.ts
+++ b/src/client/util/SerializationHelper.ts
@@ -12,7 +12,6 @@ export function afterDocDeserialize(cb: (err: unknown, val: unknown) => void, er
const serializationTypes: { [name: string]: { ctor: { new (): unknown }; afterDeserialize?: (obj: unknown) => void | Promise<unknown> } } = {};
const reverseMap: { [ctor: string]: string } = {};
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace SerializationHelper {
export function IsSerializing() {
return serializing > 0;
diff --git a/src/client/util/UndoManager.ts b/src/client/util/UndoManager.ts
index 5fd935370..ce0e7768b 100644
--- a/src/client/util/UndoManager.ts
+++ b/src/client/util/UndoManager.ts
@@ -83,7 +83,6 @@ export function undoBatch(target: any, key?: string | symbol, descriptor?: Typed
return descriptor;
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace UndoManager {
export interface UndoEvent {
undo: () => void;
diff --git a/src/client/views/DocViewUtils.ts b/src/client/views/DocViewUtils.ts
index 49a30aa08..1f5f29c7e 100644
--- a/src/client/views/DocViewUtils.ts
+++ b/src/client/views/DocViewUtils.ts
@@ -6,7 +6,6 @@ import { Doc, SetActiveAudioLinker } from '../../fields/Doc';
import { DocUtils } from '../documents/DocUtils';
import { FieldViewProps } from './nodes/FieldView';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DocViewUtils {
export const ActiveRecordings: { props: FieldViewProps; getAnchor: (addAsAnnotation: boolean) => Doc }[] = [];
diff --git a/src/pen-gestures/GestureUtils.ts b/src/pen-gestures/GestureUtils.ts
index bf5475042..c7051c87c 100644
--- a/src/pen-gestures/GestureUtils.ts
+++ b/src/pen-gestures/GestureUtils.ts
@@ -2,7 +2,6 @@ import { Rect } from 'react-measure';
import { Gestures, PointData } from './GestureTypes';
import { NDollarRecognizer } from './ndollar';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace GestureUtils {
export class GestureEvent {
readonly gesture: Gestures;
diff --git a/src/server/DashStats.ts b/src/server/DashStats.ts
index 6b9fb8971..8e1d4661f 100644
--- a/src/server/DashStats.ts
+++ b/src/server/DashStats.ts
@@ -9,7 +9,7 @@ import { socketMap, timeMap, userOperations } from './SocketData';
* This includes time connected, number of operations, and
* the rate of their operations
*/
-// eslint-disable-next-line @typescript-eslint/no-namespace
+
export namespace DashStats {
export const SAMPLING_INTERVAL = 1000; // in milliseconds (ms) - Time interval to update the frontend.
export const RATE_INTERVAL = 10; // in seconds (s) - Used to calculate rate
diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts
index 5e58db103..8f012f783 100644
--- a/src/server/DashUploadUtils.ts
+++ b/src/server/DashUploadUtils.ts
@@ -47,7 +47,6 @@ function usingAzure() {
return process.env.USE_AZURE === 'true';
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace DashUploadUtils {
export interface Size {
width: number;
diff --git a/src/server/Message.ts b/src/server/Message.ts
index b904a5ba3..01a42fc68 100644
--- a/src/server/Message.ts
+++ b/src/server/Message.ts
@@ -43,7 +43,6 @@ export interface RoomMessage {
readonly room: string;
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace MessageStore {
export const Foo = new Message<string>('Foo');
export const Bar = new Message<string>('Bar');
diff --git a/src/server/Search.ts b/src/server/Search.ts
index 06af18776..b21ee853a 100644
--- a/src/server/Search.ts
+++ b/src/server/Search.ts
@@ -3,7 +3,6 @@ import * as rp from 'request-promise';
const pathTo = (relative: string) => `http://localhost:8983/solr/dash/${relative}`;
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Search {
export async function updateDocument(document: any) {
try {
diff --git a/src/server/SharedMediaTypes.ts b/src/server/SharedMediaTypes.ts
index 680db9cd0..9aa4b120f 100644
--- a/src/server/SharedMediaTypes.ts
+++ b/src/server/SharedMediaTypes.ts
@@ -1,7 +1,6 @@
import { ExifData } from 'exif';
import { File } from 'formidable';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace AcceptableMedia {
export const gifs = ['.gif'];
export const pngs = ['.png'];
@@ -19,7 +18,6 @@ export enum AudioAnnoState {
playing = 'playing',
}
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Upload {
export function isImageInformation(uploadResponse: Upload.FileInformation): uploadResponse is Upload.ImageInformation {
return 'nativeWidth' in uploadResponse;
diff --git a/src/server/apis/google/GoogleApiServerUtils.ts b/src/server/apis/google/GoogleApiServerUtils.ts
index 47206f415..21c405bee 100644
--- a/src/server/apis/google/GoogleApiServerUtils.ts
+++ b/src/server/apis/google/GoogleApiServerUtils.ts
@@ -21,7 +21,7 @@ const scope = ['documents.readonly', 'documents', 'presentations', 'presentation
* This namespace manages server side authentication for Google API queries, either
* from the standard v1 APIs or the Google Photos REST API.
*/
-// eslint-disable-next-line @typescript-eslint/no-namespace
+
export namespace GoogleApiServerUtils {
/**
* As we expand out to more Google APIs that are accessible from
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts
index 2190e27c7..8d3afc3ad 100644
--- a/src/server/server_Initialization.ts
+++ b/src/server/server_Initialization.ts
@@ -113,6 +113,7 @@ function registerEmbeddedBrowseRelativePathHandler(server: express.Express) {
});
}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
function proxyServe(req: any, requrl: string, response: any) {
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
const htmlBodyMemoryStream = new (require('memorystream'))();
@@ -137,8 +138,10 @@ function proxyServe(req: any, requrl: string, response: any) {
response.send(header?.includes('gzip') ? zlib.gzipSync(htmlText) : htmlText);
} else {
req.pipe(request(requrl))
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => console.log('requrl ', e))
.pipe(response)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => console.log('response pipe error', e));
console.log('EMPTY body:' + req.url);
}
@@ -147,14 +150,17 @@ function proxyServe(req: any, requrl: string, response: any) {
}
} else {
req.pipe(htmlBodyMemoryStream)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => console.log('html body memorystream error', e))
.pipe(response)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => console.log('html body memory stream response error', e));
}
};
const retrieveHTTPBody = () => {
// req.headers.cookie = '';
req.pipe(request(requrl))
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => {
console.log(`CORS url error: ${requrl}`, e);
response.send(`<html><body bgcolor="red" link="006666" alink="8B4513" vlink="006666">
@@ -163,6 +169,7 @@ function proxyServe(req: any, requrl: string, response: any) {
<p>${e}</p>
</body></html>`);
})
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('response', (res: any) => {
res.headers;
const headers = Object.keys(res.headers);
@@ -187,6 +194,7 @@ function proxyServe(req: any, requrl: string, response: any) {
})
.on('end', sendModifiedBody)
.pipe(htmlBodyMemoryStream)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
.on('error', (e: any) => console.log('http body pipe error', e));
};
retrieveHTTPBody();
@@ -244,6 +252,7 @@ export default async function InitializeServer(routeSetter: RouteSetter) {
app.use(whm(compiler));
app.get(/^\/+$/, (req, res) => res.redirect(req.user ? '/home' : '/login')); // target urls that consist of one or more '/'s with nothing in between
app.use(express.static(publicDirectory, { setHeaders: res => res.setHeader('Access-Control-Allow-Origin', '*') })); // all urls that start with dash's public directory: /files/ (e.g., /files/images, /files/audio, etc)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
app.use(cors({ origin: (_origin: any, callback: any) => callback(null, true) }));
registerAuthenticationRoutes(app); // this adds routes to authenticate a user (login, etc)
registerCorsProxy(app); // this adds a /corsProxy/ route to allow clients to get to urls that would otherwise be blocked by cors policies
diff --git a/src/server/websocket.ts b/src/server/websocket.ts
index ccbcb1c5f..1e25a8a27 100644
--- a/src/server/websocket.ts
+++ b/src/server/websocket.ts
@@ -15,7 +15,6 @@ import { resolvedPorts, socketMap, timeMap, userOperations } from './SocketData'
import { initializeGuest } from './authentication/DashUserModel';
import { Database } from './database';
-// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace WebSocket {
let CurUser: string | undefined;
export let _socket: Socket;