From 4d03becdd12260984f0d0f91a2d9a46a47aaf8e9 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 13 Mar 2024 18:07:28 -0400 Subject: [PATCH] MM-52624/MM-57094 Update ESLint and our ESLint plugin (#26398) * Update ESLint and plugins * Move most channels-specific ESLint configuration into ESLint plugin * Add ESLint to types and client packages * Add ESLint to components package --- webapp/channels/.eslintrc.json | 189 +--- webapp/channels/package.json | 6 - .../src/actions/views/create_comment.test.jsx | 2 +- .../src/actions/websocket_actions.test.jsx | 2 +- webapp/package-lock.json | 916 +++++++++++------- webapp/package.json | 6 +- webapp/platform/client/.eslintrc.json | 6 + webapp/platform/client/package.json | 6 +- webapp/platform/client/src/client4.test.ts | 2 +- webapp/platform/client/src/client4.ts | 407 ++++---- webapp/platform/client/src/errors.test.ts | 1 - webapp/platform/client/src/websocket.ts | 8 +- webapp/platform/client/tsconfig.build.json | 26 + webapp/platform/client/tsconfig.json | 5 +- webapp/platform/components/.eslintrc.json | 6 + webapp/platform/components/package.json | 1 + .../src/common/hooks/useClickOutsideRef.ts | 3 +- .../src/common/hooks/useMeasurePunchouts.ts | 2 +- .../footer_pagination.test.tsx | 7 +- .../src/generic_modal/generic_modal.test.tsx | 5 +- .../src/generic_modal/generic_modal.tsx | 10 +- .../components/src/pulsating_dot/index.tsx | 2 +- .../components/src/skeleton_loader/index.tsx | 12 +- webapp/platform/components/src/testUtils.tsx | 9 +- .../components/src/tour_tip/tour_tip.tsx | 11 +- .../configs/.eslintrc-react.json | 21 +- .../eslint-plugin/configs/.eslintrc.json | 217 +++-- webapp/platform/eslint-plugin/package.json | 14 +- webapp/platform/types/.eslintrc.json | 6 + webapp/platform/types/package.json | 3 +- webapp/platform/types/src/admin.ts | 20 +- webapp/platform/types/src/apps.ts | 2 +- webapp/platform/types/src/autocomplete.ts | 2 +- .../platform/types/src/channel_categories.ts | 8 +- webapp/platform/types/src/channels.ts | 4 +- webapp/platform/types/src/cloud.ts | 4 +- webapp/platform/types/src/config.ts | 8 +- webapp/platform/types/src/drafts.ts | 2 +- webapp/platform/types/src/general.ts | 2 +- webapp/platform/types/src/groups.ts | 5 +- webapp/platform/types/src/hosted_customer.ts | 2 +- webapp/platform/types/src/integrations.ts | 4 +- webapp/platform/types/src/jobs.ts | 2 +- webapp/platform/types/src/marketplace.ts | 4 +- .../platform/types/src/message_attachments.ts | 2 +- webapp/platform/types/src/posts.ts | 14 +- webapp/platform/types/src/reports.ts | 50 +- webapp/platform/types/src/sessions.ts | 2 +- webapp/platform/types/src/store.ts | 48 +- webapp/platform/types/src/teams.ts | 6 +- webapp/platform/types/src/threads.ts | 2 +- webapp/platform/types/src/users.ts | 12 +- webapp/platform/types/src/utilities.ts | 22 +- 53 files changed, 1149 insertions(+), 989 deletions(-) create mode 100644 webapp/platform/client/.eslintrc.json create mode 100644 webapp/platform/client/tsconfig.build.json create mode 100644 webapp/platform/components/.eslintrc.json create mode 100644 webapp/platform/types/.eslintrc.json diff --git a/webapp/channels/.eslintrc.json b/webapp/channels/.eslintrc.json index 08bd2c9c39..af449be839 100644 --- a/webapp/channels/.eslintrc.json +++ b/webapp/channels/.eslintrc.json @@ -1,91 +1,16 @@ { "root": true, "extends": [ - "plugin:@mattermost/react", - "plugin:react-hooks/recommended" + "plugin:@mattermost/react" ], "plugins": [ - "@mattermost", - "import", - "no-only-tests", - "@typescript-eslint", - "formatjs" + "formatjs", + "no-only-tests" ], - "parser": "@typescript-eslint/parser", - "env": { - "jest": true - }, "settings": { - "import/resolver": "webpack", - "react": { - "pragma": "React", - "version": "detect" - } + "import/resolver": "webpack" }, "rules": { - "@mattermost/use-external-link": 2, - "header/header": [ - 2, - "line", - " Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information.", - 2 - ], - "no-duplicate-imports": 0, - "import/no-duplicates": 2, - "max-nested-callbacks": ["error", 10], - "no-unused-expressions": 0, - "eol-last": ["error", "always"], - "import/no-unresolved": 2, - "import/order": [ - 2, - { - "newlines-between": "always", - "groups": [ - "builtin", - "external", - "internal", - "sibling", - "parent", - "index" - ], - "pathGroups": [ - { - "pattern": "@mattermost/**", - "group": "external", - "position": "after" - }, - { - "pattern": "mattermost-redux/**", - "group": "external", - "position": "after" - }, - { - "pattern": "@(selectors|actions|stores|store|reducers){,/**}", - "group": "external", - "position": "after" - }, - { - "pattern": "components/**", - "group": "external", - "position": "after" - }, - { - "pattern": "types{,/**}", - "group": "internal", - "position": "after" - } - ], - "alphabetize": { - "order": "asc", - "caseInsensitive": true - }, - "distinctGroup": true, - "pathGroupsExcludedImportTypes": ["builtin"] - } - ], - "no-undefined": 0, - "no-use-before-define": 0, - "react/jsx-filename-extension": 0, "react/prop-types": [ 2, { @@ -104,116 +29,16 @@ ] } ], - "react/no-string-refs": 2, - "no-only-tests/no-only-tests": ["error", {"focus": ["only", "skip"]}], "react/style-prop-object": [2, { "allow": ["Timestamp"] }], - "no-restricted-imports": [ - "error", - { - "patterns": [ - { - "group": ["@mattermost/compass-components/*"], - "message": "compass-components is now archived." - } - ], - "paths": [ - { - "name": "react-bootstrap", - "importNames": ["OverlayTrigger"], - "message": "Use OverlayTrigger from '/components/overlay_trigger' instead." - }, - { - "name": "redux", - "importNames": ["DeepPartial"], - "message": "Use DeepPartial from '@mattermost/types/utilities instead." - }, - { - "name": "lodash", - "message": "Import individual functions from lodash/ instead." - } - ] - } - ], - "max-lines": ["warn", {"max": 800, "skipBlankLines": true, "skipComments": true}], - "formatjs/no-multiple-whitespaces": 2, - "@typescript-eslint/consistent-type-imports": ["error", {"disallowTypeAnnotations": false}] + "formatjs/no-multiple-whitespaces": 2 }, "overrides": [ { - "files": ["**/*.tsx", "**/*.ts"], - "extends": [ - "plugin:@typescript-eslint/recommended" - ], + "files": ["*.test.*", "src/tests/**"], "rules": { - "camelcase": 0, - "no-shadow": 0, - "import/no-unresolved": 0, // ts handles this better - "@typescript-eslint/naming-convention": [ - 2, - { - "selector": "function", - "format": ["camelCase", "PascalCase"] - }, - { - "selector": "variable", - "format": ["camelCase", "PascalCase", "UPPER_CASE"] - }, - { - "selector": "parameter", - "format": ["camelCase", "PascalCase"], - "leadingUnderscore": "allow" - }, - { - "selector": "typeLike", - "format": ["PascalCase"] - } - ], - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/no-unused-vars": [ - 2, - { - "vars": "all", - "args": "after-used" - } - ], - "@typescript-eslint/no-var-requires": 0, - "@typescript-eslint/no-empty-function": 0, - "@typescript-eslint/prefer-interface": 0, - "@typescript-eslint/explicit-function-return-type": 0, - "@typescript-eslint/explicit-module-boundary-types": 0, - "@typescript-eslint/indent": [ - 2, - 4, - { - "SwitchCase": 0 - } - ], - "@typescript-eslint/no-use-before-define": [ - 2, - { - "classes": false, - "functions": false, - "variables": false - } - ] - } - }, - { - "files": ["src/tests/**", "**/*.test.*", "src/tests/*.js", "src/packages/mattermost-redux/test/*"], - "env": { - "jest": true - }, - "rules": { - "func-names": 0, - "global-require": 0, - "max-lines": 0, - "new-cap": 0, - "no-empty-function": 0, - "no-import-assign": 0, - "no-process-env": 0, - "prefer-arrow-callback": 0 + "no-only-tests/no-only-tests": ["error", {"focus": ["only", "skip"]}] } } ] diff --git a/webapp/channels/package.json b/webapp/channels/package.json index c77a535b32..8354dd9517 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -141,8 +141,6 @@ "@types/shallow-equals": "1.0.3", "@types/styled-components": "5.1.32", "@types/tinycolor2": "1.4.3", - "@typescript-eslint/eslint-plugin": "5.57.1", - "@typescript-eslint/parser": "5.57.1", "copy-webpack-plugin": "11.0.0", "emoji-datasource": "6.1.1", "emoji-datasource-apple": "6.1.1", @@ -150,11 +148,7 @@ "enzyme": "3.11.0", "enzyme-adapter-react-17-updated": "1.0.2", "enzyme-to-json": "3.6.2", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.27.5", "eslint-plugin-no-only-tests": "3.1.0", - "eslint-plugin-react": "7.33.2", - "eslint-plugin-react-hooks": "4.6.0", "external-remotes-plugin": "1.0.0", "html-webpack-plugin": "5.5.0", "identity-obj-proxy": "3.0.0", diff --git a/webapp/channels/src/actions/views/create_comment.test.jsx b/webapp/channels/src/actions/views/create_comment.test.jsx index 90368d61c6..4296b3260a 100644 --- a/webapp/channels/src/actions/views/create_comment.test.jsx +++ b/webapp/channels/src/actions/views/create_comment.test.jsx @@ -287,7 +287,7 @@ describe('rhs view actions', () => { jest.resetModules(); - const {submitCommand: remockedSubmitCommand} = require('actions/views/create_comment'); // eslint-disable-like @typescript-eslint/no-var-requires + const {submitCommand: remockedSubmitCommand} = require('actions/views/create_comment'); await store.dispatch(remockedSubmitCommand(channelId, rootId, draft)); diff --git a/webapp/channels/src/actions/websocket_actions.test.jsx b/webapp/channels/src/actions/websocket_actions.test.jsx index 8c5728434a..83617defdf 100644 --- a/webapp/channels/src/actions/websocket_actions.test.jsx +++ b/webapp/channels/src/actions/websocket_actions.test.jsx @@ -283,7 +283,7 @@ describe('handleUserRemovedEvent', () => { let redirectUserToDefaultTeam; beforeEach(async () => { - const globalActions = require('actions/global_actions'); // eslint-disable-line global-require + const globalActions = require('actions/global_actions'); redirectUserToDefaultTeam = globalActions.redirectUserToDefaultTeam; redirectUserToDefaultTeam.mockReset(); }); diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 8f521dc444..ddf8c39187 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -31,9 +31,11 @@ "concurrently": "7.6.0", "cross-env": "7.0.3", "css-loader": "6.7.3", - "eslint": "8.37.0", - "eslint-import-resolver-webpack": "0.13.2", + "eslint": "8.57.0", + "eslint-import-resolver-webpack": "0.13.8", "eslint-plugin-formatjs": "4.12.2", + "eslint-plugin-react": "7.34.0", + "eslint-plugin-react-hooks": "4.6.0", "mini-css-extract-plugin": "2.7.5", "sass": "1.71.1", "sass-loader": "14.1.1", @@ -187,8 +189,6 @@ "@types/shallow-equals": "1.0.3", "@types/styled-components": "5.1.32", "@types/tinycolor2": "1.4.3", - "@typescript-eslint/eslint-plugin": "5.57.1", - "@typescript-eslint/parser": "5.57.1", "copy-webpack-plugin": "11.0.0", "emoji-datasource": "6.1.1", "emoji-datasource-apple": "6.1.1", @@ -196,11 +196,7 @@ "enzyme": "3.11.0", "enzyme-adapter-react-17-updated": "1.0.2", "enzyme-to-json": "3.6.2", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.27.5", "eslint-plugin-no-only-tests": "3.1.0", - "eslint-plugin-react": "7.33.2", - "eslint-plugin-react-hooks": "4.6.0", "external-remotes-plugin": "1.0.0", "html-webpack-plugin": "5.5.0", "identity-obj-proxy": "3.0.0", @@ -2352,7 +2348,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", - "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -2366,16 +2361,16 @@ }, "node_modules/@eslint-community/regexpp": { "version": "4.10.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2396,8 +2391,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2410,9 +2406,10 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.23.0", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -2425,13 +2422,15 @@ }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2440,9 +2439,10 @@ } }, "node_modules/@eslint/js": { - "version": "8.37.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, - "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -2787,12 +2787,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -2812,9 +2813,10 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "dev": true, - "license": "BSD-3-Clause" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true }, "node_modules/@icons/material": { "version": "0.2.4", @@ -5353,7 +5355,6 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", - "dev": true, "license": "MIT" }, "node_modules/@types/json-stable-stringify": { @@ -5363,8 +5364,8 @@ }, "node_modules/@types/json5": { "version": "0.0.29", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/katex": { "version": "0.11.0", @@ -5749,31 +5750,32 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz", + "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==", "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/type-utils": "7.1.1", + "@typescript-eslint/utils": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5783,7 +5785,6 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { "version": "7.5.4", - "dev": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -5796,24 +5797,25 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.57.1", - "dev": true, - "license": "BSD-2-Clause", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz", + "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==", "dependencies": { - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5822,15 +5824,15 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz", + "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==", "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1" + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -5838,24 +5840,24 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz", + "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==", "dependencies": { - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/utils": "7.1.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5864,11 +5866,11 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz", + "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -5876,20 +5878,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.57.1", - "dev": true, - "license": "BSD-2-Clause", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz", + "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==", "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -5901,10 +5904,32 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.5.4", - "dev": true, - "license": "ISC", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5916,39 +5941,38 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz", + "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@types/semver": { - "version": "7.5.6", - "dev": true, - "license": "MIT" + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.5.4", - "dev": true, - "license": "ISC", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5960,21 +5984,27 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.57.1", - "dev": true, - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz", + "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==", "dependencies": { - "@typescript-eslint/types": "5.57.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "7.1.1", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "dev": true, @@ -6222,8 +6252,9 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -6459,21 +6490,20 @@ } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-find": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/array-flatten": { "version": "2.1.2", "dev": true, @@ -6506,7 +6536,6 @@ }, "node_modules/array.prototype.filter": { "version": "1.0.3", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -6536,6 +6565,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.findlast": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.4.tgz", + "integrity": "sha512-BMtLxpV+8BD+6ZPFIWmnUBpQoy+A+ujcg4rhp2iwCRJYA7PEh2MS4NL3lz8EiDlLrJPp2hg9qWihr5pd//jcGw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", + "integrity": "sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.2", "license": "MIT", @@ -6568,28 +6634,43 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.tosorted": { + "node_modules/array.prototype.toreversed": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz", + "integrity": "sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "es-shim-unscopables": "^1.0.0" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz", + "integrity": "sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.1.0", + "es-shim-unscopables": "^1.0.2" } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", - "license": "MIT", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", "is-shared-array-buffer": "^1.0.2" }, "engines": { @@ -6648,8 +6729,12 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -7822,12 +7907,18 @@ } }, "node_modules/call-bind": { - "version": "1.0.5", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9202,15 +9293,19 @@ } }, "node_modules/define-data-property": { - "version": "1.1.1", - "license": "MIT", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-lazy-prop": { @@ -9843,48 +9938,51 @@ } }, "node_modules/es-abstract": { - "version": "1.22.3", - "license": "MIT", + "version": "1.22.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", + "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.5", - "es-set-tostringtag": "^2.0.1", + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.2", - "get-symbol-description": "^1.0.0", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.0", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", - "safe-regex-test": "^1.0.0", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.8", "string.prototype.trimend": "^1.0.7", "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.13" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -9895,9 +9993,27 @@ }, "node_modules/es-array-method-boxes-properly": { "version": "1.0.0", - "dev": true, "license": "MIT" }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-get-iterator": { "version": "1.1.3", "dev": true, @@ -9918,23 +10034,28 @@ } }, "node_modules/es-iterator-helpers": { - "version": "1.0.15", - "license": "MIT", + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.17.tgz", + "integrity": "sha512-lh7BsUqelv4KUbR5a/ZTaGGIMLCjPGPqJ6q+Oq24YP0RdyptX1uzm4vvaqzk7Zx3bpl/76YLTTDj9L7uYQ92oQ==", "dependencies": { "asynciterator.prototype": "^1.0.0", - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.1", - "es-set-tostringtag": "^2.0.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.2.1", + "es-abstract": "^1.22.4", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.2", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.0", + "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", + "internal-slot": "^1.0.7", "iterator.prototype": "^1.1.2", - "safe-array-concat": "^1.0.1" + "safe-array-concat": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-module-lexer": { @@ -9943,12 +10064,13 @@ "license": "MIT" }, "node_modules/es-set-tostringtag": { - "version": "2.0.2", - "license": "MIT", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dependencies": { - "get-intrinsic": "^1.2.2", - "has-tostringtag": "^1.0.0", - "hasown": "^2.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -10021,26 +10143,28 @@ } }, "node_modules/eslint": { - "version": "8.37.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.2", - "@eslint/js": "8.37.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.4.0", - "espree": "^9.5.1", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -10048,22 +10172,19 @@ "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -10078,7 +10199,6 @@ }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", - "dev": true, "license": "MIT", "dependencies": { "debug": "^3.2.7", @@ -10088,28 +10208,28 @@ }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "3.2.7", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-import-resolver-webpack": { - "version": "0.13.2", + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.13.8.tgz", + "integrity": "sha512-Y7WIaXWV+Q21Rz/PJgUxiW/FTBOWmU8NTLdz+nz9mMoiz5vAev/fOaQxwD7qRzTfE3HSm1qsxZ5uRd7eX+VEtA==", "dev": true, - "license": "MIT", "dependencies": { - "array-find": "^1.0.0", + "array.prototype.find": "^2.2.2", "debug": "^3.2.7", "enhanced-resolve": "^0.9.1", "find-root": "^1.1.0", - "has": "^1.0.3", + "hasown": "^2.0.0", "interpret": "^1.4.0", - "is-core-module": "^2.7.0", + "is-core-module": "^2.13.1", "is-regex": "^1.1.4", "lodash": "^4.17.21", - "resolve": "^1.20.0", - "semver": "^5.7.1" + "resolve": "^2.0.0-next.5", + "semver": "^5.7.2" }, "engines": { "node": ">= 6" @@ -10127,6 +10247,23 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-import-resolver-webpack/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/eslint-import-resolver-webpack/node_modules/semver": { "version": "5.7.2", "dev": true, @@ -10137,7 +10274,6 @@ }, "node_modules/eslint-module-utils": { "version": "2.8.0", - "dev": true, "license": "MIT", "dependencies": { "debug": "^3.2.7" @@ -10153,7 +10289,6 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" @@ -10397,32 +10532,33 @@ }, "node_modules/eslint-plugin-header": { "version": "3.1.1", - "dev": true, "license": "MIT", "peerDependencies": { "eslint": ">=7.7.0" } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "dev": true, - "license": "MIT", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", - "has": "^1.0.3", - "is-core-module": "^2.11.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -10433,7 +10569,6 @@ }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" @@ -10441,7 +10576,6 @@ }, "node_modules/eslint-plugin-import/node_modules/doctrine": { "version": "2.1.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -10491,26 +10625,29 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.33.2", + "version": "7.34.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.0.tgz", + "integrity": "sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==", "dev": true, - "license": "MIT", "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "array.prototype.tosorted": "^1.1.1", + "array-includes": "^3.1.7", + "array.prototype.findlast": "^1.2.4", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.toreversed": "^1.1.2", + "array.prototype.tosorted": "^1.1.3", "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.12", + "es-iterator-helpers": "^1.0.17", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "object.hasown": "^1.1.2", - "object.values": "^1.1.6", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7", + "object.hasown": "^1.1.3", + "object.values": "^1.1.7", "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.4", + "resolve": "^2.0.0-next.5", "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.8" + "string.prototype.matchall": "^4.0.10" }, "engines": { "node": ">=4" @@ -10521,8 +10658,9 @@ }, "node_modules/eslint-plugin-react-hooks": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -10579,7 +10717,6 @@ }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", - "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10650,8 +10787,9 @@ }, "node_modules/espree": { "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -10721,7 +10859,6 @@ }, "node_modules/esutils": { "version": "2.0.3", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -11686,14 +11823,19 @@ "license": "MIT" }, "node_modules/get-intrinsic": { - "version": "1.2.2", - "license": "MIT", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -11729,11 +11871,13 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -11995,10 +12139,10 @@ "dev": true, "license": "ISC" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "dev": true, - "license": "MIT" + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, "node_modules/gzip-size": { "version": "6.0.0", @@ -12048,18 +12192,20 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "license": "MIT", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "engines": { "node": ">= 0.4" }, @@ -12097,10 +12243,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -12135,8 +12282,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "dependencies": { "function-bind": "^1.1.2" }, @@ -12985,10 +13133,11 @@ "license": "BSD-2-Clause" }, "node_modules/internal-slot": { - "version": "1.0.6", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dependencies": { - "get-intrinsic": "^1.2.2", + "es-errors": "^1.3.0", "hasown": "^2.0.0", "side-channel": "^1.0.4" }, @@ -13097,12 +13246,15 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "license": "MIT", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13347,8 +13499,9 @@ "license": "MIT" }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "license": "MIT", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "engines": { "node": ">= 0.4" }, @@ -13464,10 +13617,14 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "license": "MIT", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13528,10 +13685,11 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", - "license": "MIT", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -16052,15 +16210,6 @@ "version": "2.2.1", "license": "MIT" }, - "node_modules/js-sdsl": { - "version": "4.4.2", - "dev": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "license": "MIT" @@ -17084,12 +17233,6 @@ }, "node_modules/natural-compare": { "version": "1.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/nearley": { @@ -17401,11 +17544,12 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "license": "MIT", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -17443,6 +17587,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", + "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", + "dependencies": { + "array.prototype.filter": "^1.0.3", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0" + } + }, "node_modules/object.hasown": { "version": "1.1.3", "dev": true, @@ -18241,6 +18397,14 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { "version": "8.4.35", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", @@ -19518,12 +19682,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", - "license": "MIT", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -19978,11 +20144,12 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.1", - "license": "MIT", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", + "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -20012,13 +20179,17 @@ "license": "MIT" }, "node_modules/safe-regex-test": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", "is-regex": "^1.1.4" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -20374,13 +20545,16 @@ "optional": true }, "node_modules/set-function-length": { - "version": "1.1.1", - "license": "MIT", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -22138,7 +22312,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", - "dev": true, "engines": { "node": ">=16" }, @@ -22170,9 +22343,9 @@ "license": "Unlicense" }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "dev": true, - "license": "MIT", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -22182,8 +22355,8 @@ }, "node_modules/tsconfig-paths/node_modules/json5": { "version": "1.0.2", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dependencies": { "minimist": "^1.2.0" }, @@ -22193,8 +22366,8 @@ }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "engines": { "node": ">=4" } @@ -22203,25 +22376,6 @@ "version": "2.6.2", "license": "0BSD" }, - "node_modules/tsutils": { - "version": "3.21.0", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "dev": true, - "license": "0BSD" - }, "node_modules/tunnel-agent": { "version": "0.6.0", "dev": true, @@ -22283,25 +22437,28 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -22311,14 +22468,16 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -22328,12 +22487,19 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.4", - "license": "MIT", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", + "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -23207,14 +23373,15 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.13", - "license": "MIT", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -23445,6 +23612,7 @@ "form-data": "^4.0.0" }, "devDependencies": { + "@types/jest": "28.1.8", "jest": "27.1.0", "typescript": "^5.0.0" }, @@ -24825,20 +24993,26 @@ }, "platform/eslint-plugin": { "name": "@mattermost/eslint-plugin", - "version": "1.0.0", + "version": "1.1.0", "license": "Apache 2.0", "dependencies": { + "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/parser": "^7.1.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", "jsx-ast-utils": "^3.3.3" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.57.1", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-react": "^7.33.2" + "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react-hooks": "^4.6.0" }, "peerDependenciesMeta": { "eslint-plugin-react": { "optional": true + }, + "eslint-plugin-react-hooks": { + "optional": true } } }, diff --git a/webapp/package.json b/webapp/package.json index aef10259bc..84d69ae4c2 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -36,9 +36,11 @@ "concurrently": "7.6.0", "cross-env": "7.0.3", "css-loader": "6.7.3", - "eslint": "8.37.0", - "eslint-import-resolver-webpack": "0.13.2", + "eslint": "8.57.0", + "eslint-import-resolver-webpack": "0.13.8", "eslint-plugin-formatjs": "4.12.2", + "eslint-plugin-react": "7.34.0", + "eslint-plugin-react-hooks": "4.6.0", "mini-css-extract-plugin": "2.7.5", "sass": "1.71.1", "sass-loader": "14.1.1", diff --git a/webapp/platform/client/.eslintrc.json b/webapp/platform/client/.eslintrc.json new file mode 100644 index 0000000000..f8c36a3bed --- /dev/null +++ b/webapp/platform/client/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "plugin:@mattermost/base" + ] +} diff --git a/webapp/platform/client/package.json b/webapp/platform/client/package.json index eb7e56644d..cef0a14ed1 100644 --- a/webapp/platform/client/package.json +++ b/webapp/platform/client/package.json @@ -21,6 +21,7 @@ "form-data": "^4.0.0" }, "devDependencies": { + "@types/jest": "28.1.8", "jest": "27.1.0", "typescript": "^5.0.0" }, @@ -34,10 +35,11 @@ } }, "scripts": { - "build": "tsc --build --verbose", + "build": "tsc --build tsconfig.build.json --verbose", + "check": "eslint --ext .js,.jsx,.tsx,.ts ./src --quiet", "run": "tsc --watch --preserveWatchOutput", "test": "jest", "test-ci": "jest --ci --forceExit --detectOpenHandles --maxWorkers=100%", - "clean": "rm -rf lib node_modules tsconfig.tsbuildinfo" + "clean": "rm -rf lib node_modules *.tsbuildinfo" } } diff --git a/webapp/platform/client/src/client4.test.ts b/webapp/platform/client/src/client4.test.ts index b351fb732c..60d53ec940 100644 --- a/webapp/platform/client/src/client4.test.ts +++ b/webapp/platform/client/src/client4.test.ts @@ -4,7 +4,7 @@ import nock from 'nock'; import Client4, {ClientError, HEADER_X_VERSION_ID} from './client4'; -import {TelemetryHandler} from './telemetry'; +import type {TelemetryHandler} from './telemetry'; describe('Client4', () => { beforeAll(() => { diff --git a/webapp/platform/client/src/client4.ts b/webapp/platform/client/src/client4.ts index ecc7379438..bd3cb053d0 100644 --- a/webapp/platform/client/src/client4.ts +++ b/webapp/platform/client/src/client4.ts @@ -5,14 +5,29 @@ import FormData from 'form-data'; -import {PreferenceType} from '@mattermost/types/preferences'; -import {SystemSetting} from '@mattermost/types/general'; -import {ClusterInfo, AnalyticsRow, SchemaMigration, LogFilterQuery} from '@mattermost/types/admin'; +import type {ClusterInfo, AnalyticsRow, SchemaMigration, LogFilterQuery} from '@mattermost/types/admin'; import type {AppBinding, AppCallRequest, AppCallResponse} from '@mattermost/types/apps'; -import {Audit} from '@mattermost/types/audits'; -import {UserAutocomplete, AutocompleteSuggestion} from '@mattermost/types/autocomplete'; -import {Bot, BotPatch} from '@mattermost/types/bots'; -import { +import type {Audit} from '@mattermost/types/audits'; +import type {UserAutocomplete, AutocompleteSuggestion} from '@mattermost/types/autocomplete'; +import type {Bot, BotPatch} from '@mattermost/types/bots'; +import type {ChannelCategory, OrderedChannelCategories} from '@mattermost/types/channel_categories'; +import type { + Channel, + ChannelMemberCountsByGroup, + ChannelMembership, + ChannelModeration, + ChannelModerationPatch, + ChannelStats, + ChannelsWithTotalCount, + ChannelUnread, + ChannelViewResponse, + ChannelWithTeamData, + ChannelSearchOpts, + ServerChannel, +} from '@mattermost/types/channels'; +import type {Options, StatusOK, ClientResponse, FetchPaginatedThreadOptions} from '@mattermost/types/client4'; +import {LogLevel} from '@mattermost/types/client4'; +import type { Address, Product, CloudCustomer, @@ -29,32 +44,8 @@ import { NewsletterRequestBody, Installation, } from '@mattermost/types/cloud'; -import { - SelfHostedSignupForm, - SelfHostedSignupCustomerResponse, - SelfHostedSignupSuccessResponse, - SelfHostedSignupBootstrapResponse, - SelfHostedExpansionRequest, -} from '@mattermost/types/hosted_customer'; -import {ChannelCategory, OrderedChannelCategories} from '@mattermost/types/channel_categories'; - -import { - Channel, - ChannelMemberCountsByGroup, - ChannelMembership, - ChannelModeration, - ChannelModerationPatch, - ChannelStats, - ChannelsWithTotalCount, - ChannelUnread, - ChannelViewResponse, - ChannelWithTeamData, - ChannelSearchOpts, - ServerChannel, -} from '@mattermost/types/channels'; -import {Options, StatusOK, ClientResponse, LogLevel, FetchPaginatedThreadOptions} from '@mattermost/types/client4'; -import {Compliance} from '@mattermost/types/compliance'; -import { +import type {Compliance} from '@mattermost/types/compliance'; +import type { ClientConfig, ClientLicense, DataRetentionPolicy, @@ -66,10 +57,18 @@ import { AllowedIPRange, FetchIPResponse, } from '@mattermost/types/config'; -import {CustomEmoji} from '@mattermost/types/emojis'; -import {ServerError} from '@mattermost/types/errors'; -import {FileInfo, FileUploadResponse, FileSearchResults} from '@mattermost/types/files'; -import { +import type { + DataRetentionCustomPolicies, + CreateDataRetentionCustomPolicy, + PatchDataRetentionCustomPolicy, + GetDataRetentionCustomPoliciesRequest, +} from '@mattermost/types/data_retention'; +import type {Draft} from '@mattermost/types/drafts'; +import type {CustomEmoji} from '@mattermost/types/emojis'; +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo, FileUploadResponse, FileSearchResults} from '@mattermost/types/files'; +import type {SystemSetting} from '@mattermost/types/general'; +import type { Group, GroupPatch, GroupSyncable, @@ -84,8 +83,15 @@ import { GetGroupsForUserParams, GroupStats, } from '@mattermost/types/groups'; -import {PostActionResponse} from '@mattermost/types/integration_actions'; -import { +import type { + SelfHostedSignupForm, + SelfHostedSignupCustomerResponse, + SelfHostedSignupSuccessResponse, + SelfHostedSignupBootstrapResponse, + SelfHostedExpansionRequest, +} from '@mattermost/types/hosted_customer'; +import type {PostActionResponse} from '@mattermost/types/integration_actions'; +import type { Command, CommandArgs, CommandResponse, @@ -96,26 +102,30 @@ import { OutgoingWebhook, SubmitDialogResponse, } from '@mattermost/types/integrations'; -import {Job, JobTypeBase} from '@mattermost/types/jobs'; -import {MfaSecret} from '@mattermost/types/mfa'; -import { +import type {Job, JobTypeBase} from '@mattermost/types/jobs'; +import type {UsersLimits} from '@mattermost/types/limits'; +import type { + MarketplaceApp, + MarketplacePlugin, +} from '@mattermost/types/marketplace'; +import type {MfaSecret} from '@mattermost/types/mfa'; +import type { ClientPluginManifest, PluginManifest, PluginsResponse, PluginStatus, } from '@mattermost/types/plugins'; +import type {Post, PostList, PostSearchResults, PostsUsageResponse, TeamsUsageResponse, PaginatedPostList, FilesUsageResponse, PostAcknowledgement, PostAnalytics, PostInfo} from '@mattermost/types/posts'; +import type {PreferenceType} from '@mattermost/types/preferences'; +import type {ProductNotices} from '@mattermost/types/product_notices'; +import type {Reaction} from '@mattermost/types/reactions'; +import type {UserReport, UserReportFilter, UserReportOptions} from '@mattermost/types/reports'; +import type {Role} from '@mattermost/types/roles'; +import type {SamlCertificateStatus, SamlMetadataResponse} from '@mattermost/types/saml'; +import type {Scheme} from '@mattermost/types/schemes'; +import type {Session} from '@mattermost/types/sessions'; +import type {CompleteOnboardingRequest} from '@mattermost/types/setup'; import type { - MarketplaceApp, - MarketplacePlugin, -} from '@mattermost/types/marketplace'; -import {Post, PostList, PostSearchResults, PostsUsageResponse, TeamsUsageResponse, PaginatedPostList, FilesUsageResponse, PostAcknowledgement, PostAnalytics, PostInfo} from '@mattermost/types/posts'; -import {Draft} from '@mattermost/types/drafts'; -import {Reaction} from '@mattermost/types/reactions'; -import {Role} from '@mattermost/types/roles'; -import {SamlCertificateStatus, SamlMetadataResponse} from '@mattermost/types/saml'; -import {Scheme} from '@mattermost/types/schemes'; -import {Session} from '@mattermost/types/sessions'; -import { GetTeamMembersOpts, Team, TeamInviteWithError, @@ -128,8 +138,9 @@ import { PagedTeamSearchOpts, NotPagedTeamSearchOpts, } from '@mattermost/types/teams'; -import {TermsOfService} from '@mattermost/types/terms_of_service'; -import { +import type {TermsOfService} from '@mattermost/types/terms_of_service'; +import type {UserThreadList, UserThread, UserThreadWithPost} from '@mattermost/types/threads'; +import type { AuthChangeResponse, UserAccessToken, UserProfile, @@ -138,24 +149,11 @@ import { GetFilteredUsersStatsOpts, UserCustomStatus, } from '@mattermost/types/users'; -import {UserReport, UserReportFilter} from '@mattermost/types/reports'; -import {DeepPartial, RelationOneToOne} from '@mattermost/types/utilities'; -import {ProductNotices} from '@mattermost/types/product_notices'; -import { - DataRetentionCustomPolicies, - CreateDataRetentionCustomPolicy, - PatchDataRetentionCustomPolicy, - GetDataRetentionCustomPoliciesRequest, -} from '@mattermost/types/data_retention'; -import {CompleteOnboardingRequest} from '@mattermost/types/setup'; -import {UserThreadList, UserThread, UserThreadWithPost} from '@mattermost/types/threads'; -import {UserReportOptions} from '@mattermost/types/reports' -import {UsersLimits} from '@mattermost/types/limits'; - +import type {DeepPartial, RelationOneToOne} from '@mattermost/types/utilities'; import {cleanUrlForLogging} from './errors'; import {buildQueryString} from './helpers'; -import {TelemetryHandler} from './telemetry'; +import type {TelemetryHandler} from './telemetry'; const HEADER_AUTH = 'Authorization'; const HEADER_BEARER = 'BEARER'; @@ -396,7 +394,6 @@ export default class Client4 { return `${this.getBaseRoute()}/oauth/outgoing_connections/${connectionId}`; } - getEmojisRoute() { return `${this.getBaseRoute()}/emoji`; } @@ -583,14 +580,14 @@ export default class Client4 { `${this.getUsersRoute()}${buildQueryString(queryParams)}`, {method: 'post', body: JSON.stringify(user)}, ); - } + }; patchMe = (userPatch: Partial) => { return this.doFetch( `${this.getUserRoute('me')}/patch`, {method: 'put', body: JSON.stringify(userPatch)}, ); - } + }; patchUser = (userPatch: Partial & {id: string}) => { this.trackEvent('api', 'api_users_patch'); @@ -599,7 +596,7 @@ export default class Client4 { `${this.getUserRoute(userPatch.id)}/patch`, {method: 'put', body: JSON.stringify(userPatch)}, ); - } + }; updateUser = (user: UserProfile) => { this.trackEvent('api', 'api_users_update'); @@ -608,7 +605,7 @@ export default class Client4 { `${this.getUserRoute(user.id)}`, {method: 'put', body: JSON.stringify(user)}, ); - } + }; promoteGuestToUser = (userId: string) => { this.trackEvent('api', 'api_users_promote_guest_to_user'); @@ -617,7 +614,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/promote`, {method: 'post'}, ); - } + }; demoteUserToGuest = (userId: string) => { this.trackEvent('api', 'api_users_demote_user_to_guest'); @@ -626,7 +623,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/demote`, {method: 'post'}, ); - } + }; updateUserRoles = (userId: string, roles: string) => { this.trackEvent('api', 'api_users_update_roles'); @@ -650,7 +647,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/mfa`, {method: 'put', body: JSON.stringify(body)}, ); - } + }; updateUserPassword = (userId: string, currentPassword: string, newPassword: string) => { this.trackEvent('api', 'api_users_newpassword'); @@ -659,7 +656,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/password`, {method: 'put', body: JSON.stringify({current_password: currentPassword, new_password: newPassword})}, ); - } + }; resetUserPassword = (token: string, newPassword: string) => { this.trackEvent('api', 'api_users_reset_password'); @@ -668,14 +665,14 @@ export default class Client4 { `${this.getUsersRoute()}/password/reset`, {method: 'post', body: JSON.stringify({token, new_password: newPassword})}, ); - } + }; getKnownUsers = () => { return this.doFetch>( `${this.getUsersRoute()}/known`, {method: 'get'}, ); - } + }; sendPasswordResetEmail = (email: string) => { this.trackEvent('api', 'api_users_send_password_reset'); @@ -684,7 +681,7 @@ export default class Client4 { `${this.getUsersRoute()}/password/reset/send`, {method: 'post', body: JSON.stringify({email})}, ); - } + }; updateUserActive = (userId: string, active: boolean) => { this.trackEvent('api', 'api_users_update_active'); @@ -693,7 +690,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/active`, {method: 'put', body: JSON.stringify({active})}, ); - } + }; uploadProfileImage = (userId: string, imageData: File) => { this.trackEvent('api', 'api_users_update_profile_picture'); @@ -725,35 +722,35 @@ export default class Client4 { `${this.getUsersRoute()}/email/verify`, {method: 'post', body: JSON.stringify({token})}, ); - } + }; updateMyTermsOfServiceStatus = (termsOfServiceId: string, accepted: boolean) => { return this.doFetch( `${this.getUserRoute('me')}/terms_of_service`, {method: 'post', body: JSON.stringify({termsOfServiceId, accepted})}, ); - } + }; getTermsOfService = () => { return this.doFetch( `${this.getBaseRoute()}/terms_of_service`, {method: 'get'}, ); - } + }; createTermsOfService = (text: string) => { return this.doFetch( `${this.getBaseRoute()}/terms_of_service`, {method: 'post', body: JSON.stringify({text})}, ); - } + }; sendVerificationEmail = (email: string) => { return this.doFetch( `${this.getUsersRoute()}/email/verify/send`, {method: 'post', body: JSON.stringify({email})}, ); - } + }; login = async (loginId: string, password: string, token = '', ldapOnly = false) => { this.trackEvent('api', 'api_users_login'); @@ -794,7 +791,7 @@ export default class Client4 { deviceId: '', }; - return await this.doFetch( + return this.doFetch( `${this.getUsersRoute()}/login/desktop_token`, {method: 'post', body: JSON.stringify(body)}, ); @@ -1017,7 +1014,7 @@ export default class Client4 { `${this.getReportsRoute()}/users${queryString}`, {method: 'get'}, ); - } + }; getUserCountForReporting = (filter: UserReportFilter) => { const queryString = buildQueryString(filter); @@ -1025,7 +1022,7 @@ export default class Client4 { `${this.getReportsRoute()}/users/count${queryString}`, {method: 'get'}, ); - } + }; startUsersBatchExport = (dateRange: string) => { const queryString = buildQueryString({date_range: dateRange}); @@ -1033,7 +1030,7 @@ export default class Client4 { `${this.getReportsRoute()}/users/export${queryString}`, {method: 'post'}, ); - } + }; /** * @deprecated @@ -1094,14 +1091,14 @@ export default class Client4 { `${this.getUserRoute('me')}/status/custom`, {method: 'delete'}, ); - } + }; removeRecentCustomStatus = (customStatus: UserCustomStatus) => { return this.doFetch( `${this.getUserRoute('me')}/status/custom/recent/delete`, {method: 'post', body: JSON.stringify(customStatus)}, ); - } + }; moveThread = (postId: string, channelId: string) => { const url = this.getPostRoute(postId) + '/move'; @@ -1109,7 +1106,7 @@ export default class Client4 { url, {method: 'post', body: JSON.stringify({channel_id: channelId})}, ); - } + }; switchEmailToOAuth = (service: string, email: string, password: string, mfaCode = '') => { this.trackEvent('api', 'api_users_email_to_oauth'); @@ -1152,21 +1149,21 @@ export default class Client4 { `${this.getUserRoute(userId)}/oauth/apps/authorized`, {method: 'get'}, ); - } + }; authorizeOAuthApp = (responseType: string, clientId: string, redirectUri: string, state: string, scope: string) => { return this.doFetch( `${this.url}/oauth/authorize`, {method: 'post', body: JSON.stringify({client_id: clientId, response_type: responseType, redirect_uri: redirectUri, state, scope})}, ); - } + }; deauthorizeOAuthApp = (clientId: string) => { return this.doFetch( `${this.url}/oauth/deauthorize`, {method: 'post', body: JSON.stringify({client_id: clientId})}, ); - } + }; createUserAccessToken = (userId: string, description: string) => { this.trackEvent('api', 'api_users_create_access_token'); @@ -1175,28 +1172,28 @@ export default class Client4 { `${this.getUserRoute(userId)}/tokens`, {method: 'post', body: JSON.stringify({description})}, ); - } + }; getUserAccessToken = (tokenId: string) => { return this.doFetch( `${this.getUsersRoute()}/tokens/${tokenId}`, {method: 'get'}, ); - } + }; getUserAccessTokensForUser = (userId: string, page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( `${this.getUserRoute(userId)}/tokens${buildQueryString({page, per_page: perPage})}`, {method: 'get'}, ); - } + }; getUserAccessTokens = (page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( `${this.getUsersRoute()}/tokens${buildQueryString({page, per_page: perPage})}`, {method: 'get'}, ); - } + }; revokeUserAccessToken = (tokenId: string) => { this.trackEvent('api', 'api_users_revoke_access_token'); @@ -1205,22 +1202,21 @@ export default class Client4 { `${this.getUsersRoute()}/tokens/revoke`, {method: 'post', body: JSON.stringify({token_id: tokenId})}, ); - } + }; disableUserAccessToken = (tokenId: string) => { return this.doFetch( `${this.getUsersRoute()}/tokens/disable`, {method: 'post', body: JSON.stringify({token_id: tokenId})}, ); - } + }; enableUserAccessToken = (tokenId: string) => { return this.doFetch( `${this.getUsersRoute()}/tokens/enable`, {method: 'post', body: JSON.stringify({token_id: tokenId})}, ); - } - + }; // Limits Routes @@ -1231,7 +1227,7 @@ export default class Client4 { method: 'get', }, ); - } + }; // Team Routes @@ -1258,7 +1254,7 @@ export default class Client4 { `${this.getTeamRoute(teamId)}/restore`, {method: 'post'}, ); - } + }; updateTeam = (team: Team) => { this.trackEvent('api', 'api_teams_update_name', {team_id: team.id}); @@ -1314,14 +1310,14 @@ export default class Client4 { searchTeams(term: string, opts: PagedTeamSearchOpts): Promise; searchTeams(term: string, opts: NotPagedTeamSearchOpts): Promise; - searchTeams (term: string, opts: TeamSearchOpts): Promise { + searchTeams(term: string, opts: TeamSearchOpts): Promise { this.trackEvent('api', 'api_search_teams'); return this.doFetch( `${this.getTeamsRoute()}/search`, {method: 'post', body: JSON.stringify({term, ...opts})}, ); - }; + } getTeam = (teamId: string) => { return this.doFetch( @@ -1630,7 +1626,7 @@ export default class Client4 { `${this.getChannelsRoute()}${buildQueryString(queryData)}`, {method: 'get'}, ); - }; + } createChannel = (channel: Channel) => { this.trackEvent('api', 'api_channels_create', {team_id: channel.team_id}); @@ -1750,7 +1746,7 @@ export default class Client4 { `${this.getTeamRoute(teamId)}/channels${buildQueryString({page, per_page: perPage})}`, {method: 'get'}, ); - } + }; getAllTeamsChannels = () => { return this.doFetch( @@ -1849,7 +1845,7 @@ export default class Client4 { }; getChannelStats = (channelId: string, includeFileCount = false) => { - const param = !includeFileCount ? '?exclude_files_count=true' : ''; + const param = includeFileCount ? '' : '?exclude_files_count=true'; return this.doFetch( `${this.getChannelRoute(channelId)}/stats${param}`, {method: 'get'}, @@ -1859,9 +1855,9 @@ export default class Client4 { getChannelsMemberCount = (channelIds: string[]) => { return this.doFetch>( `${this.getChannelsRoute()}/stats/member_count`, - {method: 'post', body: JSON.stringify(channelIds)} - ) - } + {method: 'post', body: JSON.stringify(channelIds)}, + ); + }; getChannelModerations = (channelId: string) => { return this.doFetch( @@ -1945,7 +1941,7 @@ export default class Client4 { `${this.getChannelsRoute()}/search${buildQueryString(queryParams)}`, {method: 'post', body: JSON.stringify(body)}, ); - }; + } searchGroupChannels = (term: string) => { return this.doFetch( @@ -2018,7 +2014,7 @@ export default class Client4 { `${this.getChannelCategoriesRoute(userId, teamId)}/${categoryId}`, {method: 'delete'}, ); - } + }; // Post Routes @@ -2226,7 +2222,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/posts/${postId}/set_unread`, {method: 'post', body: JSON.stringify({collapsed_threads_supported: true})}, ); - } + }; addPostReminder = (userId: string, postId: string, timestamp: number) => { this.trackEvent('api', 'api_post_set_reminder'); @@ -2235,7 +2231,7 @@ export default class Client4 { `${this.getUserRoute(userId)}/posts/${postId}/reminder`, {method: 'post', body: JSON.stringify({target_time: timestamp})}, ); - } + }; pinPost = (postId: string) => { this.trackEvent('api', 'api_posts_pin'); @@ -2259,8 +2255,8 @@ export default class Client4 { return this.doFetch( `${this.getPostRoute(postId)}/info`, {method: 'get'}, - ) - } + ); + }; getPostsByIds = (postIds: string[]) => { return this.doFetch( @@ -2274,7 +2270,7 @@ export default class Client4 { `${this.getPostRoute(postId)}/edit_history`, {method: 'get'}, ); - } + }; addReaction = (userId: string, postId: string, emojiName: string) => { this.trackEvent('api', 'api_reactions_save', {post_id: postId}); @@ -2404,7 +2400,7 @@ export default class Client4 { `${this.getFileRoute(fileId)}/link`, {method: 'get'}, ); - } + }; acknowledgePost = (postId: string, userId: string) => { this.trackEvent('api', 'api_posts_ack'); @@ -2466,7 +2462,7 @@ export default class Client4 { `${this.getBaseRoute()}/upgrade_to_enterprise`, {method: 'post'}, ); - } + }; upgradeToEnterpriseStatus = async () => { return this.doFetch<{ @@ -2476,14 +2472,14 @@ export default class Client4 { `${this.getBaseRoute()}/upgrade_to_enterprise/status`, {method: 'get'}, ); - } + }; restartServer = async () => { return this.doFetch( `${this.getBaseRoute()}/restart`, {method: 'post'}, ); - } + }; logClientError = (message: string, level = LogLevel.Error) => { const url = `${this.getBaseRoute()}/logs`; @@ -2522,7 +2518,7 @@ export default class Client4 { `${this.getPluginsRoute()}/marketplace/first_admin_visit`, {method: 'post', body: JSON.stringify({first_admin_visit_marketplace_status: true})}, ); - } + }; getFirstAdminVisitMarketplaceStatus = async () => { return this.doFetch( @@ -2547,7 +2543,7 @@ export default class Client4 { getWebSocketUrl = () => { return `${this.getBaseRoute()}/websocket`; - } + }; // Integration Routes @@ -2763,14 +2759,14 @@ export default class Client4 { `${this.getAppsProxyRoute()}/api/v1/oauth-app-ids`, {method: 'get'}, ); - } + }; getAppsBotIDs = () => { return this.doFetch( `${this.getAppsProxyRoute()}/api/v1/bot-ids`, {method: 'get'}, ); - } + }; getOAuthApp = (appId: string) => { return this.doFetch( @@ -2977,14 +2973,14 @@ export default class Client4 { `${this.getDataRetentionRoute()}/policies/${policyId}/channels/search`, {method: 'post', body: JSON.stringify({term, ...opts})}, ); - } + }; searchDataRetentionCustomPolicyTeams = (policyId: string, term: string, opts: TeamSearchOpts) => { return this.doFetch( `${this.getDataRetentionRoute()}/policies/${policyId}/teams/search`, {method: 'post', body: JSON.stringify({term, ...opts})}, ); - } + }; getDataRetentionCustomPolicyTeams = (id: string, page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( @@ -3405,7 +3401,7 @@ export default class Client4 { `${this.getBaseRoute()}/trial-license`, {method: 'POST', body: JSON.stringify(body)}, ); - } + }; removeLicense = () => { return this.doFetch( @@ -3419,7 +3415,7 @@ export default class Client4 { `${this.getBaseRoute()}/trial-license/prev`, {method: 'get'}, ); - } + }; getAnalytics = (name = 'standard', teamId = '') => { return this.doFetch( @@ -3560,14 +3556,14 @@ export default class Client4 { `${this.getPluginsMarketplaceRoute()}${buildQueryString({filter: filter || '', remote_only: true})}`, {method: 'get'}, ); - } + }; getMarketplacePlugins = (filter: string, localOnly = false) => { return this.doFetch( `${this.getPluginsMarketplaceRoute()}${buildQueryString({filter: filter || '', local_only: localOnly})}`, {method: 'get'}, ); - } + }; installMarketplacePlugin = (id: string) => { this.trackEvent('api', 'api_install_marketplace_plugin'); @@ -3576,14 +3572,14 @@ export default class Client4 { `${this.getPluginsMarketplaceRoute()}`, {method: 'post', body: JSON.stringify({id})}, ); - } + }; getMarketplaceApps = (filter: string) => { return this.doFetch( `${this.getAppsProxyRoute()}/api/v1/marketplace${buildQueryString({filter: filter || ''})}`, {method: 'get'}, ); - } + }; getPluginStatuses = () => { return this.doFetch( @@ -3700,28 +3696,28 @@ export default class Client4 { this.getGroupsRoute(), {method: 'post', body: JSON.stringify(group)}, ); - } + }; addUsersToGroup = (groupId: string, userIds: string[]) => { return this.doFetch( `${this.getGroupRoute(groupId)}/members`, {method: 'post', body: JSON.stringify({user_ids: userIds})}, ); - } + }; removeUsersFromGroup = (groupId: string, userIds: string[]) => { return this.doFetch( `${this.getGroupRoute(groupId)}/members`, {method: 'delete', body: JSON.stringify({user_ids: userIds})}, ); - } + }; searchGroups = (params: GroupSearchParams) => { return this.doFetch( `${this.getGroupsRoute()}${buildQueryString(params)}`, {method: 'get'}, ); - } + }; executeAppCall = async (call: AppCallRequest, trackAsSubmit: boolean) => { const callCopy: AppCallRequest = { @@ -3736,7 +3732,7 @@ export default class Client4 { `${this.getAppsProxyRoute()}/api/v1/call`, {method: 'post', body: JSON.stringify(callCopy)}, ); - } + }; getAppsBindings = async (channelID: string, teamID: string) => { const params = { @@ -3749,7 +3745,7 @@ export default class Client4 { `${this.getAppsProxyRoute()}/api/v1/bindings${buildQueryString(params)}`, {method: 'get'}, ); - } + }; getGroupsAssociatedToTeam = (teamID: string, q = '', page = 0, perPage = PER_PAGE_DEFAULT, filterAllowReference = false) => { this.trackEvent('api', 'api_groups_get_associated_to_team', {team_id: teamID}); @@ -3817,21 +3813,21 @@ export default class Client4 { `${this.getGroupRoute(groupId)}`, {method: 'delete'}, ); - } + }; restoreGroup = (groupId: string) => { return this.doFetch( `${this.getGroupRoute(groupId)}/restore`, {method: 'post'}, ); - } + }; createGroupTeamsAndChannels = (userID: string) => { return this.doFetch( `${this.getBaseRoute()}/ldap/users/${userID}/group_sync_memberships`, {method: 'post'}, ); - } + }; // Bot Routes @@ -3840,63 +3836,63 @@ export default class Client4 { `${this.getBotsRoute()}`, {method: 'post', body: JSON.stringify(bot)}, ); - } + }; patchBot = (botUserId: string, botPatch: Partial) => { return this.doFetch( `${this.getBotRoute(botUserId)}`, {method: 'put', body: JSON.stringify(botPatch)}, ); - } + }; getBot = (botUserId: string) => { return this.doFetch( `${this.getBotRoute(botUserId)}`, {method: 'get'}, ); - } + }; getBots = (page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( `${this.getBotsRoute()}${buildQueryString({page, per_page: perPage})}`, {method: 'get'}, ); - } + }; getBotsIncludeDeleted = (page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( `${this.getBotsRoute()}${buildQueryString({include_deleted: true, page, per_page: perPage})}`, {method: 'get'}, ); - } + }; getBotsOrphaned = (page = 0, perPage = PER_PAGE_DEFAULT) => { return this.doFetch( `${this.getBotsRoute()}${buildQueryString({only_orphaned: true, page, per_page: perPage})}`, {method: 'get'}, ); - } + }; disableBot = (botUserId: string) => { return this.doFetch( `${this.getBotRoute(botUserId)}/disable`, {method: 'post'}, ); - } + }; enableBot = (botUserId: string) => { return this.doFetch( `${this.getBotRoute(botUserId)}/enable`, {method: 'post'}, ); - } + }; assignBot = (botUserId: string, newOwnerId: string) => { return this.doFetch( `${this.getBotRoute(botUserId)}/assign/${newOwnerId}`, {method: 'post'}, ); - } + }; // Cloud routes getCloudProducts = (includeLegacyProducts?: boolean) => { @@ -3927,13 +3923,13 @@ export default class Client4 { `${this.getHostedCustomerRoute()}/signup_available`, {method: 'get'}, ); - } + }; getSelfHostedProducts = () => { return this.doFetch( `${this.getCloudRoute()}/products/selfhosted`, {method: 'get'}, ); - } + }; createCustomerSelfHostedSignup = (form: SelfHostedSignupForm) => { return this.doFetch( @@ -3949,13 +3945,12 @@ export default class Client4 { ); }; - confirmSelfHostedExpansion = (setupIntentId: string, expandRequest: SelfHostedExpansionRequest) => { return this.doFetch( `${this.getHostedCustomerRoute()}/confirm-expand`, {method: 'post', body: JSON.stringify({stripe_setup_intent_id: setupIntentId, expand_request: expandRequest})}, ); - } + }; subscribeToNewsletter = (newletterRequestBody: NewsletterRequestBody) => { return this.doFetch( @@ -3969,47 +3964,47 @@ export default class Client4 { `${this.getCloudRoute()}/payment`, {method: 'post'}, ); - } + }; getCloudCustomer = () => { return this.doFetch( `${this.getCloudRoute()}/customer`, {method: 'get'}, ); - } + }; getLicenseSelfServeStatus = () => { return this.doFetch( `${this.getCloudRoute()}/subscription/self-serve-status`, {method: 'get'}, ); - } + }; updateCloudCustomer = (customerPatch: CloudCustomerPatch) => { return this.doFetch( `${this.getCloudRoute()}/customer`, {method: 'put', body: JSON.stringify(customerPatch)}, ); - } + }; updateCloudCustomerAddress = (address: Address) => { return this.doFetch( `${this.getCloudRoute()}/customer/address`, {method: 'put', body: JSON.stringify(address)}, ); - } + }; notifyAdmin = (req: NotifyAdminRequest) => { return this.doFetchWithResponse( `${this.getUsersRoute()}/notify-admin`, {method: 'post', body: JSON.stringify(req)}, ); - } + }; confirmPaymentMethod = async (stripeSetupIntentID: string) => { return this.doFetch( `${this.getCloudRoute()}/payment/confirm`, {method: 'post', body: JSON.stringify({stripe_setup_intent_id: stripeSetupIntentID})}, ); - } + }; subscribeCloudProduct = (productId: string, shippingAddress?: Address, seats = 0, downgradeFeedback?: Feedback, customerPatch?: CloudCustomerPatch) => { const body = { @@ -4028,99 +4023,99 @@ export default class Client4 { `${this.getCloudRoute()}/subscription`, {method: 'put', body: JSON.stringify(body)}, ); - } + }; requestCloudTrial = (subscriptionId: string, email = '') => { return this.doFetchWithResponse( `${this.getCloudRoute()}/request-trial`, {method: 'put', body: JSON.stringify({email, subscription_id: subscriptionId})}, ); - } + }; validateBusinessEmail = (email = '') => { return this.doFetchWithResponse( `${this.getCloudRoute()}/validate-business-email`, {method: 'post', body: JSON.stringify({email})}, ); - } + }; validateWorkspaceBusinessEmail = () => { return this.doFetchWithResponse( `${this.getCloudRoute()}/validate-workspace-business-email`, {method: 'post'}, ); - } + }; getSubscription = () => { return this.doFetch( `${this.getCloudRoute()}/subscription`, {method: 'get'}, ); - } + }; getInstallation = () => { return this.doFetch( `${this.getCloudRoute()}/installation`, {method: 'get'}, ); - } + }; getRenewalLink = () => { return this.doFetch<{renewal_link: string}>( `${this.getBaseRoute()}/license/renewal`, {method: 'get'}, ); - } + }; getInvoices = () => { return this.doFetch( `${this.getCloudRoute()}/subscription/invoices`, {method: 'get'}, ); - } + }; getInvoicePdfUrl = (invoiceId: string) => { return `${this.getCloudRoute()}/subscription/invoices/${invoiceId}/pdf`; - } + }; getSelfHostedInvoices = () => { return this.doFetch( `${this.getHostedCustomerRoute()}/invoices`, {method: 'get'}, ); - } + }; getSelfHostedInvoicePdfUrl = (invoiceId: string) => { return `${this.getHostedCustomerRoute()}/invoices/${invoiceId}/pdf`; - } + }; getCloudLimits = () => { return this.doFetch( `${this.getCloudRoute()}/limits`, {method: 'get'}, ); - } + }; getPostsUsage = () => { return this.doFetch( `${this.getUsageRoute()}/posts`, {method: 'get'}, ); - } + }; getFilesUsage = () => { return this.doFetch( `${this.getUsageRoute()}/storage`, {method: 'get'}, ); - } + }; getTeamsUsage = () => { return this.doFetch( `${this.getUsageRoute()}/teams`, {method: 'get'}, ); - } + }; teamMembersMinusGroupMembers = (teamID: string, groupIDs: string[], page: number, perPage: number) => { const query = `group_ids=${groupIDs.join(',')}&page=${page}&per_page=${perPage}`; @@ -4128,7 +4123,7 @@ export default class Client4 { `${this.getTeamRoute(teamID)}/members_minus_group_members?${query}`, {method: 'get'}, ); - } + }; channelMembersMinusGroupMembers = (channelID: string, groupIDs: string[], page: number, perPage: number) => { const query = `group_ids=${groupIDs.join(',')}&page=${page}&per_page=${perPage}`; @@ -4136,7 +4131,7 @@ export default class Client4 { `${this.getChannelRoute(channelID)}/members_minus_group_members?${query}`, {method: 'get'}, ); - } + }; getSamlMetadataFromIdp = (samlMetadataURL: string) => { return this.doFetch( @@ -4174,35 +4169,35 @@ export default class Client4 { `${this.getNoticesRoute()}/view`, {method: 'put', body: JSON.stringify(noticeIds)}, ); - } + }; getAncillaryPermissions = (subsectionPermissions: string[]) => { return this.doFetch( `${this.getPermissionsRoute()}/ancillary?subsection_permissions=${subsectionPermissions.join(',')}`, {method: 'get'}, ); - } + }; completeSetup = (completeOnboardingRequest: CompleteOnboardingRequest) => { return this.doFetch( `${this.getSystemRoute()}/onboarding/complete`, {method: 'post', body: JSON.stringify(completeOnboardingRequest)}, ); - } + }; getAppliedSchemaMigrations = () => { return this.doFetch( `${this.getSystemRoute()}/schema/version`, {method: 'get'}, ); - } + }; getCallsChannelState = (channelId: string) => { return this.doFetch<{enabled: boolean; id: string}>( `${this.url}/plugins/${'com.mattermost.calls'}/${channelId}`, {method: 'get'}, ); - } + }; // Client Helpers @@ -4317,70 +4312,70 @@ export default class Client4 { return this.doFetch( `${this.getBaseRoute()}/ip_filtering`, {method: 'get'}, - ) - } + ); + }; getCurrentIP = () => { return this.doFetch( `${this.getBaseRoute()}/ip_filtering/my_ip`, {method: 'get'}, - ) - } + ); + }; applyIPFilters = (filters: AllowedIPRanges) => { return this.doFetch( `${this.getBaseRoute()}/ip_filtering`, {method: 'post', body: JSON.stringify(filters)}, - ) - } + ); + }; submitTrueUpReview = () => { return this.doFetch( `${this.getBaseRoute()}/license/review`, {method: 'post'}, ); - } + }; getTrueUpReviewStatus = () => { return this.doFetch( `${this.getBaseRoute()}/license/review/status`, {method: 'get'}, ); - } + }; cwsAvailabilityCheck = () => { return this.doFetchWithResponse( `${this.getCloudRoute()}/check-cws-connection`, {method: 'get'}, ); - } + }; deleteWorkspace = (deletionRequest: WorkspaceDeletionRequest) => { return this.doFetch( `${this.getCloudRoute()}/delete-workspace`, {method: 'delete', body: JSON.stringify(deletionRequest)}, ); - } + }; getGroupMessageMembersCommonTeams = (channelId: string) => { return this.doFetchWithResponse( `${this.getChannelRoute(channelId)}/common_teams`, {method: 'get'}, - ) - } + ); + }; convertGroupMessageToPrivateChannel = (channelId: string, teamId: string, displayName: string, name: string) => { const body = { channel_id: channelId, team_id: teamId, display_name: displayName, - name: name, - } + name, + }; return this.doFetchWithResponse( `${this.getChannelRoute(channelId)}/convert_to_channel?team_id=${teamId}`, {method: 'post', body: JSON.stringify(body)}, - ) - } + ); + }; } export function parseAndMergeNestedHeaders(originalHeaders: any) { diff --git a/webapp/platform/client/src/errors.test.ts b/webapp/platform/client/src/errors.test.ts index cadd265d25..d050c2441e 100644 --- a/webapp/platform/client/src/errors.test.ts +++ b/webapp/platform/client/src/errors.test.ts @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import Client4 from './client4'; - import {cleanUrlForLogging} from './errors'; describe('cleanUrlForLogging', () => { diff --git a/webapp/platform/client/src/websocket.ts b/webapp/platform/client/src/websocket.ts index bb8c6ebd8f..cf4fd3f608 100644 --- a/webapp/platform/client/src/websocket.ts +++ b/webapp/platform/client/src/websocket.ts @@ -189,16 +189,16 @@ export default class WebSocketClient { console.log('long timeout, or server restart, or sequence number is not found.'); //eslint-disable-line no-console this.missedEventCallback?.(); - - for (const listener of this.missedMessageListeners) { + + for (const listener of this.missedMessageListeners) { try { listener(); } catch (e) { console.log(`missed message listener "${listener.name}" failed: ${e}`); // eslint-disable-line no-console } } - - this.serverSequence = 0; + + this.serverSequence = 0; } // If it's a fresh connection, we have to set the connectionId regardless. diff --git a/webapp/platform/client/tsconfig.build.json b/webapp/platform/client/tsconfig.build.json new file mode 100644 index 0000000000..637a6a9934 --- /dev/null +++ b/webapp/platform/client/tsconfig.build.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es2022", + "declaration": true, + "strict": true, + "resolveJsonModule": true, + "isolatedModules": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "jsx": "react", + "outDir": "./lib", + "rootDir": "./src", + "composite": true, + }, + "include": [ + "./src/**/*" + ], + "exclude": [ + "**/*.test.*" + ], + "references": [ + {"path": "../types"} + ] +} diff --git a/webapp/platform/client/tsconfig.json b/webapp/platform/client/tsconfig.json index 2dad4b02eb..58fdedb6d3 100644 --- a/webapp/platform/client/tsconfig.json +++ b/webapp/platform/client/tsconfig.json @@ -12,14 +12,11 @@ "jsx": "react", "outDir": "./lib", "rootDir": "./src", - "composite": true + "composite": true, }, "include": [ "./src/**/*" ], - "exclude": [ - "**/*.test.*" - ], "references": [ {"path": "../types"} ] diff --git a/webapp/platform/components/.eslintrc.json b/webapp/platform/components/.eslintrc.json new file mode 100644 index 0000000000..f8c36a3bed --- /dev/null +++ b/webapp/platform/components/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "plugin:@mattermost/base" + ] +} diff --git a/webapp/platform/components/package.json b/webapp/platform/components/package.json index ffd9655add..29649560cf 100644 --- a/webapp/platform/components/package.json +++ b/webapp/platform/components/package.json @@ -7,6 +7,7 @@ "styles": "dist/index.esm.css", "scripts": { "build": "rollup -c", + "check": "eslint --ext .js,.jsx,.tsx,.ts ./src --quiet", "run": "rollup -c --watch", "test": "cross-env TZ=Etc/UTC jest", "test:updatesnapshot": "cross-env TZ=Etc/UTC jest --updateSnapshot", diff --git a/webapp/platform/components/src/common/hooks/useClickOutsideRef.ts b/webapp/platform/components/src/common/hooks/useClickOutsideRef.ts index e79e90ab9e..36cd6bcad3 100644 --- a/webapp/platform/components/src/common/hooks/useClickOutsideRef.ts +++ b/webapp/platform/components/src/common/hooks/useClickOutsideRef.ts @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {MutableRefObject, useEffect} from 'react'; +import type {MutableRefObject} from 'react'; +import {useEffect} from 'react'; export function useClickOutsideRef(ref: MutableRefObject, handler: (event: MouseEvent) => void): void { useEffect(() => { diff --git a/webapp/platform/components/src/common/hooks/useMeasurePunchouts.ts b/webapp/platform/components/src/common/hooks/useMeasurePunchouts.ts index f1a49851c0..ad17ad0649 100644 --- a/webapp/platform/components/src/common/hooks/useMeasurePunchouts.ts +++ b/webapp/platform/components/src/common/hooks/useMeasurePunchouts.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {useLayoutEffect, useMemo, useState} from 'react'; import throttle from 'lodash/throttle'; +import {useLayoutEffect, useMemo, useState} from 'react'; import {useElementAvailable} from './useElementAvailable'; diff --git a/webapp/platform/components/src/footer_pagination/footer_pagination.test.tsx b/webapp/platform/components/src/footer_pagination/footer_pagination.test.tsx index 840587b0d5..eea676e085 100644 --- a/webapp/platform/components/src/footer_pagination/footer_pagination.test.tsx +++ b/webapp/platform/components/src/footer_pagination/footer_pagination.test.tsx @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {render, screen} from '@testing-library/react'; +import React from 'react'; import {FooterPagination} from './footer_pagination'; -import {wrapIntl} from '../testUtils' + +import {wrapIntl} from '../testUtils'; describe('LegacyGenericModal/FooterPagination', () => { const baseProps = { @@ -28,7 +29,7 @@ describe('LegacyGenericModal/FooterPagination', () => { page: 0, total: 17, itemsPerPage: 10, - } + }; render(wrapIntl()); diff --git a/webapp/platform/components/src/generic_modal/generic_modal.test.tsx b/webapp/platform/components/src/generic_modal/generic_modal.test.tsx index 3a54b8ad19..6458f5a372 100644 --- a/webapp/platform/components/src/generic_modal/generic_modal.test.tsx +++ b/webapp/platform/components/src/generic_modal/generic_modal.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {render, screen} from '@testing-library/react'; +import React from 'react'; import {GenericModal} from './generic_modal'; + import {wrapIntl} from '../testUtils'; describe('GenericModal', () => { @@ -32,7 +33,7 @@ describe('GenericModal', () => { render( wrapIntl(), ); - + expect(screen.getByText('Confirm')).toBeInTheDocument(); expect(screen.getByText('Cancel')).toBeInTheDocument(); }); diff --git a/webapp/platform/components/src/generic_modal/generic_modal.tsx b/webapp/platform/components/src/generic_modal/generic_modal.tsx index eee5cc792f..033b3b79eb 100644 --- a/webapp/platform/components/src/generic_modal/generic_modal.tsx +++ b/webapp/platform/components/src/generic_modal/generic_modal.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; @@ -73,7 +73,7 @@ export class GenericModal extends React.PureComponent { onHide = () => { this.setState({show: false}); - } + }; handleCancel = (event: React.MouseEvent) => { event.preventDefault(); @@ -83,7 +83,7 @@ export class GenericModal extends React.PureComponent { if (this.props.handleCancel) { this.props.handleCancel(); } - } + }; handleConfirm = (event: React.MouseEvent) => { event.preventDefault(); @@ -93,7 +93,7 @@ export class GenericModal extends React.PureComponent { if (this.props.handleConfirm) { this.props.handleConfirm(); } - } + }; private onEnterKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Enter') { @@ -108,7 +108,7 @@ export class GenericModal extends React.PureComponent { } } this.props.handleKeydown?.(event); - } + }; render() { let confirmButton; diff --git a/webapp/platform/components/src/pulsating_dot/index.tsx b/webapp/platform/components/src/pulsating_dot/index.tsx index 092f695bdf..4d0491058b 100644 --- a/webapp/platform/components/src/pulsating_dot/index.tsx +++ b/webapp/platform/components/src/pulsating_dot/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import {Coords} from '../common/hooks/useMeasurePunchouts'; +import type {Coords} from '../common/hooks/useMeasurePunchouts'; import './pulsating_dot.scss'; diff --git a/webapp/platform/components/src/skeleton_loader/index.tsx b/webapp/platform/components/src/skeleton_loader/index.tsx index b3c93e27e9..e7b8ba37b1 100644 --- a/webapp/platform/components/src/skeleton_loader/index.tsx +++ b/webapp/platform/components/src/skeleton_loader/index.tsx @@ -4,14 +4,14 @@ import styled, {keyframes} from 'styled-components'; const skeletonFade = keyframes` - 0% { - background-color: rgba(var(--center-channel-color-rgb), 0.08); + 0% { + background-color: rgba(var(--center-channel-color-rgb), 0.08); } - 50% { - background-color: rgba(var(--center-channel-color-rgb), 0.16); + 50% { + background-color: rgba(var(--center-channel-color-rgb), 0.16); } - 100% { - background-color: rgba(var(--center-channel-color-rgb), 0.08); + 100% { + background-color: rgba(var(--center-channel-color-rgb), 0.08); } `; diff --git a/webapp/platform/components/src/testUtils.tsx b/webapp/platform/components/src/testUtils.tsx index f0bf865a40..7ae98ffd5b 100644 --- a/webapp/platform/components/src/testUtils.tsx +++ b/webapp/platform/components/src/testUtils.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react' -import {IntlProvider, createIntl} from 'react-intl' +import type {ReactNode} from 'react'; +import React from 'react'; +import {IntlProvider, createIntl} from 'react-intl'; export const defaultIntl = createIntl({ locale: 'en', defaultLocale: 'en', messages: {}, -}) +}); -export const wrapIntl = (children?: ReactNode) => {children} +export const wrapIntl = (children?: ReactNode) => {children}; diff --git a/webapp/platform/components/src/tour_tip/tour_tip.tsx b/webapp/platform/components/src/tour_tip/tour_tip.tsx index 7c0aecb38a..181c4241c0 100644 --- a/webapp/platform/components/src/tour_tip/tour_tip.tsx +++ b/webapp/platform/components/src/tour_tip/tour_tip.tsx @@ -1,21 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useRef, useState} from 'react'; -import {FormattedMessage} from 'react-intl'; import Tippy from '@tippyjs/react'; -import {Placement} from 'tippy.js'; import classNames from 'classnames'; +import React, {useRef} from 'react'; +import {FormattedMessage} from 'react-intl'; +import type {Placement} from 'tippy.js'; + +import {TourTipBackdrop} from './tour_tip_backdrop'; import type {Props as PunchOutCoordsHeightAndWidth} from '../common/hooks/useMeasurePunchouts'; +import {PulsatingDot} from '../pulsating_dot'; import 'tippy.js/dist/tippy.css'; import 'tippy.js/themes/light-border.css'; import 'tippy.js/animations/scale-subtle.css'; import 'tippy.js/animations/perspective-subtle.css'; -import {PulsatingDot} from '../pulsating_dot'; -import {TourTipBackdrop} from './tour_tip_backdrop'; import './tour_tip.scss'; export type TourTipEventSource = 'next' | 'prev' | 'dismiss' | 'jump' | 'skipped' | 'open' | 'punchOut' diff --git a/webapp/platform/eslint-plugin/configs/.eslintrc-react.json b/webapp/platform/eslint-plugin/configs/.eslintrc-react.json index 3b9590cd83..ad675f1af4 100644 --- a/webapp/platform/eslint-plugin/configs/.eslintrc-react.json +++ b/webapp/platform/eslint-plugin/configs/.eslintrc-react.json @@ -1,10 +1,17 @@ { "extends": [ - "plugin:react/recommended" + "plugin:react/recommended", + "plugin:react-hooks/recommended" ], "plugins": [ "react" ], + "settings": { + "react": { + "pragma": "React", + "version": "detect" + } + }, "rules": { "react/display-name": [ 0, @@ -39,7 +46,15 @@ 2, "never" ], - "react/jsx-filename-extension": 2, + "react/jsx-filename-extension": [ + 2, + { + "extensions": [ + ".jsx", + ".tsx" + ] + } + ], "react/jsx-first-prop-new-line": [ 2, "multiline" @@ -101,7 +116,7 @@ ], "react/no-render-return-value": 2, "react/no-set-state": 0, - "react/no-string-refs": 0, + "react/no-string-refs": 2, "react/no-unescaped-entities": 2, "react/no-unknown-property": 2, "react/no-unused-prop-types": [ diff --git a/webapp/platform/eslint-plugin/configs/.eslintrc.json b/webapp/platform/eslint-plugin/configs/.eslintrc.json index 07f349feb3..ced8373a54 100644 --- a/webapp/platform/eslint-plugin/configs/.eslintrc.json +++ b/webapp/platform/eslint-plugin/configs/.eslintrc.json @@ -1,6 +1,7 @@ { "extends": [ - "eslint:recommended" + "eslint:recommended", + "plugin:@typescript-eslint/recommended" ], "parserOptions": { "ecmaVersion": 8, @@ -11,9 +12,12 @@ "modules": true } }, - "parser": "babel-eslint", + "parser": "@typescript-eslint/parser", "plugins": [ - "header" + "@mattermost", + "@typescript-eslint", + "header", + "import" ], "env": { "browser": true, @@ -23,6 +27,59 @@ }, "rules": { "@mattermost/no-dispatch-getstate": 2, + "@mattermost/use-external-link": 2, + "@typescript-eslint/array-type": [2, {"default": "array-simple"}], + "@typescript-eslint/consistent-type-imports": ["error", {"disallowTypeAnnotations": false}], + "@typescript-eslint/explicit-function-return-type": 0, + "@typescript-eslint/explicit-module-boundary-types": 0, + "@typescript-eslint/indent": [ + 2, + 4, + { + "SwitchCase": 0 + } + ], + "@typescript-eslint/member-delimiter-style": 2, + "@typescript-eslint/naming-convention": [ + 2, + { + "selector": "function", + "format": ["camelCase", "PascalCase"] + }, + { + "selector": "variable", + "format": ["camelCase", "PascalCase", "UPPER_CASE"] + }, + { + "selector": "parameter", + "format": ["camelCase", "PascalCase"], + "leadingUnderscore": "allow" + }, + { + "selector": "typeLike", + "format": ["PascalCase"] + } + ], + "@typescript-eslint/no-dupe-class-members": 2, + "@typescript-eslint/no-empty-function": 0, + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unused-vars": [ + 2, + { + "vars": "all", + "args": "after-used" + } + ], + "@typescript-eslint/no-use-before-define": [ + 2, + { + "classes": false, + "functions": false, + "variables": false + } + ], + "@typescript-eslint/no-var-requires": 0, + "@typescript-eslint/type-annotation-spacing": 2, "array-bracket-spacing": [ 2, "never" @@ -48,12 +105,7 @@ "allowSingleLine": false } ], - "camelcase": [ - 2, - { - "properties": "never" - } - ], + "camelcase": 0, // Handled by @typescript-eslint/naming-convention "capitalized-comments": 0, "class-methods-use-this": 0, "comma-dangle": [ @@ -94,6 +146,7 @@ "object" ], "dot-notation": 2, + "eol-last": ["error", "always"], "eqeqeq": [ 2, "smart" @@ -123,16 +176,60 @@ "header/header": [ 2, "line", - " Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information." + " Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information.", + 2 ], "id-blacklist": 0, - "indent": [ + "import/no-duplicates": 2, + "import/no-unresolved": 0, // Handled better by TS + "import/order": [ 2, - 4, { - "SwitchCase": 0 + "newlines-between": "always", + "groups": [ + "builtin", + "external", + "internal", + "sibling", + "parent", + "index" + ], + "pathGroups": [ + { + "pattern": "@mattermost/**", + "group": "external", + "position": "after" + }, + { + "pattern": "mattermost-redux/**", + "group": "external", + "position": "after" + }, + { + "pattern": "@(selectors|actions|stores|store|reducers){,/**}", + "group": "external", + "position": "after" + }, + { + "pattern": "components/**", + "group": "external", + "position": "after" + }, + { + "pattern": "types{,/**}", + "group": "internal", + "position": "after" + } + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, + "distinctGroup": true, + "pathGroupsExcludedImportTypes": ["builtin"] } ], + "indent": 0, // Handled by @typescript-eslint/indent "jsx-quotes": [ 2, "prefer-single" @@ -165,19 +262,14 @@ } ], "max-lines": [ - 1, + "warn", { - "max": 450, + "max": 800, "skipBlankLines": true, "skipComments": false } ], - "max-nested-callbacks": [ - 2, - { - "max": 2 - } - ], + "max-nested-callbacks": ["error", 10], "max-statements-per-line": [ 2, { @@ -211,18 +303,13 @@ "no-debugger": 2, "no-div-regex": 2, "no-dupe-args": 2, - "no-dupe-class-members": 2, + "no-dupe-class-members": 0, // Handled by @typescript-eslint/no-dupe-class-members "no-dupe-keys": 2, "no-duplicate-case": 2, - "no-duplicate-imports": [ - 2, - { - "includeExports": true - } - ], + "no-duplicate-imports": 0, // Handled by import/no-duplicates "no-else-return": 2, "no-empty": 2, - "no-empty-function": 2, + "no-empty-function": 0, "no-empty-pattern": 2, "no-eval": 2, "no-ex-assign": 2, @@ -284,7 +371,33 @@ "no-process-exit": 2, "no-proto": 2, "no-prototype-builtins": 1, - "no-redeclare": 2, + "no-restricted-imports": [ + "error", + { + "patterns": [ + { + "group": ["@mattermost/compass-components/*"], + "message": "compass-components is now archived." + } + ], + "paths": [ + { + "name": "react-bootstrap", + "importNames": ["OverlayTrigger"], + "message": "Use OverlayTrigger from '/components/overlay_trigger' instead." + }, + { + "name": "redux", + "importNames": ["DeepPartial"], + "message": "Use DeepPartial from '@mattermost/types/utilities instead." + }, + { + "name": "lodash", + "message": "Import individual functions from lodash/ instead." + } + ] + } + ], "no-return-assign": [ 2, "always" @@ -299,12 +412,7 @@ ], "no-self-compare": 2, "no-sequences": 2, - "no-shadow": [ - 2, - { - "hoist": "functions" - } - ], + "no-shadow": 0, // This isn't currently enabled, but it probably should be "no-shadow-restricted-names": 2, "no-spaced-func": 2, "no-tabs": 0, @@ -319,7 +427,7 @@ } ], "no-undef-init": 2, - "no-undefined": 2, + "no-undefined": 0, "no-underscore-dangle": 2, "no-unexpected-multiline": 2, "no-unmodified-loop-condition": 2, @@ -333,21 +441,8 @@ "no-unsafe-finally": 2, "no-unsafe-negation": 2, "no-unused-expressions": 2, - "no-unused-vars": [ - 2, - { - "vars": "all", - "args": "after-used" - } - ], - "no-use-before-define": [ - 2, - { - "classes": false, - "functions": false, - "variables": false - } - ], + "no-unused-vars": 0, // Handled by @typescript-eslint/no-unused-vars + "no-use-before-define": 0, // Handled by @typescript-eslint/no-use-before-define "no-useless-computed-key": 2, "no-useless-concat": 2, "no-useless-constructor": 2, @@ -475,14 +570,14 @@ "exceptRange": false, "onlyEquality": false } - ], - "@typescript-eslint/array-type": [2, {"default": "array-simple"}], - "@typescript-eslint/member-delimiter-style": 2, - "@typescript-eslint/type-annotation-spacing": 2 + ] }, "overrides": [ { - "files": ["*.test.js", "*.test.jsx", "*.test.ts", "*.test.tsx", "tests/**"], + "files": ["*.test.*", "src/tests/**"], + "env": { + "jest": true + }, "globals": { "after": true, "afterAll": true, @@ -497,10 +592,14 @@ "test": true }, "rules": { - "no-empty-function": 0, + "func-names": 0, + "global-require": 0, "no-console": 0, + "no-import-assign": 0, + "max-lines": 0, "max-nested-callbacks": 0, - "no-undefined": 0 + "new-cap": 0, + "prefer-arrow-callback": 0 } } ] diff --git a/webapp/platform/eslint-plugin/package.json b/webapp/platform/eslint-plugin/package.json index a8b94a7c2a..3ecf4c84da 100644 --- a/webapp/platform/eslint-plugin/package.json +++ b/webapp/platform/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@mattermost/eslint-plugin", - "version": "1.0.0", + "version": "1.1.0", "description": "ESLint configuration and custom rules used by Mattermost", "repository": { "type": "git", @@ -12,17 +12,23 @@ "homepage": "https://github.com/mattermost/mattermost/tree/master/webapp/platform/eslint-plugin#readme", "main": "index.js", "dependencies": { + "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/parser": "^7.1.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", "jsx-ast-utils": "^3.3.3" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.57.1", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-react": "^7.33.2" + "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react-hooks": "^4.6.0" }, "peerDependenciesMeta": { "eslint-plugin-react": { "optional": true + }, + "eslint-plugin-react-hooks": { + "optional": true } } } diff --git a/webapp/platform/types/.eslintrc.json b/webapp/platform/types/.eslintrc.json new file mode 100644 index 0000000000..f8c36a3bed --- /dev/null +++ b/webapp/platform/types/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "plugin:@mattermost/base" + ] +} diff --git a/webapp/platform/types/package.json b/webapp/platform/types/package.json index 2960af35a5..463e0ad67a 100644 --- a/webapp/platform/types/package.json +++ b/webapp/platform/types/package.json @@ -38,7 +38,8 @@ }, "scripts": { "build": "tsc --build --verbose", + "check": "eslint --ext .js,.jsx,.tsx,.ts ./src --quiet", "run": "tsc --watch --preserveWatchOutput", - "clean": "rm -rf tsconfig.tsbuildinfo ./lib" + "clean": "rm -rf lib *.tsbuildinfo" } } diff --git a/webapp/platform/types/src/admin.ts b/webapp/platform/types/src/admin.ts index 6b56817db5..9a5af054b7 100644 --- a/webapp/platform/types/src/admin.ts +++ b/webapp/platform/types/src/admin.ts @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Audit} from './audits'; -import {Compliance} from './compliance'; -import {AdminConfig, AllowedIPRange, ClientLicense, EnvironmentConfig} from './config'; -import {DataRetentionCustomPolicies} from './data_retention'; -import {MixedUnlinkedGroupRedux} from './groups'; -import {PluginRedux, PluginStatusRedux} from './plugins'; -import {SamlCertificateStatus, SamlMetadataResponse} from './saml'; -import {Team} from './teams'; -import {UserAccessToken, UserProfile} from './users'; -import {RelationOneToOne} from './utilities'; +import type {Audit} from './audits'; +import type {Compliance} from './compliance'; +import type {AdminConfig, ClientLicense, EnvironmentConfig} from './config'; +import type {DataRetentionCustomPolicies} from './data_retention'; +import type {MixedUnlinkedGroupRedux} from './groups'; +import type {PluginRedux, PluginStatusRedux} from './plugins'; +import type {SamlCertificateStatus, SamlMetadataResponse} from './saml'; +import type {Team} from './teams'; +import type {UserAccessToken, UserProfile} from './users'; +import type {RelationOneToOne} from './utilities'; export enum LogLevelEnum { SILLY = 'silly', diff --git a/webapp/platform/types/src/apps.ts b/webapp/platform/types/src/apps.ts index f273be012d..900733f098 100644 --- a/webapp/platform/types/src/apps.ts +++ b/webapp/platform/types/src/apps.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ProductScope} from './products'; +import type {ProductScope} from './products'; export enum Permission { UserJoinedChannelNotification = 'user_joined_channel_notification', diff --git a/webapp/platform/types/src/autocomplete.ts b/webapp/platform/types/src/autocomplete.ts index cc36e42e71..e79ba00a4d 100644 --- a/webapp/platform/types/src/autocomplete.ts +++ b/webapp/platform/types/src/autocomplete.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {UserProfile} from './users'; +import type {UserProfile} from './users'; export type UserAutocomplete = { users: UserProfile[]; diff --git a/webapp/platform/types/src/channel_categories.ts b/webapp/platform/types/src/channel_categories.ts index ef1e4fbf29..677739c8b9 100644 --- a/webapp/platform/types/src/channel_categories.ts +++ b/webapp/platform/types/src/channel_categories.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Channel} from './channels'; -import {Team} from './teams'; -import {UserProfile} from './users'; -import {IDMappedObjects, RelationOneToOne} from './utilities'; +import type {Channel} from './channels'; +import type {Team} from './teams'; +import type {UserProfile} from './users'; +import type {IDMappedObjects, RelationOneToOne} from './utilities'; export type ChannelCategoryType = 'favorites' | 'channels' | 'direct_messages' | 'custom'; diff --git a/webapp/platform/types/src/channels.ts b/webapp/platform/types/src/channels.ts index ea582210ff..80f5665321 100644 --- a/webapp/platform/types/src/channels.ts +++ b/webapp/platform/types/src/channels.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {IDMappedObjects, RelationOneToManyUnique, RelationOneToOne} from './utilities'; -import {Team} from './teams'; +import type {Team} from './teams'; +import type {IDMappedObjects, RelationOneToManyUnique, RelationOneToOne} from './utilities'; // e.g. // **O**pen channel, diff --git a/webapp/platform/types/src/cloud.ts b/webapp/platform/types/src/cloud.ts index b8a8feb7b4..039ba61766 100644 --- a/webapp/platform/types/src/cloud.ts +++ b/webapp/platform/types/src/cloud.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AllowedIPRange} from './config'; -import {ValueOf} from './utilities'; +import type {AllowedIPRange} from './config'; +import type {ValueOf} from './utilities'; export type CloudState = { subscription?: Subscription; diff --git a/webapp/platform/types/src/config.ts b/webapp/platform/types/src/config.ts index cb9eabebf8..4f8651806c 100644 --- a/webapp/platform/types/src/config.ts +++ b/webapp/platform/types/src/config.ts @@ -1,8 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -/* eslint-disable max-lines */ - export type ClientConfig = { AboutLink: string; AllowBannerDismissal: string; @@ -838,7 +836,7 @@ export type DataRetentionSettings = { FileRetentionHours: number; DeletionJobStartTime: string; BatchSize: number; - EnableBoardsDeletion: boolean, + EnableBoardsDeletion: boolean; BoardsRetentionDays: number; TimeBetweenBatchesMilliseconds: number; RetentionIdsBatchSize: number; @@ -869,8 +867,7 @@ export type JobSettings = { CleanupConfigThresholdDays: number; }; -export type ProductSettings = { -}; +export type ProductSettings = Record; export type PluginSettings = { Enable: boolean; @@ -1008,7 +1005,6 @@ export enum ServiceEnvironment { DEV = 'dev', } - export type AllowedIPRange = { cidr_block: string; description: string; diff --git a/webapp/platform/types/src/drafts.ts b/webapp/platform/types/src/drafts.ts index 2a8e3cc9ba..9403631894 100644 --- a/webapp/platform/types/src/drafts.ts +++ b/webapp/platform/types/src/drafts.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PostMetadata, PostPriorityMetadata} from './posts'; +import type {PostMetadata, PostPriorityMetadata} from './posts'; export type Draft = { create_at: number; diff --git a/webapp/platform/types/src/general.ts b/webapp/platform/types/src/general.ts index 1378afd407..459ecb5700 100644 --- a/webapp/platform/types/src/general.ts +++ b/webapp/platform/types/src/general.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ClientConfig, ClientLicense, WarnMetricStatus} from './config'; +import type {ClientConfig, ClientLicense} from './config'; export type GeneralState = { config: Partial; diff --git a/webapp/platform/types/src/groups.ts b/webapp/platform/types/src/groups.ts index 52056924eb..1d50c52e71 100644 --- a/webapp/platform/types/src/groups.ts +++ b/webapp/platform/types/src/groups.ts @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {UserProfile} from './users'; - -import {RelationOneToOne} from './utilities'; +import type {UserProfile} from './users'; +import type {RelationOneToOne} from './utilities'; export enum SyncableType { Team = 'team', diff --git a/webapp/platform/types/src/hosted_customer.ts b/webapp/platform/types/src/hosted_customer.ts index 8b3a7099f7..bc2e76c269 100644 --- a/webapp/platform/types/src/hosted_customer.ts +++ b/webapp/platform/types/src/hosted_customer.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import type {Address, Product, Invoice} from './cloud'; -import {ValueOf} from './utilities'; +import type {ValueOf} from './utilities'; export const SelfHostedSignupProgress = { START: 'START', diff --git a/webapp/platform/types/src/integrations.ts b/webapp/platform/types/src/integrations.ts index 8681ad233b..4e9d9725d0 100644 --- a/webapp/platform/types/src/integrations.ts +++ b/webapp/platform/types/src/integrations.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {MessageAttachment} from './message_attachments'; -import {IDMappedObjects} from './utilities'; +import type {MessageAttachment} from './message_attachments'; +import type {IDMappedObjects} from './utilities'; export type IncomingWebhook = { id: string; diff --git a/webapp/platform/types/src/jobs.ts b/webapp/platform/types/src/jobs.ts index a6c24405db..5c232d369d 100644 --- a/webapp/platform/types/src/jobs.ts +++ b/webapp/platform/types/src/jobs.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {IDMappedObjects} from './utilities'; +import type {IDMappedObjects} from './utilities'; export type JobType = 'data_retention' | 'elasticsearch_post_indexing' | 'bleve_post_indexing' | 'ldap_sync' | 'message_export'; export type JobStatus = 'pending' | 'in_progress' | 'success' | 'error' | 'cancel_requested' | 'canceled' | 'warning'; diff --git a/webapp/platform/types/src/marketplace.ts b/webapp/platform/types/src/marketplace.ts index 9a16d12888..1af5761665 100644 --- a/webapp/platform/types/src/marketplace.ts +++ b/webapp/platform/types/src/marketplace.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PluginManifest} from './plugins'; -import {AppManifest} from './apps'; +import type {AppManifest} from './apps'; +import type {PluginManifest} from './plugins'; export type MarketplaceLabel = { name: string; diff --git a/webapp/platform/types/src/message_attachments.ts b/webapp/platform/types/src/message_attachments.ts index 6bf723f09b..cad6ec95a2 100644 --- a/webapp/platform/types/src/message_attachments.ts +++ b/webapp/platform/types/src/message_attachments.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PostAction} from './integration_actions'; +import type {PostAction} from './integration_actions'; export type MessageAttachment = { id: number; diff --git a/webapp/platform/types/src/posts.ts b/webapp/platform/types/src/posts.ts index 520169dbb8..d12723a1f1 100644 --- a/webapp/platform/types/src/posts.ts +++ b/webapp/platform/types/src/posts.ts @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Channel, ChannelType} from './channels'; -import {CustomEmoji} from './emojis'; -import {FileInfo} from './files'; -import {Reaction} from './reactions'; -import { TeamType } from './teams'; -import {UserProfile} from './users'; -import { +import type {Channel, ChannelType} from './channels'; +import type {CustomEmoji} from './emojis'; +import type {FileInfo} from './files'; +import type {Reaction} from './reactions'; +import type {TeamType} from './teams'; +import type {UserProfile} from './users'; +import type { RelationOneToOne, RelationOneToMany, IDMappedObjects, diff --git a/webapp/platform/types/src/reports.ts b/webapp/platform/types/src/reports.ts index 96f75e2d5a..fe0beb6aaa 100644 --- a/webapp/platform/types/src/reports.ts +++ b/webapp/platform/types/src/reports.ts @@ -1,27 +1,27 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {UserProfile} from './users'; +import type {UserProfile} from './users'; export enum UserReportSortColumns { - username = "Username", - email = "Email", - createAt = "CreateAt", - firstName = "FirstName", - lastName = "LastName", - nickname = "Nickname", + username = 'Username', + email = 'Email', + createAt = 'CreateAt', + firstName = 'FirstName', + lastName = 'LastName', + nickname = 'Nickname', } export enum ReportSortDirection { - ascending = "asc", - descending = "desc", + ascending = 'asc', + descending = 'desc', } export enum ReportDuration { - AllTime = "all_time", - Last30Days = "last_30_days", - PreviousMonth = "previous_month", - Last6Months = "last_6_months", + AllTime = 'all_time', + Last30Days = 'last_30_days', + PreviousMonth = 'previous_month', + Last6Months = 'last_6_months', } export enum CursorPaginationDirection { @@ -30,12 +30,12 @@ export enum CursorPaginationDirection { } export type UserReportFilter = { - role_filter?: string, - has_no_team?: boolean, - team_filter?: string, - hide_active?: boolean, - hide_inactive?: boolean, - search_term?: string, + role_filter?: string; + has_no_team?: boolean; + team_filter?: string; + hide_active?: boolean; + hide_inactive?: boolean; + search_term?: string; } export type UserReportOptions = UserReportFilter & { @@ -55,8 +55,8 @@ export type UserReportOptions = UserReportFilter & { // Following are optional pagination parameters /** * The direction to paginate in. Either "up" or "down". Use the CursorPaginationDirection enum. - */ - direction?: CursorPaginationDirection, + */ + direction?: CursorPaginationDirection; /** * The cursor to paginate from. @@ -77,8 +77,8 @@ export type UserReportOptions = UserReportFilter & { export type UserReport = UserProfile & { last_login_at: number; - last_status_at?: number; - last_post_date?: number; - days_active?: number; - total_posts?: number; + last_status_at?: number; + last_post_date?: number; + days_active?: number; + total_posts?: number; } diff --git a/webapp/platform/types/src/sessions.ts b/webapp/platform/types/src/sessions.ts index 301153ae7a..5ead0edea9 100644 --- a/webapp/platform/types/src/sessions.ts +++ b/webapp/platform/types/src/sessions.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {TeamMembership} from './teams'; +import type {TeamMembership} from './teams'; export type Session = { id: string; diff --git a/webapp/platform/types/src/store.ts b/webapp/platform/types/src/store.ts index 8fcbe01a4a..a0cf50e1a3 100644 --- a/webapp/platform/types/src/store.ts +++ b/webapp/platform/types/src/store.ts @@ -1,35 +1,35 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AdminState} from './admin'; -import {Bot} from './bots'; -import {ChannelsState} from './channels'; -import {ChannelCategoriesState} from './channel_categories'; -import {CloudState, CloudUsage} from './cloud'; -import {HostedCustomerState} from './hosted_customer'; -import {EmojisState} from './emojis'; -import {FilesState} from './files'; -import {GeneralState} from './general'; -import {GroupsState} from './groups'; -import {IntegrationsState} from './integrations'; -import {JobsState} from './jobs'; -import {PostsState} from './posts'; -import {PreferenceType} from './preferences'; -import { +import type {AdminState} from './admin'; +import type {AppsState} from './apps'; +import type {Bot} from './bots'; +import type {ChannelCategoriesState} from './channel_categories'; +import type {ChannelsState} from './channels'; +import type {CloudState, CloudUsage} from './cloud'; +import type {EmojisState} from './emojis'; +import type {FilesState} from './files'; +import type {GeneralState} from './general'; +import type {GroupsState} from './groups'; +import type {HostedCustomerState} from './hosted_customer'; +import type {IntegrationsState} from './integrations'; +import type {JobsState} from './jobs'; +import type {LimitsState} from './limits'; +import type {PostsState} from './posts'; +import type {PreferenceType} from './preferences'; +import type { AdminRequestsStatuses, ChannelsRequestsStatuses, FilesRequestsStatuses, GeneralRequestsStatuses, PostsRequestsStatuses, RolesRequestsStatuses, TeamsRequestsStatuses, UsersRequestsStatuses, } from './requests'; -import {Role} from './roles'; -import {SchemesState} from './schemes'; -import {SearchState} from './search'; -import {TeamsState} from './teams'; -import {ThreadsState} from './threads'; -import {Typing} from './typing'; -import {UsersState} from './users'; -import {AppsState} from './apps'; -import {LimitsState} from './limits'; +import type {Role} from './roles'; +import type {SchemesState} from './schemes'; +import type {SearchState} from './search'; +import type {TeamsState} from './teams'; +import type {ThreadsState} from './threads'; +import type {Typing} from './typing'; +import type {UsersState} from './users'; export type GlobalState = { entities: { diff --git a/webapp/platform/types/src/teams.ts b/webapp/platform/types/src/teams.ts index e1be73fbad..3f8379a3ec 100644 --- a/webapp/platform/types/src/teams.ts +++ b/webapp/platform/types/src/teams.ts @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ServerError} from './errors'; -import {UserProfile} from './users'; -import {RelationOneToOne} from './utilities'; +import type {ServerError} from './errors'; +import type {UserProfile} from './users'; +import type {RelationOneToOne} from './utilities'; export type TeamMembership = TeamUnread & { user_id: string; diff --git a/webapp/platform/types/src/threads.ts b/webapp/platform/types/src/threads.ts index 593fa6ddb4..50fc903c46 100644 --- a/webapp/platform/types/src/threads.ts +++ b/webapp/platform/types/src/threads.ts @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {Channel} from './channels'; import type {Post} from './posts'; import type {Team} from './teams'; -import type {Channel} from './channels'; import type {UserProfile} from './users'; import type {IDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; diff --git a/webapp/platform/types/src/users.ts b/webapp/platform/types/src/users.ts index a792f4705a..1d69f6c605 100644 --- a/webapp/platform/types/src/users.ts +++ b/webapp/platform/types/src/users.ts @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Audit} from './audits'; -import {Channel} from './channels'; -import {Group} from './groups'; -import {Session} from './sessions'; -import {Team} from './teams'; -import {IDMappedObjects, RelationOneToMany, RelationOneToManyUnique, RelationOneToOne} from './utilities'; +import type {Audit} from './audits'; +import type {Channel} from './channels'; +import type {Group} from './groups'; +import type {Session} from './sessions'; +import type {Team} from './teams'; +import type {IDMappedObjects, RelationOneToManyUnique, RelationOneToOne} from './utilities'; export type UserNotifyProps = { desktop: 'default' | 'all' | 'mention' | 'none'; diff --git a/webapp/platform/types/src/utilities.ts b/webapp/platform/types/src/utilities.ts index 9515d5d174..282cfe50a9 100644 --- a/webapp/platform/types/src/utilities.ts +++ b/webapp/platform/types/src/utilities.ts @@ -14,17 +14,23 @@ export type RelationOneToManyUnique = RelationOneToOne; export type DeepPartial = { + // For each field of T, make it optional and... - [K in keyof T]?: + [K in keyof T]?: ( + // If that field is a Set or a Map, don't go further T[K] extends Set ? T[K] : - T[K] extends Map ? T[K] : - // If that field is an object, make it a deep partial object - T[K] extends object ? DeepPartial : - // Else if that field is an optional object, make that a deep partial object - T[K] extends object | undefined ? DeepPartial : - // Else leave it as an optional primitive - T[K]; + T[K] extends Map ? T[K] : + + // If that field is an object, make it a deep partial object + T[K] extends object ? DeepPartial : + + // Else if that field is an optional object, make that a deep partial object + T[K] extends object | undefined ? DeepPartial : + + // Else leave it as an optional primitive + T[K] + ); } export type ValueOf = T[keyof T];