Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(lint) update to eslint-config-jitsi v6
Saúl Ibarra Corretgé3d4defd79942
diff --git a/.eslintignore b/.eslintignoreindex ab02099b5d..e37ebe8b6a 100644--- a/.eslintignore+++ b/.eslintignore@@ -17,3 +17,8 @@ react/features/face-landmarks/resources/*# Not worth it.actionTypes.ts++# It's not complete until all files are copied at build time.+react-native-sdk/++*.d.tsdiff --git a/.eslintrc.js b/.eslintrc.jsindex 0356dd2b8d..9401eb3be2 100644--- a/.eslintrc.js+++ b/.eslintrc.js@@ -1,6 +1,5 @@module.exports = {- 'extends': [+ extends: ['@jitsi/eslint-config'- ],- 'ignorePatterns': [ '*.d.ts' ]+ ]};diff --git a/app.js b/app.jsindex a1053d7e9d..4505556f24 100644--- a/app.js+++ b/app.js@@ -10,6 +10,32 @@ import '@matrix-org/olm';import 'focus-visible';+/*+* Safari polyfill for createImageBitmap+* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap+*+* Support source image types: Canvas.+*/+if (!('createImageBitmap' in window)) {+ window.createImageBitmap = function(data) {+ return new Promise((resolve, reject) => {+ let dataURL;++ if (data instanceof HTMLCanvasElement) {+ dataURL = data.toDataURL();+ } else {+ reject(new Error('createImageBitmap does not handle the provided image source type'));+ }+ const img = document.createElement('img');++ img.addEventListener('load', () => {+ resolve(img);+ });+ img.src = dataURL;+ });+ };+}+// We need to setup the jitsi-local-storage as early as possible so that we can start using it.// NOTE: If jitsi-local-storage is used before the initial setup is performed this will break the use case when we use// the local storage from the parent page when the localStorage is disabled. Also the setup is relying thatdiff --git a/conference.js b/conference.jsindex 662598c0d6..951ce73b61 100644--- a/conference.js+++ b/conference.js@@ -601,7 +601,7 @@ export default {const { tryCreateLocalTracks, errors } = this.createInitialLocalTracks(initialOptions, true);- tryCreateLocalTracks.then(async tr => {+ tryCreateLocalTracks.then(tr => {const createLocalTracksEnd = window.performance.now();connectionTimes['conference.init.createLocalTracks.end'] = createLocalTracksEnd;diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.jsindex d5cd5e587e..873f65df6f 100644--- a/modules/API/external/external_api.js+++ b/modules/API/external/external_api.js@@ -676,7 +676,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {** @returns {Object} Rooms info.*/- async getRoomsInfo() {+ getRoomsInfo() {return this._transport.sendRequest({name: 'rooms-info'});@@ -687,7 +687,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {** @returns {Object} Rooms info.*/- async getSharedDocumentUrl() {+ getSharedDocumentUrl() {return this._transport.sendRequest({name: 'get-shared-document-url'});diff --git a/package-lock.json b/package-lock.jsonindex a798dc1168..283bc32dfe 100644--- a/package-lock.json+++ b/package-lock.json@@ -123,13 +123,11 @@},"devDependencies": {"@babel/core": "7.25.9",- "@babel/eslint-parser": "7.25.9","@babel/plugin-transform-private-methods": "7.25.9","@babel/preset-env": "7.25.9","@babel/preset-react": "7.25.9",- "@jitsi/eslint-config": "5.0.9",+ "@jitsi/eslint-config": "6.0.1","@react-native/metro-config": "0.75.5",- "@stylistic/eslint-plugin": "2.12.1","@types/amplitude-js": "8.16.5","@types/audioworklet": "0.0.29","@types/dom-screen-wake-lock": "1.0.1",@@ -155,8 +153,6 @@"@types/w3c-image-capture": "1.0.6","@types/w3c-web-hid": "1.0.3","@types/zxcvbn": "4.4.1",- "@typescript-eslint/eslint-plugin": "8.19.1",- "@typescript-eslint/parser": "8.19.1","@wdio/allure-reporter": "9.4.3","@wdio/cli": "9.4.3","@wdio/globals": "9.4.3",@@ -4152,14 +4148,20 @@}},"node_modules/@jitsi/eslint-config": {- "version": "5.0.9",- "resolved": "https://registry.npmjs.org/@jitsi/eslint-config/-/eslint-config-5.0.9.tgz",- "integrity": "sha512-Xs44+Q8dU3dYvHuDYbcYWUwEwsGIWFD8tAX2WdtTihtaTkmzYBt74Piiyqe3qQSp1CYIfr85wl30BFf5oTZtXg==",+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/@jitsi/eslint-config/-/eslint-config-6.0.1.tgz",+ "integrity": "sha512-Y7Bkcx7NK4ctYKVX57zS51Z7Ak2jtoYctr/Xso5Gh1E/Gl32KipTkF5Fg142qo1x2KH/ossk/P1emdqTHBnAWQ==","dev": true,"license": "Apache-2.0",- "peerDependencies": {- "@babel/eslint-parser": ">= 7",- "eslint": ">= 8"+ "dependencies": {+ "@babel/eslint-parser": "^7.25.9",+ "@stylistic/eslint-plugin": "^2.12.1",+ "@typescript-eslint/eslint-plugin": "^8.19.1",+ "@typescript-eslint/parser": "^8.19.1",+ "eslint": "^8.57.0",+ "eslint-plugin-import": "^2.31.0",+ "eslint-plugin-jsdoc": "^50.6.1",+ "eslint-plugin-typescript-sort-keys": "^3.3.0"}},"node_modules/@jitsi/excalidraw": {@@ -28330,10 +28332,20 @@}},"@jitsi/eslint-config": {- "version": "5.0.9",- "resolved": "https://registry.npmjs.org/@jitsi/eslint-config/-/eslint-config-5.0.9.tgz",- "integrity": "sha512-Xs44+Q8dU3dYvHuDYbcYWUwEwsGIWFD8tAX2WdtTihtaTkmzYBt74Piiyqe3qQSp1CYIfr85wl30BFf5oTZtXg==",- "dev": true+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/@jitsi/eslint-config/-/eslint-config-6.0.1.tgz",+ "integrity": "sha512-Y7Bkcx7NK4ctYKVX57zS51Z7Ak2jtoYctr/Xso5Gh1E/Gl32KipTkF5Fg142qo1x2KH/ossk/P1emdqTHBnAWQ==",+ "dev": true,+ "requires": {+ "@babel/eslint-parser": "^7.25.9",+ "@stylistic/eslint-plugin": "^2.12.1",+ "@typescript-eslint/eslint-plugin": "^8.19.1",+ "@typescript-eslint/parser": "^8.19.1",+ "eslint": "^8.57.0",+ "eslint-plugin-import": "^2.31.0",+ "eslint-plugin-jsdoc": "^50.6.1",+ "eslint-plugin-typescript-sort-keys": "^3.3.0"+ }},"@jitsi/excalidraw": {"version": "https://github.com/jitsi/excalidraw/releases/download/v0.0.19/jitsi-excalidraw-0.0.19.tgz",diff --git a/package.json b/package.jsonindex 46b834aade..6a8ca8ee54 100644--- a/package.json+++ b/package.json@@ -129,13 +129,11 @@},"devDependencies": {"@babel/core": "7.25.9",- "@babel/eslint-parser": "7.25.9","@babel/plugin-transform-private-methods": "7.25.9","@babel/preset-env": "7.25.9","@babel/preset-react": "7.25.9",- "@jitsi/eslint-config": "5.0.9",+ "@jitsi/eslint-config": "6.0.1","@react-native/metro-config": "0.75.5",- "@stylistic/eslint-plugin": "2.12.1","@types/amplitude-js": "8.16.5","@types/audioworklet": "0.0.29","@types/dom-screen-wake-lock": "1.0.1",@@ -161,8 +159,6 @@"@types/w3c-image-capture": "1.0.6","@types/w3c-web-hid": "1.0.3","@types/zxcvbn": "4.4.1",- "@typescript-eslint/eslint-plugin": "8.19.1",- "@typescript-eslint/parser": "8.19.1","@wdio/allure-reporter": "9.4.3","@wdio/cli": "9.4.3","@wdio/globals": "9.4.3",diff --git a/react-native-sdk/update_dependencies.js b/react-native-sdk/update_dependencies.jsindex 970ceff0d9..fb829c26be 100644--- a/react-native-sdk/update_dependencies.js+++ b/react-native-sdk/update_dependencies.js@@ -1,4 +1,4 @@-/* eslint-disable guard-for-in, no-continue */+/* eslint-disable guard-for-in *//* global __dirname */const fs = require('fs');diff --git a/react/.eslintrc-react-native.js b/react/.eslintrc-react-native.jsindex 9e7db876c8..3e48436080 100644--- a/react/.eslintrc-react-native.js+++ b/react/.eslintrc-react-native.js@@ -1,12 +1,11 @@module.exports = {- 'plugins': [+ plugins: ['react-native'],- 'rules': {+ rules: {'react-native/no-color-literals': 2,'react-native/no-inline-styles': 2,'react-native/no-unused-styles': 2,'react-native/split-platform-components': 2}};-diff --git a/react/.eslintrc.js b/react/.eslintrc.jsindex d37101f1ae..0a32a579ab 100644--- a/react/.eslintrc.js+++ b/react/.eslintrc.js@@ -1,29 +1,27 @@module.exports = {- 'extends': [+ extends: ['../.eslintrc.js','@jitsi/eslint-config/jsdoc','@jitsi/eslint-config/react','.eslintrc-react-native.js'],- 'overrides': [+ overrides: [{- 'files': [ '*.ts', '*.tsx' ],+ files: [ '*.ts', '*.tsx' ],extends: [ '@jitsi/eslint-config/typescript' ],parserOptions: {- sourceType: 'module',project: [ './tsconfig.web.json', './tsconfig.native.json' ]},rules: {// TODO: Remove these and fix the warnings'@typescript-eslint/no-unsafe-function-type': 0,'@typescript-eslint/no-wrapper-object-types': 0,-'@typescript-eslint/no-require-imports': 0}}],- 'settings': {- 'react': {+ settings: {+ react: {'version': 'detect'}}diff --git a/react/features/face-landmarks/FaceLandmarksDetector.ts b/react/features/face-landmarks/FaceLandmarksDetector.tsindex c2c81f158d..a7effad47a 100644--- a/react/features/face-landmarks/FaceLandmarksDetector.ts+++ b/react/features/face-landmarks/FaceLandmarksDetector.ts@@ -1,5 +1,4 @@import 'image-capture';-import './createImageBitmap';import { IStore } from '../app/types';import { isMobileBrowser } from '../base/environment/utils';import { getLocalVideoTrack } from '../base/tracks/functions';diff --git a/react/features/face-landmarks/actions.ts b/react/features/face-landmarks/actions.tsindex d016d9dcc9..16ef5597a7 100644--- a/react/features/face-landmarks/actions.ts+++ b/react/features/face-landmarks/actions.ts@@ -1,5 +1,4 @@import 'image-capture';-import './createImageBitmap';import { AnyAction } from 'redux';import {diff --git a/react/features/face-landmarks/createImageBitmap.ts b/react/features/face-landmarks/createImageBitmap.tsdeleted file mode 100644index d78a769a70..0000000000--- a/react/features/face-landmarks/createImageBitmap.ts+++ /dev/null@@ -1,31 +0,0 @@-/*-* Safari < 15 polyfill for createImageBitmap-* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap-*-* Support source image types: Canvas.-*/-// @ts-nocheck-if (!('createImageBitmap' in window)) {- window.createImageBitmap = async function(data) {- return new Promise((resolve, reject) => {- let dataURL;-- if (data instanceof HTMLCanvasElement) {- dataURL = data.toDataURL();- } else {- reject(new Error('createImageBitmap does not handle the provided image source type'));- }- const img = document.createElement('img');-- img.close = () => {- // empty- };-- img.addEventListener('load', () => {- resolve(img);- });-- img.src = dataURL;- });- };-}diff --git a/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.tsx b/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.tsxindex d0d0407c65..a13c9d1c35 100644--- a/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.tsx+++ b/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.tsx@@ -176,7 +176,6 @@ class AudioRoutePickerDialog extends Component<IProps, IState> {// Skip devices with unknown type.if (!infoMap) {- // eslint-disable-next-line no-continuecontinue;}diff --git a/react/features/screenshot-capture/ScreenshotCaptureSummary.tsx b/react/features/screenshot-capture/ScreenshotCaptureSummary.tsxindex 94347c3687..c74b6a23b8 100644--- a/react/features/screenshot-capture/ScreenshotCaptureSummary.tsx+++ b/react/features/screenshot-capture/ScreenshotCaptureSummary.tsx@@ -1,5 +1,4 @@import 'image-capture';-import './createImageBitmap';import { createScreensharingCaptureTakenEvent } from '../analytics/AnalyticsEvents';import { sendAnalytics } from '../analytics/functions';diff --git a/react/features/screenshot-capture/createImageBitmap.js b/react/features/screenshot-capture/createImageBitmap.jsdeleted file mode 100644index 89f159ba00..0000000000--- a/react/features/screenshot-capture/createImageBitmap.js+++ /dev/null@@ -1,25 +0,0 @@-/*-* Safari polyfill for createImageBitmap-* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap-*-* Support source image types: Canvas.-*/-if (!('createImageBitmap' in window)) {- window.createImageBitmap = async function(data) {- return new Promise((resolve, reject) => {- let dataURL;-- if (data instanceof HTMLCanvasElement) {- dataURL = data.toDataURL();- } else {- reject(new Error('createImageBitmap does not handle the provided image source type'));- }- const img = document.createElement('img');-- img.addEventListener('load', () => {- resolve(img);- });- img.src = dataURL;- });- };-}diff --git a/react/features/screenshot-capture/processScreenshot.js b/react/features/screenshot-capture/processScreenshot.jsindex 4756dfc98a..0e59cbcab5 100644--- a/react/features/screenshot-capture/processScreenshot.js+++ b/react/features/screenshot-capture/processScreenshot.js@@ -6,5 +6,5 @@* @returns {Promise<void>}*/export async function processScreenshot(imageBlob, options) { // eslint-disable-line no-unused-vars- return;+ return await Promise.resolve();}diff --git a/react/features/toolbox/subscriber.web.ts b/react/features/toolbox/subscriber.web.tsindex fa12e6b45c..a6f68c9e42 100644--- a/react/features/toolbox/subscriber.web.ts+++ b/react/features/toolbox/subscriber.web.ts@@ -56,7 +56,6 @@ const checkToolboxOverlap = (clientHeight: number, store: IStore) => {const indicatorsRect = tile?.querySelector('.bottom-indicators')?.getBoundingClientRect();if (!indicatorsRect) {- // eslint-disable-next-line no-continuecontinue;}diff --git a/webpack.config.js b/webpack.config.jsindex 65d0a24d44..cde1e404f3 100644--- a/webpack.config.js+++ b/webpack.config.js@@ -280,7 +280,7 @@ module.exports = (_env, argv) => {};return [- Object.assign({}, config, {+ { ...config,entry: {'app.bundle': './app.js'},@@ -301,10 +301,8 @@ module.exports = (_env, argv) => {})],- performance: getPerformanceHints(perfHintOptions, 5 * 1024 * 1024)-- }),- Object.assign({}, config, {+ performance: getPerformanceHints(perfHintOptions, 5 * 1024 * 1024) },+ { ...config,entry: {'alwaysontop': './react/features/always-on-top/index.tsx'},@@ -312,9 +310,8 @@ module.exports = (_env, argv) => {...config.plugins,...getBundleAnalyzerPlugin(analyzeBundle, 'alwaysontop')],- performance: getPerformanceHints(perfHintOptions, 800 * 1024)- }),- Object.assign({}, config, {+ performance: getPerformanceHints(perfHintOptions, 800 * 1024) },+ { ...config,entry: {'close3': './static/close3.js'},@@ -322,24 +319,21 @@ module.exports = (_env, argv) => {...config.plugins,...getBundleAnalyzerPlugin(analyzeBundle, 'close3')],- performance: getPerformanceHints(perfHintOptions, 128 * 1024)- }),+ performance: getPerformanceHints(perfHintOptions, 128 * 1024) },- Object.assign({}, config, {+ { ...config,entry: {'external_api': './modules/API/external/index.js'},- output: Object.assign({}, config.output, {+ output: { ...config.output,library: 'JitsiMeetExternalAPI',- libraryTarget: 'umd'- }),+ libraryTarget: 'umd' },plugins: [...config.plugins,...getBundleAnalyzerPlugin(analyzeBundle, 'external_api')],- performance: getPerformanceHints(perfHintOptions, 95 * 1024)- }),- Object.assign({}, config, {+ performance: getPerformanceHints(perfHintOptions, 95 * 1024) },+ { ...config,entry: {'face-landmarks-worker': './react/features/face-landmarks/faceLandmarksWorker.ts'},@@ -347,10 +341,8 @@ module.exports = (_env, argv) => {...config.plugins,...getBundleAnalyzerPlugin(analyzeBundle, 'face-landmarks-worker')],- performance: getPerformanceHints(perfHintOptions, 1024 * 1024 * 2)- }),- Object.assign({}, config, {- /**+ performance: getPerformanceHints(perfHintOptions, 1024 * 1024 * 2) },+ { ...config, /*** The NoiseSuppressorWorklet is loaded in an audio worklet which doesn't have the same* context as a normal window, (e.g. self/window is not defined).* While running a production build webpack's boilerplate code doesn't introduce any@@ -380,10 +372,9 @@ module.exports = (_env, argv) => {...config.output,globalObject: 'AudioWorkletGlobalScope'- }- }),+ } },- Object.assign({}, config, {+ { ...config,entry: {'screenshot-capture-worker': './react/features/screenshot-capture/worker.ts'},@@ -391,7 +382,6 @@ module.exports = (_env, argv) => {...config.plugins,...getBundleAnalyzerPlugin(analyzeBundle, 'screenshot-capture-worker')],- performance: getPerformanceHints(perfHintOptions, 30 * 1024)- })+ performance: getPerformanceHints(perfHintOptions, 30 * 1024) }];};