diff --git a/App/FeatureSet/Home/Static/js/amplitude.js b/App/FeatureSet/Home/Static/js/amplitude.js deleted file mode 100644 index 9fbc8706fe..0000000000 --- a/App/FeatureSet/Home/Static/js/amplitude.js +++ /dev/null @@ -1,99 +0,0 @@ -(function (e, t) { - var n = e.amplitude || { _q: [], _iq: {} }; - var r = t.createElement("script"); - r.type = "text/javascript"; - r.integrity = - "sha384-vYYnQ3LPdp/RkQjoKBTGSq0X5F73gXU3G2QopHaIfna0Ct1JRWzwrmEz115NzOta"; - r.crossOrigin = "anonymous"; - r.async = true; - r.src = "https://cdn.amplitude.com/libs/amplitude-5.8.0-min.gz.js"; - r.onload = function () { - if (!e.amplitude.runQueuedFunctions) { - console.log("[Amplitude] Error: could not load SDK"); - } - }; - var i = t.getElementsByTagName("script")[0]; - i.parentNode.insertBefore(r, i); - function s(e, t) { - e.prototype[t] = function () { - this._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); - return this; - }; - } - var o = function () { - this._q = []; - return this; - }; - var a = ["add", "append", "clearAll", "prepend", "set", "setOnce", "unset"]; - for (var u = 0; u < a.length; u++) { - s(o, a[u]); - } - n.Identify = o; - var c = function () { - this._q = []; - return this; - }; - var l = [ - "setProductId", - "setQuantity", - "setPrice", - "setRevenueType", - "setEventProperties", - ]; - for (var p = 0; p < l.length; p++) { - s(c, l[p]); - } - n.Revenue = c; - var d = [ - "init", - "logEvent", - "logRevenue", - "setUserId", - "setUserProperties", - "setOptOut", - "setVersionName", - "setDomain", - "setDeviceId", - "enableTracking", - "setGlobalUserProperties", - "identify", - "clearUserProperties", - "setGroup", - "logRevenueV2", - "regenerateDeviceId", - "groupIdentify", - "onInit", - "logEventWithTimestamp", - "logEventWithGroups", - "setSessionId", - "resetSessionId", - ]; - function v(e) { - function t(t) { - e[t] = function () { - e._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); - }; - } - for (var n = 0; n < d.length; n++) { - t(d[n]); - } - } - v(n); - n.getInstance = function (e) { - e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase(); - if (!n._iq.hasOwnProperty(e)) { - n._iq[e] = { _q: [] }; - v(n._iq[e]); - } - return n._iq[e]; - }; - e.amplitude = n; -})(window, document); - -amplitude.getInstance().init("802d95003af23aad17ed068b6cfdeb2b", null, { - // include referrer information in amplitude. - saveEvents: true, - includeUtm: true, - includeReferrer: true, - includeGclid: true, -}); diff --git a/CommonServer/Utils/Express.ts b/CommonServer/Utils/Express.ts index 18db0f97b5..55f937d80a 100644 --- a/CommonServer/Utils/Express.ts +++ b/CommonServer/Utils/Express.ts @@ -84,8 +84,8 @@ class Express { return new Promise((resolve: ResolveFunction) => { this.httpServer.listen(port?.toNumber() || this.app.get("port"), () => { - // eslint-disable-next-line - logger.debug(`${appName} server started on port: ${port?.toNumber() || this.app.get('port')}`); + logger.debug( + `${appName} server started on port: ${port?.toNumber() || this.app.get("port")}`, ); return resolve(this.app); }); diff --git a/CommonUI/setupTest.js b/CommonUI/setupTest.js index de4842fe47..d2bf9d1e74 100644 --- a/CommonUI/setupTest.js +++ b/CommonUI/setupTest.js @@ -1,3 +1,5 @@ +import { jest } from "globals"; + jest.mock("remark-gfm", () => { return () => {}; }); diff --git a/CommonUI/src/Components/Link/Link.tsx b/CommonUI/src/Components/Link/Link.tsx index 630ed6cec4..319c371813 100644 --- a/CommonUI/src/Components/Link/Link.tsx +++ b/CommonUI/src/Components/Link/Link.tsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import Navigation from "../../Utils/Navigation"; import Route from "Common/Types/API/Route"; import URL from "Common/Types/API/URL"; diff --git a/eslint.config.js b/eslint.config.js index 8d8704c9a6..fe61904d4d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,7 +1,9 @@ // @ts-check + import eslint from "@eslint/js"; import tseslint from "typescript-eslint"; import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; +import globals from "globals"; export default tseslint.config( { @@ -19,10 +21,37 @@ export default tseslint.config( "**/playwright-coverage/", "**/playwright-screenshots/", "**/playwright-videos", - "webpack.config.js", + "**/webpack.config.js", // TODO: Remove this ignore + "**/service-worker.js", // TODO: Remove this ignore + "**/Static/", // TODO: Remove this ignore ], }, eslint.configs.recommended, - ...tseslint.configs.recommended, + ...tseslint.configs.recommended, // TODO: make this strict and not recommended eslintPluginPrettierRecommended, + { + rules: { + "no-control-regex": "off", // TODO: Remove this rule + "@typescript-eslint/no-explicit-any": "off", // TODO: Remove this rule + "@typescript-eslint/no-var-requires": "off", // TODO: Remove this rule + "@typescript-eslint/no-duplicate-enum-values": "off", // TODO: Remove this rule + "no-constant-binary-expression": "off", // TODO: Remove this rule + "@typescript-eslint/ban-ts-comment": "off", // TODO: Remove this rule + "@typescript-eslint/no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + }, + languageOptions: { + globals: { + ...globals.browser, + ...globals.jquery, + ...globals.node, + }, + }, + }, ); diff --git a/package-lock.json b/package-lock.json index 60cad8d746..3603376962 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@types/lodash": "^4.17.1", + "globals": "^15.4.0", "jest": "^29.7.0", "mailparser": "^3.7.1", "ts-node": "^10.9.2", @@ -500,6 +501,14 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.24.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", @@ -3808,11 +3817,14 @@ } }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.4.0.tgz", + "integrity": "sha512-unnwvMZpv0eDUyjNyh9DH/yxUaRYrEjW/qK4QcdrHg3oO11igUQrCSgODHEqxlKg8v2CD2Sd7UkqqEBoz5U7TQ==", "engines": { - "node": ">=4" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby": { diff --git a/package.json b/package.json index 80aed4dcaf..638f29cfe5 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "type": "module", "dependencies": { "@types/lodash": "^4.17.1", + "globals": "^15.4.0", "jest": "^29.7.0", "mailparser": "^3.7.1", "ts-node": "^10.9.2",