From 9e562b94372d8b5d4bb75c08b66b7f90d84ee471 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Mar 2026 15:15:36 +0100 Subject: [PATCH] oxlint migration for server --- .gitignore | 3 - .oxlintrc.json | 807 ++++++++++++++++++ AGENTS.md | 15 +- apps/peertube-cli/tsconfig.json | 1 - apps/peertube-runner/tsconfig.json | 1 - eslint.config.mjs | 178 ---- package.json | 7 +- packages/core-utils/src/common/promises.ts | 24 +- .../runner-job-update-body.model.ts | 2 +- .../runners/runner-jobs/runner-job.model.ts | 2 +- packages/node-utils/src/crypto.ts | 6 +- .../server-commands/src/requests/requests.ts | 2 +- .../src/server/plugins-command.ts | 125 +-- .../server-commands/src/server/servers.ts | 2 +- .../src/shared/abstract-command.ts | 4 +- .../src/users/blocklist-command.ts | 56 +- packages/server-commands/src/videos/index.ts | 1 - .../src/videos/live-command.ts | 2 +- .../src/videos/video-token-command.ts | 23 +- .../src/videos/videos-command.ts | 2 +- .../src/videos/views-command.ts | 2 +- .../tests/src/api/activitypub/audience.ts | 2 +- packages/tests/src/api/activitypub/cleaner.ts | 2 +- packages/tests/src/api/activitypub/client.ts | 2 +- packages/tests/src/api/activitypub/fetch.ts | 2 +- packages/tests/src/api/activitypub/forward.ts | 2 +- .../tests/src/api/activitypub/refresher.ts | 5 +- .../tests/src/api/activitypub/security.ts | 2 +- packages/tests/src/api/check-params/abuses.ts | 2 +- .../tests/src/api/check-params/accounts.ts | 2 +- .../tests/src/api/check-params/auto-tags.ts | 6 +- .../tests/src/api/check-params/blocklist.ts | 2 +- packages/tests/src/api/check-params/bulk.ts | 2 +- .../api/check-params/channel-collaborators.ts | 2 +- .../api/check-params/channel-import-videos.ts | 2 +- .../tests/src/api/check-params/channels.ts | 2 +- packages/tests/src/api/check-params/config.ts | 2 +- .../src/api/check-params/contact-form.ts | 2 +- .../src/api/check-params/custom-pages.ts | 4 +- packages/tests/src/api/check-params/debug.ts | 3 +- .../tests/src/api/check-params/follows.ts | 2 +- packages/tests/src/api/check-params/jobs.ts | 2 +- packages/tests/src/api/check-params/live.ts | 2 +- packages/tests/src/api/check-params/logs.ts | 3 +- .../tests/src/api/check-params/metrics.ts | 2 +- .../src/api/check-params/player-settings.ts | 2 +- .../tests/src/api/check-params/plugins.ts | 2 +- .../tests/src/api/check-params/redundancy.ts | 2 +- .../tests/src/api/check-params/runners.ts | 2 +- packages/tests/src/api/check-params/search.ts | 2 +- .../tests/src/api/check-params/services.ts | 2 +- packages/tests/src/api/check-params/static.ts | 2 +- .../src/api/check-params/token-session.ts | 2 +- .../tests/src/api/check-params/transcoding.ts | 2 +- .../tests/src/api/check-params/two-factor.ts | 5 +- .../src/api/check-params/upload-quota.ts | 2 +- .../tests/src/api/check-params/user-export.ts | 6 +- .../tests/src/api/check-params/user-import.ts | 10 +- .../tests/src/api/check-params/user-me.ts | 2 +- .../api/check-params/user-notifications.ts | 2 +- .../api/check-params/user-subscriptions.ts | 2 +- .../tests/src/api/check-params/users-admin.ts | 2 +- .../src/api/check-params/users-emails.ts | 2 +- .../src/api/check-params/video-blacklist.ts | 2 +- .../src/api/check-params/video-captions.ts | 2 +- .../check-params/video-change-ownership.ts | 2 +- .../src/api/check-params/video-chapters.ts | 2 +- .../src/api/check-params/video-comments.ts | 2 +- .../tests/src/api/check-params/video-files.ts | 2 +- .../src/api/check-params/video-imports.ts | 2 +- .../src/api/check-params/video-playlists.ts | 2 +- .../src/api/check-params/video-storyboards.ts | 2 +- .../src/api/check-params/video-studio.ts | 2 +- .../tests/src/api/check-params/video-token.ts | 2 +- .../api/check-params/video-transcription.ts | 2 +- .../api/check-params/videos-common-filters.ts | 2 +- .../src/api/check-params/videos-history.ts | 3 +- .../src/api/check-params/videos-overviews.ts | 3 +- packages/tests/src/api/check-params/videos.ts | 2 +- .../src/api/check-params/views-and-stats.ts | 2 +- .../src/api/check-params/watched-words.ts | 2 +- .../src/api/live/live-audio-or-video-only.ts | 5 +- .../tests/src/api/live/live-constraints.ts | 2 +- .../tests/src/api/live/live-fast-restream.ts | 2 +- packages/tests/src/api/live/live-permanent.ts | 2 +- .../tests/src/api/live/live-privacy-update.ts | 2 +- packages/tests/src/api/live/live-rtmps.ts | 2 +- .../tests/src/api/live/live-save-replay.ts | 2 +- .../src/api/live/live-socket-messages.ts | 17 +- packages/tests/src/api/live/live.ts | 2 +- packages/tests/src/api/moderation/abuses.ts | 2 +- .../src/api/moderation/automatic-tags.ts | 17 +- .../api/moderation/blocklist-notification.ts | 7 +- .../tests/src/api/moderation/blocklist.ts | 2 +- .../src/api/moderation/comment-approval.ts | 2 +- .../src/api/moderation/video-blacklist.ts | 2 +- .../tests/src/api/moderation/watched-words.ts | 2 +- .../api/notifications/admin-notifications.ts | 2 +- .../notifications/caption-notifications.ts | 2 +- .../channel-collaborators-notification.ts | 2 +- .../notifications/comments-notifications.ts | 2 +- .../notifications/moderation-notifications.ts | 2 +- .../api/notifications/notifications-api.ts | 2 +- .../registrations-notifications.ts | 2 +- .../api/notifications/user-notifications.ts | 2 +- packages/tests/src/api/object-storage/live.ts | 2 +- .../src/api/object-storage/video-imports.ts | 4 +- .../video-static-file-privacy.ts | 2 +- .../tests/src/api/object-storage/videos.ts | 2 +- .../src/api/redundancy/manage-redundancy.ts | 2 +- .../api/redundancy/redundancy-constraints.ts | 2 +- .../tests/src/api/redundancy/redundancy.ts | 10 +- .../tests/src/api/runners/runner-common.ts | 2 +- .../api/runners/runner-generate-storyboard.ts | 2 +- .../api/runners/runner-live-transcoding.ts | 4 +- .../tests/src/api/runners/runner-socket.ts | 10 +- .../api/runners/runner-studio-transcoding.ts | 2 +- .../src/api/runners/runner-transcription.ts | 7 +- .../src/api/runners/runner-vod-transcoding.ts | 2 +- .../search-activitypub-video-channels.ts | 2 +- .../search-activitypub-video-playlists.ts | 2 +- .../api/search/search-activitypub-videos.ts | 2 +- .../tests/src/api/search/search-channels.ts | 2 +- packages/tests/src/api/search/search-index.ts | 6 +- .../tests/src/api/search/search-playlists.ts | 2 +- .../tests/src/api/search/search-videos.ts | 2 +- packages/tests/src/api/server/auto-follows.ts | 2 +- packages/tests/src/api/server/bulk.ts | 2 +- .../tests/src/api/server/config-defaults.ts | 2 +- packages/tests/src/api/server/config.ts | 2 +- packages/tests/src/api/server/contact-form.ts | 2 +- packages/tests/src/api/server/email.ts | 2 +- .../src/api/server/follow-constraints.ts | 2 +- .../src/api/server/follows-moderation.ts | 2 +- packages/tests/src/api/server/follows.ts | 2 +- packages/tests/src/api/server/handle-down.ts | 2 +- packages/tests/src/api/server/homepage.ts | 2 +- packages/tests/src/api/server/jobs.ts | 2 +- packages/tests/src/api/server/lazy-static.ts | 2 +- packages/tests/src/api/server/logs.ts | 6 +- .../tests/src/api/server/open-telemetry.ts | 4 +- packages/tests/src/api/server/plugins.ts | 2 +- packages/tests/src/api/server/proxy.ts | 4 +- .../tests/src/api/server/reverse-proxy.ts | 3 +- packages/tests/src/api/server/services.ts | 2 +- packages/tests/src/api/server/slow-follows.ts | 2 +- packages/tests/src/api/server/ssrf.ts | 3 +- packages/tests/src/api/server/stats.ts | 29 +- packages/tests/src/api/server/stun.ts | 2 +- packages/tests/src/api/server/tracker.ts | 2 +- .../src/api/stats/video-downloads-counter.ts | 2 +- .../src/api/stats/video-views-counter.ts | 14 +- .../api/stats/video-views-overall-stats.ts | 4 +- .../api/stats/video-views-retention-stats.ts | 7 +- .../api/stats/video-views-timeserie-stats.ts | 11 +- .../api/stats/video-views-user-agent-stats.ts | 2 +- .../src/api/stats/videos-views-cleaner.ts | 2 +- .../tests/src/api/transcoding/audio-only.ts | 3 +- .../src/api/transcoding/create-transcoding.ts | 2 +- .../force-audio-web-video-transcoding.ts | 2 +- packages/tests/src/api/transcoding/hls.ts | 3 +- .../api/transcoding/split-audio-and-video.ts | 2 +- .../src/api/transcoding/transcoder-limits.ts | 8 +- .../tests/src/api/transcoding/transcoder.ts | 2 +- .../transcoding/update-while-transcoding.ts | 4 +- packages/tests/src/api/users/oauth.ts | 2 +- packages/tests/src/api/users/registrations.ts | 2 +- packages/tests/src/api/users/two-factor.ts | 2 +- packages/tests/src/api/users/user-export.ts | 2 +- packages/tests/src/api/users/user-import.ts | 2 +- .../tests/src/api/users/user-subscriptions.ts | 10 +- packages/tests/src/api/users/user-videos.ts | 2 +- .../src/api/users/users-email-verification.ts | 2 +- .../src/api/users/users-multiple-servers.ts | 2 +- packages/tests/src/api/users/users.ts | 2 +- .../src/api/videos/channel-activities.ts | 2 +- .../src/api/videos/channel-collaborators.ts | 2 +- .../src/api/videos/channel-import-videos.ts | 2 +- packages/tests/src/api/videos/fep-1b12.ts | 2 +- .../tests/src/api/videos/generate-download.ts | 2 +- .../tests/src/api/videos/multiple-servers.ts | 2 +- .../tests/src/api/videos/player-settings.ts | 2 +- .../tests/src/api/videos/resumable-upload.ts | 2 +- .../tests/src/api/videos/single-server.ts | 2 +- .../src/api/videos/video-captions-playlist.ts | 2 +- .../tests/src/api/videos/video-captions.ts | 2 +- .../src/api/videos/video-change-ownership.ts | 2 +- .../src/api/videos/video-channel-syncs.ts | 2 +- .../tests/src/api/videos/video-channels.ts | 2 +- .../tests/src/api/videos/video-chapters.ts | 2 +- .../tests/src/api/videos/video-comments.ts | 2 +- .../tests/src/api/videos/video-description.ts | 2 +- .../src/api/videos/video-embed-privacy.ts | 2 +- packages/tests/src/api/videos/video-files.ts | 2 +- .../tests/src/api/videos/video-imports.ts | 6 +- packages/tests/src/api/videos/video-nsfw.ts | 2 +- .../tests/src/api/videos/video-passwords.ts | 2 +- .../api/videos/video-playlist-thumbnails.ts | 4 +- .../tests/src/api/videos/video-playlists.ts | 2 +- .../tests/src/api/videos/video-privacy.ts | 5 +- .../src/api/videos/video-schedule-update.ts | 2 +- packages/tests/src/api/videos/video-source.ts | 2 +- packages/tests/src/api/videos/video-state.ts | 2 +- .../api/videos/video-static-file-privacy.ts | 2 +- .../tests/src/api/videos/video-storyboard.ts | 2 +- .../src/api/videos/video-transcription.ts | 2 +- .../src/api/videos/videos-common-filters.ts | 2 +- .../tests/src/api/videos/videos-history.ts | 2 +- .../tests/src/api/videos/videos-overview.ts | 2 +- .../src/cli/create-generate-storyboard-job.ts | 2 +- .../src/cli/create-import-video-file-job.ts | 3 +- .../src/cli/create-move-video-storage-job.ts | 2 +- packages/tests/src/cli/house-keeping.ts | 2 +- packages/tests/src/cli/peertube.ts | 2 +- packages/tests/src/cli/plugins.ts | 8 +- packages/tests/src/cli/prune-storage.ts | 2 +- packages/tests/src/cli/update-host.ts | 2 +- packages/tests/src/client/embed-html.ts | 2 +- packages/tests/src/client/head-tags.ts | 2 +- packages/tests/src/client/index-html.ts | 2 +- packages/tests/src/client/jsonld.ts | 2 +- packages/tests/src/client/oembed.ts | 18 +- .../tests/src/external-plugins/akismet.ts | 5 +- .../tests/src/external-plugins/auth-ldap.ts | 2 +- .../external-plugins/auth-openid-connect.ts | 2 +- .../src/external-plugins/auto-block-videos.ts | 2 +- .../tests/src/external-plugins/auto-mute.ts | 2 +- .../src/external-plugins/privacy-remover.ts | 4 +- packages/tests/src/feeds/feeds.ts | 2 +- packages/tests/src/jiwer/jiwer-cli.spec.ts | 9 +- packages/tests/src/misc-endpoints.ts | 2 +- packages/tests/src/nginx.ts | 16 +- .../tests/src/peertube-runner/client-cli.ts | 2 +- .../src/peertube-runner/custom-upload.ts | 2 +- .../peertube-runner/generate-storyboard.ts | 2 +- .../src/peertube-runner/live-transcoding.ts | 2 +- .../tests/src/peertube-runner/replace-file.ts | 2 +- .../tests/src/peertube-runner/shutdown.ts | 2 +- .../tests/src/peertube-runner/video-state.ts | 2 +- .../peertube-runner/video-transcription.ts | 2 +- .../src/peertube-runner/vod-transcoding.ts | 2 +- packages/tests/src/plugins/action-hooks.ts | 5 +- packages/tests/src/plugins/external-auth.ts | 11 +- packages/tests/src/plugins/filter-hooks.ts | 2 +- packages/tests/src/plugins/html-injection.ts | 2 +- .../tests/src/plugins/id-and-pass-auth.ts | 2 +- packages/tests/src/plugins/plugin-helpers.ts | 2 +- packages/tests/src/plugins/plugin-router.ts | 2 +- packages/tests/src/plugins/plugin-settings.ts | 2 +- packages/tests/src/plugins/plugin-storage.ts | 2 +- .../tests/src/plugins/plugin-transcoding.ts | 7 +- .../tests/src/plugins/plugin-unloading.ts | 2 +- .../tests/src/plugins/plugin-websocket.ts | 2 +- packages/tests/src/plugins/translations.ts | 2 +- packages/tests/src/plugins/video-constants.ts | 2 +- .../tests/src/server-helpers/activitypub.ts | 2 +- .../tests/src/server-helpers/core-utils.ts | 2 +- packages/tests/src/server-helpers/crypto.ts | 5 +- packages/tests/src/server-helpers/dns.ts | 3 +- packages/tests/src/server-helpers/image.ts | 2 +- packages/tests/src/server-helpers/markdown.ts | 4 +- packages/tests/src/server-helpers/mentions.ts | 2 +- packages/tests/src/server-helpers/password.ts | 2 +- packages/tests/src/server-helpers/regexp.ts | 3 +- packages/tests/src/server-helpers/request.ts | 3 +- .../tests/src/server-helpers/validator.ts | 2 +- packages/tests/src/server-helpers/version.ts | 3 +- .../tests/src/server-helpers/youtube-dl.ts | 3 +- .../video-constant-registry-factory.ts | 2 +- packages/tests/src/shared/actors.ts | 2 +- packages/tests/src/shared/checks.ts | 4 +- packages/tests/src/shared/directories.ts | 2 +- packages/tests/src/shared/fixture-urls.ts | 2 +- packages/tests/src/shared/import-export.ts | 8 +- packages/tests/src/shared/live.ts | 2 +- .../check-admin-notifications.ts | 2 +- .../check-channel-notifications.ts | 2 +- .../check-comment-notifications.ts | 2 +- .../check-follow-notifications.ts | 2 +- .../check-moderation-notifications.ts | 2 +- .../check-video-notifications.ts | 2 +- .../notifications/notifications-common.ts | 2 +- .../shared/notification-checker.ts | 2 +- packages/tests/src/shared/plugins.ts | 2 +- packages/tests/src/shared/storyboard.ts | 2 +- .../tests/src/shared/streaming-playlists.ts | 2 +- packages/tests/src/shared/tracker.ts | 2 +- packages/tests/src/shared/transcription.ts | 2 +- packages/tests/src/shared/videos.ts | 10 +- .../transcript-file-evaluator.spec.ts | 5 +- .../transcript/transcript-file.spec.ts | 2 +- .../whisper/openai-transcriber.spec.ts | 41 +- .../whisper/whisper-ctranslate2.spec.ts | 2 +- .../transcription-devtools/src/levenshtein.ts | 2 +- .../src/whisper/whisper-builtin-model.ts | 3 +- packages/types-generator/generate-package.ts | 6 +- packages/typescript-utils/src/types.ts | 4 +- pnpm-lock.yaml | 317 ++++++- scripts/ci.sh | 2 +- server/core/controllers/api/blocklist.ts | 8 +- .../core/controllers/feeds/comment-feeds.ts | 2 +- server/core/controllers/feeds/video-feeds.ts | 2 +- server/core/helpers/core-utils.ts | 2 +- server/core/helpers/hpagent.ts | 5 +- .../core/initializers/checker-after-init.ts | 2 +- .../migrations/0925-live-schedule-at.ts | 2 +- server/core/lib/activitypub/actors/get.ts | 2 +- .../core/lib/activitypub/actors/webfinger.ts | 2 +- server/core/lib/auth/oauth-model.ts | 2 +- server/core/lib/internal-event-emitter.ts | 4 +- server/core/lib/live/shared/muxing-session.ts | 4 +- .../abstract-transcoding-wrapper.ts | 6 +- server/core/lib/local-video-creator.ts | 2 +- server/core/lib/notifier/notifier.ts | 2 +- .../object-storage/object-storage-helpers.ts | 2 +- .../nodejs-observers-builder.ts | 2 +- .../abstract-vod-transcoding-job-handler.ts | 7 +- .../live-rtmp-hls-transcoding-job-handler.ts | 2 +- .../video-studio-transcoding-job-handler.ts | 2 +- ...vod-audio-merge-transcoding-job-handler.ts | 2 +- .../vod-hls-transcoding-job-handler.ts | 2 +- .../vod-web-video-transcoding-job-handler.ts | 2 +- server/core/lib/uploadx.ts | 2 +- .../exporters/videos-exporter.ts | 1 + .../importers/user-video-history-importer.ts | 7 +- .../importers/watched-words-lists-importer.ts | 7 +- server/core/lib/video-captions.ts | 2 +- server/core/lib/webtorrent.ts | 2 +- .../middlewares/validators/videos/videos.ts | 2 +- .../instance-list-followers-query-builder.ts | 8 - .../instance-list-following-query-builder.ts | 8 - server/core/models/runner/runner-job.ts | 2 +- server/core/models/server/plugin.ts | 2 +- server/core/models/stat/local-video-viewer.ts | 2 +- .../user-notification-list-query-builder.ts | 2 +- .../sql/video/videos-id-list-query-builder.ts | 6 +- .../models/video/video-channel-activity.ts | 2 +- server/core/models/video/video.ts | 1 + server/core/types/lib.d.ts | 2 +- .../types/models/user/user-notification.ts | 2 +- server/core/types/models/video/index.ts | 1 - server/scripts/migrations/peertube-4.0.ts | 2 +- 342 files changed, 1727 insertions(+), 868 deletions(-) create mode 100644 .oxlintrc.json delete mode 100644 eslint.config.mjs diff --git a/.gitignore b/.gitignore index 357869a0de..3ce09c49eb 100644 --- a/.gitignore +++ b/.gitignore @@ -59,8 +59,5 @@ node_modules # TypeScript *.tsbuildinfo -# EsLint -.eslintcache - # Compiled output dist diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000000..a5f4042dfd --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,807 @@ +/* + + Skipped 23 rules: + - 14 Not Implemented + - @typescript-eslint/method-signature-style + - @typescript-eslint/naming-convention + - @typescript-eslint/prefer-destructuring + - consistent-this + - logical-assignment-operators + - no-implicit-globals + - no-unreachable-loop + - object-shorthand + - one-var + - prefer-regex-literals + - strict + - n/no-callback-literal + - n/no-deprecated-api + - n/process-exit-as-throw + - 9 Unsupported + - no-dupe-args: Superseded by strict mode. + - no-octal: Superseded by strict mode. + - no-octal-escape: Superseded by strict mode. + - import/enforce-node-protocol-usage: No need to implement, already implemented by `unicorn/prefer-node-protocol`. + - eol-last: Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary. + - max-len: Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary. + - array-bracket-spacing: Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary. + - quote-props: Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary. + - operator-linebreak: Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary. +*/ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [], + "categories": { + "correctness": "off" + }, + "options": { + "typeAware": true + }, + "env": { + "builtin": true + }, + "ignorePatterns": [ + "**/node_modules/", + "node_modules", + "packages/tests/fixtures", + "apps/**/dist", + "packages/**/dist", + "server/dist", + "packages/types-generator", + "*.js", + "client", + "dist", + "server/.i18next.config.ts", + "apps/**/tsdown.config.ts" + ], + "overrides": [ + { + "files": [ + "server/**/*.ts", + "scripts/**/*.ts", + "packages/**/*.ts", + "apps/**/*.ts" + ], + "rules": { + "@typescript-eslint/adjacent-overload-signatures": [ + "error" + ], + "@typescript-eslint/array-type": [ + "error", + { + "default": "array" + } + ], + "@typescript-eslint/await-thenable": [ + "error" + ], + "@typescript-eslint/ban-ts-comment": [ + "error", + { + "ts-expect-error": "allow-with-description", + "ts-ignore": true, + "ts-nocheck": true, + "ts-check": false, + "minimumDescriptionLength": 3 + } + ], + "@typescript-eslint/ban-tslint-comment": [ + "error" + ], + "@typescript-eslint/class-literal-property-style": [ + "error", + "fields" + ], + "@typescript-eslint/consistent-generic-constructors": [ + "error", + "constructor" + ], + "@typescript-eslint/consistent-indexed-object-style": "off", + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as" + } + ], + "@typescript-eslint/consistent-type-definitions": "off", + "@typescript-eslint/consistent-type-exports": "off", + "@typescript-eslint/consistent-type-imports": "off", + "@typescript-eslint/dot-notation": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-array-delete": [ + "error" + ], + "@typescript-eslint/no-base-to-string": "off", + "@typescript-eslint/no-confusing-non-null-assertion": [ + "error" + ], + "@typescript-eslint/no-confusing-void-expression": "off", + "@typescript-eslint/no-deprecated": [ + "warn" + ], + "@typescript-eslint/no-duplicate-enum-values": [ + "error" + ], + "@typescript-eslint/no-duplicate-type-constituents": [ + "error", + { + "ignoreIntersections": false, + "ignoreUnions": false + } + ], + "@typescript-eslint/no-dynamic-delete": "off", + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-extra-non-null-assertion": [ + "error" + ], + "@typescript-eslint/no-extraneous-class": "off", + "@typescript-eslint/no-floating-promises": [ + "error" + ], + "@typescript-eslint/no-for-in-array": [ + "error" + ], + "@typescript-eslint/no-implied-eval": [ + "error" + ], + "@typescript-eslint/no-import-type-side-effects": "off", + "@typescript-eslint/no-inferrable-types": [ + "error", + { + "ignoreParameters": false, + "ignoreProperties": false + } + ], + "@typescript-eslint/no-invalid-void-type": [ + "error" + ], + "@typescript-eslint/no-meaningless-void-operator": [ + "error", + { + "checkNever": true + } + ], + "@typescript-eslint/no-misused-new": [ + "error" + ], + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksConditionals": true, + "checksSpreads": true, + "checksVoidReturn": false + } + ], + "@typescript-eslint/no-misused-spread": "off", + "@typescript-eslint/no-mixed-enums": [ + "error" + ], + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-non-null-asserted-nullish-coalescing": [ + "error" + ], + "@typescript-eslint/no-non-null-asserted-optional-chain": [ + "error" + ], + "@typescript-eslint/no-non-null-assertion": [ + "error" + ], + "@typescript-eslint/no-redundant-type-constituents": [ + "error" + ], + "@typescript-eslint/no-require-imports": [ + "error", + { + "allow": [], + "allowAsImport": false + } + ], + "@typescript-eslint/no-this-alias": [ + "error", + { + "allowDestructuring": true, + "allowedNames": [ + "self" + ] + } + ], + "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off", + "@typescript-eslint/no-unnecessary-condition": "off", + "@typescript-eslint/no-unnecessary-parameter-property-assignment": [ + "error" + ], + "@typescript-eslint/no-unnecessary-qualifier": [ + "error" + ], + "@typescript-eslint/no-unnecessary-template-expression": "off", + "@typescript-eslint/no-unnecessary-type-arguments": [ + "error" + ], + "@typescript-eslint/no-unnecessary-type-assertion": [ + "error" + ], + "@typescript-eslint/no-unnecessary-type-constraint": [ + "error" + ], + "@typescript-eslint/no-unnecessary-type-conversion": "off", + "@typescript-eslint/no-unnecessary-type-parameters": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-declaration-merging": [ + "error" + ], + "@typescript-eslint/no-unsafe-enum-comparison": [ + "error" + ], + "@typescript-eslint/no-unsafe-function-type": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-type-assertion": "off", + "@typescript-eslint/no-unsafe-unary-minus": [ + "error" + ], + "@typescript-eslint/no-useless-empty-export": [ + "error" + ], + "@typescript-eslint/no-wrapper-object-types": [ + "error" + ], + "@typescript-eslint/non-nullable-type-assertion-style": [ + "error" + ], + "@typescript-eslint/only-throw-error": [ + "error", + { + "allowThrowingAny": false, + "allowThrowingUnknown": false + } + ], + "@typescript-eslint/prefer-as-const": "off", + "@typescript-eslint/prefer-find": [ + "error" + ], + "@typescript-eslint/prefer-for-of": [ + "error" + ], + "@typescript-eslint/prefer-function-type": [ + "error" + ], + "@typescript-eslint/prefer-includes": [ + "error" + ], + "@typescript-eslint/prefer-literal-enum-member": [ + "error", + { + "allowBitwiseExpressions": true + } + ], + "@typescript-eslint/prefer-namespace-keyword": [ + "error" + ], + "@typescript-eslint/prefer-nullish-coalescing": "off", + "@typescript-eslint/prefer-optional-chain": [ + "error" + ], + "@typescript-eslint/prefer-promise-reject-errors": "off", + "@typescript-eslint/prefer-readonly": [ + "error" + ], + "@typescript-eslint/prefer-reduce-type-parameter": [ + "error" + ], + "@typescript-eslint/prefer-regexp-exec": "off", + "@typescript-eslint/prefer-return-this-type": [ + "error" + ], + "@typescript-eslint/prefer-string-starts-ends-with": [ + "error", + { + "allowSingleElementEquality": "never" + } + ], + "@typescript-eslint/promise-function-async": "off", + "@typescript-eslint/related-getter-setter-pairs": [ + "error" + ], + "@typescript-eslint/require-array-sort-compare": [ + "error", + { + "ignoreStringArrays": true + } + ], + "@typescript-eslint/require-await": "error", + "@typescript-eslint/restrict-plus-operands": "off", + "@typescript-eslint/restrict-template-expressions": [ + "off", + { + "allowNumber": true + } + ], + "@typescript-eslint/return-await": "off", + "@typescript-eslint/strict-boolean-expressions": "off", + "@typescript-eslint/switch-exhaustiveness-check": "off", + "@typescript-eslint/triple-slash-reference": [ + "error", + { + "lib": "never", + "path": "never", + "types": "never" + } + ], + "@typescript-eslint/unbound-method": "off", + "@typescript-eslint/unified-signatures": [ + "error", + { + "ignoreDifferentlyNamedParameters": false + } + ], + "@typescript-eslint/use-unknown-in-catch-callback-variable": "off", + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": [ + "error" + ], + "eslint-comments/no-duplicate-disable": [ + "error" + ], + "eslint-comments/no-unlimited-disable": [ + "error" + ], + "eslint-comments/no-unused-enable": [ + "error" + ], + "eslint-comments/require-description": "off", + "accessor-pairs": [ + "error", + { + "setWithoutGet": true, + "getWithoutSet": false, + "enforceForClassMembers": true + } + ], + "array-callback-return": [ + "error", + { + "allowImplicit": false, + "allowVoid": false, + "checkForEach": false + } + ], + "arrow-body-style": "off", + "complexity": "off", + "constructor-super": [ + "error" + ], + "curly": [ + "error", + "multi-line" + ], + "default-case-last": [ + "error" + ], + "eqeqeq": [ + "error", + "always", + { + "null": "ignore" + } + ], + "for-direction": [ + "error" + ], + "grouped-accessor-pairs": [ + "error", + "getBeforeSet" + ], + "guard-for-in": [ + "error" + ], + "max-depth": [ + "error", + { + "max": 5 + } + ], + "max-lines": "off", + "max-nested-callbacks": "off", + "new-cap": [ + "error", + { + "newIsCap": true, + "capIsNew": false, + "properties": true + } + ], + "no-alert": [ + "error" + ], + "no-async-promise-executor": "off", + "no-caller": [ + "error" + ], + "no-case-declarations": [ + "error" + ], + "no-class-assign": [ + "error" + ], + "no-compare-neg-zero": [ + "error" + ], + "no-cond-assign": [ + "error" + ], + "no-console": "off", + "no-const-assign": [ + "error" + ], + "no-constant-binary-expression": [ + "error" + ], + "no-constant-condition": [ + "error", + { + "checkLoops": false + } + ], + "no-constructor-return": [ + "error" + ], + "no-control-regex": [ + "error" + ], + "no-debugger": [ + "error" + ], + "no-delete-var": [ + "error" + ], + "no-dupe-else-if": [ + "error" + ], + "no-dupe-keys": [ + "error" + ], + "no-duplicate-case": [ + "error" + ], + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-empty-character-class": [ + "error" + ], + "no-empty-pattern": [ + "error" + ], + "no-empty-static-block": [ + "error" + ], + "no-eval": [ + "error" + ], + "no-ex-assign": [ + "error" + ], + "no-extend-native": [ + "error" + ], + "no-extra-bind": [ + "error" + ], + "no-extra-boolean-cast": [ + "error" + ], + "no-fallthrough": [ + "error" + ], + "no-func-assign": [ + "error" + ], + "no-global-assign": [ + "error" + ], + "no-import-assign": [ + "error" + ], + "no-invalid-regexp": [ + "error" + ], + "no-irregular-whitespace": [ + "error" + ], + "no-iterator": [ + "error" + ], + "no-labels": [ + "error", + { + "allowLoop": false, + "allowSwitch": false + } + ], + "no-lone-blocks": "off", + "no-lonely-if": [ + "error" + ], + "no-loss-of-precision": [ + "error" + ], + "no-misleading-character-class": [ + "error" + ], + "no-multi-assign": [ + "error", + { + "ignoreNonDeclaration": false + } + ], + "no-multi-str": [ + "error" + ], + "no-negated-condition": "off", + "no-new": [ + "error" + ], + "no-new-func": [ + "error" + ], + "no-new-native-nonconstructor": [ + "error" + ], + "no-new-wrappers": [ + "error" + ], + "no-nonoctal-decimal-escape": [ + "error" + ], + "no-obj-calls": [ + "error" + ], + "no-object-constructor": [ + "error" + ], + "no-param-reassign": "off", + "no-plusplus": "off", + "no-promise-executor-return": "off", + "no-proto": [ + "error" + ], + "no-prototype-builtins": [ + "error" + ], + "no-regex-spaces": [ + "error" + ], + "no-return-assign": [ + "error", + "except-parens" + ], + "no-script-url": [ + "error" + ], + "no-self-assign": [ + "error", + { + "props": true + } + ], + "no-self-compare": [ + "error" + ], + "no-sequences": [ + "error" + ], + "no-shadow-restricted-names": [ + "error" + ], + "no-sparse-arrays": [ + "error" + ], + "no-template-curly-in-string": [ + "error" + ], + "no-this-before-super": [ + "error" + ], + "no-unexpected-multiline": [ + "error" + ], + "no-unmodified-loop-condition": [ + "error" + ], + "no-unneeded-ternary": [ + "error", + { + "defaultAssignment": false + } + ], + "no-unreachable": [ + "error" + ], + "no-unsafe-finally": [ + "error" + ], + "no-unsafe-negation": [ + "error" + ], + "no-useless-backreference": [ + "error" + ], + "no-useless-call": [ + "error" + ], + "no-useless-catch": [ + "error" + ], + "no-useless-computed-key": [ + "error" + ], + "no-useless-escape": [ + "error" + ], + "no-useless-rename": [ + "error" + ], + "no-useless-return": [ + "error" + ], + "no-var": [ + "error" + ], + "no-void": [ + "error", + { + "allowAsStatement": true + } + ], + "no-with": [ + "error" + ], + "prefer-const": [ + "error", + { + "destructuring": "all", + "ignoreReadBeforeAssign": false + } + ], + "prefer-spread": "off", + "preserve-caught-error": [ + "error", + { + "requireCatchParameter": false + } + ], + "radix": "off", + "symbol-description": [ + "error" + ], + "unicode-bom": [ + "error", + "never" + ], + "use-isnan": [ + "error", + { + "enforceForSwitchCase": true, + "enforceForIndexOf": true + } + ], + "valid-typeof": [ + "error", + { + "requireStringLiterals": true + } + ], + "yoda": [ + "error", + "never" + ], + "promise/avoid-new": "off", + "promise/param-names": "off", + "import/export": [ + "error" + ], + "import/first": "off", + "import/no-absolute-path": [ + "error", + { + "esmodule": true, + "commonjs": true, + "amd": false + } + ], + "import/no-duplicates": [ + "error" + ], + "import/no-named-default": [ + "error" + ], + "import/no-webpack-loader-syntax": [ + "error" + ], + "class-methods-use-this": "off", + "init-declarations": "off", + "max-params": "off", + "no-array-constructor": [ + "error" + ], + "no-dupe-class-members": [ + "error" + ], + "no-empty-function": "off", + "no-loop-func": "off", + "no-magic-numbers": "off", + "no-unused-expressions": [ + "error", + { + "allowShortCircuit": true, + "allowTernary": true, + "allowTaggedTemplates": true, + "enforceForJSX": false + } + ], + "no-unused-vars": [ + "error", + { + "args": "none", + "caughtErrors": "none", + "ignoreRestSiblings": true, + "vars": "all" + } + ], + "no-use-before-define": [ + "error", + { + "functions": false, + "classes": false, + "enums": false, + "variables": false, + "typedefs": false + } + ], + "no-useless-constructor": [ + "error" + ], + "node/handle-callback-err": [ + "error", + "^(err|error)$" + ], + "node/no-exports-assign": [ + "error" + ], + "node/no-new-require": [ + "error" + ], + "node/no-path-concat": [ + "error" + ], + "@stylistic/semi": [ + "error", + "never" + ], + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-empty-interface": "off", + "require-await": "off" + }, + "jsPlugins": [ + "eslint-plugin-eslint-comments", + "@stylistic/eslint-plugin" + ], + "plugins": [ + "typescript", + "node", + "promise", + "import" + ] + } + ] +} diff --git a/AGENTS.md b/AGENTS.md index cf100145b2..f3875d6841 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,11 +90,11 @@ npm run dev # server :9000, client :3000 ### Lint & type-check ```bash -# Full lint (ESLint + OpenAPI validation) +# Full lint (oxlint + OpenAPI validation) npm run lint -# ESLint only -npm run eslint +# Oxlint only +npm run oxlint # Validate OpenAPI spec npm run swagger-cli -- validate support/doc/api/openapi.yaml @@ -112,7 +112,7 @@ npm run start:server # server only (--no-client) ## Code Style & Conventions -### Formatting (enforced by ESLint) +### Formatting (enforced by Oxlint) | Rule | Value | |---------------------|---------------------------------------| @@ -151,10 +151,9 @@ router.get('/:id', No formal commit-message template. -### ESLint config +### Oxlint config -Defined in `eslint.config.mjs`. Extends `eslint-config-love` with -`@stylistic/eslint-plugin`. Applies to `server/**/*.ts`, +Defined in `oxlint.config.mjs`. Applies to `server/**/*.ts`, `scripts/**/*.ts`, `packages/**/*.ts`, `apps/**/*.ts`. The `client/` directory has its own lint config. @@ -254,7 +253,7 @@ npm run ci -- api-4 # moderation, redundancy, object-storage, npm run ci -- api-5 # transcoding, runners npm run ci -- client # feeds, client, misc-endpoints, plugins npm run ci -- cli-plugin # CLI and plugin tests -npm run ci -- lint # ESLint + OpenAPI validation + client lint +npm run ci -- lint # OXlint + OpenAPI validation + client lint npm run ci -- transcription npm run ci -- external-plugins diff --git a/apps/peertube-cli/tsconfig.json b/apps/peertube-cli/tsconfig.json index c32374d4a1..169aa6e695 100644 --- a/apps/peertube-cli/tsconfig.json +++ b/apps/peertube-cli/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "baseUrl": "./", "outDir": "./dist", "rootDir": "src", "tsBuildInfoFile": "./dist/.tsbuildinfo" diff --git a/apps/peertube-runner/tsconfig.json b/apps/peertube-runner/tsconfig.json index c0eda297c7..31c62cbc81 100644 --- a/apps/peertube-runner/tsconfig.json +++ b/apps/peertube-runner/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "baseUrl": "./", "outDir": "./dist", "rootDir": "src", "tsBuildInfoFile": "./dist/.tsbuildinfo" diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 7616d68046..0000000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,178 +0,0 @@ -import { defineConfig, globalIgnores } from 'eslint/config' -import love from 'eslint-config-love' -import stylistic from '@stylistic/eslint-plugin' - -export default defineConfig([ - globalIgnores([ - '**/node_modules/', - 'node_modules', - 'packages/tests/fixtures', - 'apps/**/dist', - 'packages/**/dist', - 'server/dist', - 'packages/types-generator', - '*.js', - 'client', - 'dist', - 'server/.i18next.config.ts', - 'apps/**/tsdown.config.ts' - ]), - - { - extends: [ love ], - - plugins: { - '@stylistic': stylistic - }, - - files: [ - 'server/**/*.ts', - 'scripts/**/*.ts', - 'packages/**/*.ts', - 'apps/**/*.ts' - ], - - rules: { - '@stylistic/semi': [ 'error', 'never' ], - - 'eol-last': [ 'error', 'always' ], - 'indent': 'off', - 'no-lone-blocks': 'off', - 'no-mixed-operators': 'off', - - 'max-len': [ 'error', { - code: 140 - } ], - - 'array-bracket-spacing': [ 'error', 'always' ], - 'quote-props': [ 'error', 'consistent-as-needed' ], - 'padded-blocks': 'off', - 'no-async-promise-executor': 'off', - 'dot-notation': 'off', - 'promise/param-names': 'off', - 'import/first': 'off', - - 'operator-linebreak': [ 'error', 'after', { - overrides: { - '?': 'before', - ':': 'before' - } - } ], - - '@typescript-eslint/consistent-type-assertions': [ 'error', { - assertionStyle: 'as' - } ], - - '@typescript-eslint/array-type': [ 'error', { - default: 'array' - } ], - - '@typescript-eslint/restrict-template-expressions': [ 'off', { - allowNumber: 'true' - } ], - - '@typescript-eslint/no-this-alias': [ 'error', { - allowDestructuring: true, - allowedNames: [ 'self' ] - } ], - - '@typescript-eslint/return-await': 'off', - '@typescript-eslint/no-base-to-string': 'off', - '@typescript-eslint/quotes': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/promise-function-async': 'off', - '@typescript-eslint/no-dynamic-delete': 'off', - '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', - '@typescript-eslint/strict-boolean-expressions': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/no-misused-promises': [ 'error', { - checksConditionals: true, - checksSpreads: true, - checksVoidReturn: false - } ], - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-extraneous-class': 'off', - '@typescript-eslint/prefer-nullish-coalescing': 'off', - '@typescript-eslint/consistent-indexed-object-style': 'off', - '@typescript-eslint/restrict-plus-operands': 'off', - '@typescript-eslint/no-unnecessary-condition': 'off', - '@typescript-eslint/consistent-type-imports': 'off', - 'no-implicit-globals': 'off', - '@typescript-eslint/no-confusing-void-expression': 'off', - '@typescript-eslint/no-explicit-any': 'off', - 'logical-assignment-operators': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-magic-numbers': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-type-assertion': 'off', - '@typescript-eslint/prefer-destructuring': 'off', - 'promise/avoid-new': 'off', - '@typescript-eslint/class-methods-use-this': 'off', - 'arrow-body-style': 'off', - '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', - '@typescript-eslint/consistent-type-exports': 'off', - '@typescript-eslint/init-declarations': 'off', - 'no-console': 'off', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/method-signature-style': 'off', - 'eslint-comments/require-description': 'off', - 'max-lines': 'off', - '@typescript-eslint/no-misused-spread': 'off', - 'consistent-this': 'off', - '@typescript-eslint/no-empty-function': 'off', - 'prefer-regex-literals': 'off', - '@typescript-eslint/prefer-regexp-exec': 'off', - '@typescript-eslint/prefer-promise-reject-errors': 'off', - '@typescript-eslint/no-unnecessary-template-expression': 'off', - '@typescript-eslint/no-loop-func': 'off', - '@typescript-eslint/switch-exhaustiveness-check': 'off', - '@typescript-eslint/no-empty-object-type': 'off', - '@typescript-eslint/no-import-type-side-effects': 'off', - '@typescript-eslint/unbound-method': 'off', - - "require-await": "off", - "@typescript-eslint/require-await": "error", - - // Can be interesting to enable - '@typescript-eslint/no-unsafe-return': 'off', - // Can be interesting to enable - 'complexity': 'off', - // Interesting but has a bug with specific cases - '@typescript-eslint/no-unnecessary-type-parameters': 'off', - // TODO: enable - '@typescript-eslint/prefer-as-const': 'off', - // TODO: enable - '@typescript-eslint/max-params': 'off', - // TODO: enable - '@typescript-eslint/no-unsafe-function-type': 'off', - - // We use many nested callbacks in our tests - 'max-nested-callbacks': 'off', - - 'import/enforce-node-protocol-usage': 'off', - 'no-param-reassign': 'off', - 'no-plusplus': 'off', - 'radix': 'off', - 'no-negated-condition': 'off', - 'no-promise-executor-return': 'off', - '@typescript-eslint/no-unnecessary-type-conversion': 'off', - 'prefer-spread': 'off', - 'import/enforce-node-protocol-usage': 'off', - 'prefer-spread': 'off' - }, - - languageOptions: { - parserOptions: { - projectService: true - } - }, - - linterOptions: { - reportUnusedDisableDirectives: 'off' - } - } -]) diff --git a/package.json b/package.json index 446455d97c..d590b70c99 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "dev": "bash ./scripts/dev/index.sh", "e2e:browserstack": "bash ./scripts/e2e/browserstack.sh", "e2e:local": "bash ./scripts/e2e/local.sh", - "eslint": "eslint", + "oxlint": "oxlint", "generate-cli-doc": "bash ./scripts/generate-cli-doc.sh", "generate-code-contributors": "tsx --conditions=peertube:tsx ./scripts/generate-code-contributors.ts", "generate-types-package": "tsx --conditions=peertube:tsx ./packages/types-generator/generate-package.ts", @@ -245,13 +245,14 @@ "chai-xml": "^0.4.1", "concurrently": "^9.2.1", "depcheck": "^1.4.7", - "eslint": "^9.39.3", - "eslint-config-love": "^133.0.0", + "eslint-plugin-eslint-comments": "^3.2.0", "fast-xml-parser": "^5.5.6", "i18next-cli": "^1.47.3", "jszip": "^3.10.1", "maildev": "^2.2.1", "mocha": "^11.7.5", + "oxlint": "^1.57.0", + "oxlint-tsgolint": "^0.17.4", "pixelmatch": "^7.1.0", "proxy": "^2.2.0", "rollup": "^4.59.0", diff --git a/packages/core-utils/src/common/promises.ts b/packages/core-utils/src/common/promises.ts index e3792d12e4..bb90175fdc 100644 --- a/packages/core-utils/src/common/promises.ts +++ b/packages/core-utils/src/common/promises.ts @@ -1,4 +1,4 @@ -export function isPromise (value: T | Promise): value is Promise { +export function isPromise (value: T | Promise): value is Promise { return value && typeof (value as Promise).then === 'function' } @@ -6,7 +6,7 @@ export function isCatchable (value: any) { return value && typeof value.catch === 'function' } -export function timeoutPromise (promise: Promise, timeoutMs: number) { +export function timeoutPromise (promise: Promise, timeoutMs: number) { let timer: ReturnType return Promise.race([ @@ -21,7 +21,7 @@ export function timeoutPromise (promise: Promise, timeoutMs: number) { export function promisify0 (func: (cb: (err: any, result: A) => void) => void): () => Promise { return function promisified (): Promise { return new Promise((resolve: (arg: A) => void, reject: (err: any) => void) => { - // eslint-disable-next-line no-useless-call + // oxlint-disable-next-line no-useless-call func.apply(null, [ (err: any, res: A) => err ? reject(err) : resolve(res) ]) }) } @@ -31,27 +31,31 @@ export function promisify0 (func: (cb: (err: any, result: A) => void) => void export function promisify1 (func: (arg: T, cb: (err: any, result: A) => void) => void): (arg: T) => Promise { return function promisified (arg: T): Promise { return new Promise((resolve: (arg: A) => void, reject: (err: any) => void) => { - // eslint-disable-next-line no-useless-call + // oxlint-disable-next-line no-useless-call func.apply(null, [ arg, (err: any, res: A) => err ? reject(err) : resolve(res) ]) }) } } -// eslint-disable-next-line max-len -export function promisify2 (func: (arg1: T, arg2: U, cb: (err: any, result: A) => void) => void): (arg1: T, arg2: U) => Promise { +// oxlint-disable-next-line max-len +export function promisify2 ( + func: (arg1: T, arg2: U, cb: (err: any, result: A) => void) => void +): (arg1: T, arg2: U) => Promise { return function promisified (arg1: T, arg2: U): Promise { return new Promise((resolve: (arg: A) => void, reject: (err: any) => void) => { - // eslint-disable-next-line no-useless-call + // oxlint-disable-next-line no-useless-call func.apply(null, [ arg1, arg2, (err: any, res: A) => err ? reject(err) : resolve(res) ]) }) } } -// eslint-disable-next-line max-len -export function promisify3 (func: (arg1: T, arg2: U, arg3: V, cb: (err: any, result: A) => void) => void): (arg1: T, arg2: U, arg3: V) => Promise { +// oxlint-disable-next-line max-len +export function promisify3 ( + func: (arg1: T, arg2: U, arg3: V, cb: (err: any, result: A) => void) => void +): (arg1: T, arg2: U, arg3: V) => Promise { return function promisified (arg1: T, arg2: U, arg3: V): Promise { return new Promise((resolve: (arg: A) => void, reject: (err: any) => void) => { - // eslint-disable-next-line no-useless-call + // oxlint-disable-next-line no-useless-call func.apply(null, [ arg1, arg2, arg3, (err: any, res: A) => err ? reject(err) : resolve(res) ]) }) } diff --git a/packages/models/src/runners/runner-jobs/runner-job-update-body.model.ts b/packages/models/src/runners/runner-jobs/runner-job-update-body.model.ts index ed94bbe630..f80149d083 100644 --- a/packages/models/src/runners/runner-jobs/runner-job-update-body.model.ts +++ b/packages/models/src/runners/runner-jobs/runner-job-update-body.model.ts @@ -23,6 +23,6 @@ export interface LiveRTMPHLSTranscodingUpdatePayload { } export function isLiveRTMPHLSTranscodingUpdatePayload (value: RunnerJobUpdatePayload): value is LiveRTMPHLSTranscodingUpdatePayload { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return !!(value as LiveRTMPHLSTranscodingUpdatePayload)?.videoChunkFilename } diff --git a/packages/models/src/runners/runner-jobs/runner-job.model.ts b/packages/models/src/runners/runner-jobs/runner-job.model.ts index 5a20e235ee..f4346ea641 100644 --- a/packages/models/src/runners/runner-jobs/runner-job.model.ts +++ b/packages/models/src/runners/runner-jobs/runner-job.model.ts @@ -39,7 +39,7 @@ export interface RunnerJob { } } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export interface RunnerJobAdmin extends RunnerJob { diff --git a/packages/node-utils/src/crypto.ts b/packages/node-utils/src/crypto.ts index ecab034576..e8c77e2ba7 100644 --- a/packages/node-utils/src/crypto.ts +++ b/packages/node-utils/src/crypto.ts @@ -1,13 +1,13 @@ import { BinaryToTextEncoding, createHash } from 'crypto' -export function sha256 (str: string | Buffer, encoding: BinaryToTextEncoding = 'hex') { +export function sha256 (str: string | Uint8Array, encoding: BinaryToTextEncoding = 'hex') { return createHash('sha256').update(str).digest(encoding) } -export function sha1 (str: string | Buffer, encoding: BinaryToTextEncoding = 'hex') { +export function sha1 (str: string | Uint8Array, encoding: BinaryToTextEncoding = 'hex') { return createHash('sha1').update(str).digest(encoding) } -export function md5 (str: string | Buffer) { +export function md5 (str: string | Uint8Array) { return createHash('md5').update(str).digest() } diff --git a/packages/server-commands/src/requests/requests.ts b/packages/server-commands/src/requests/requests.ts index 85ed8326f9..9669290760 100644 --- a/packages/server-commands/src/requests/requests.ts +++ b/packages/server-commands/src/requests/requests.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-floating-promises */ import { pick, queryParamsToObject } from '@peertube/peertube-core-utils' import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' diff --git a/packages/server-commands/src/server/plugins-command.ts b/packages/server-commands/src/server/plugins-command.ts index f85ef0330d..cef2c50d89 100644 --- a/packages/server-commands/src/server/plugins-command.ts +++ b/packages/server-commands/src/server/plugins-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { readJSON, writeJSON } from 'fs-extra/esm' import { join } from 'path' @@ -19,18 +19,19 @@ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js' export class PluginsCommand extends AbstractCommand { - static getPluginTestPath (suffix = '') { return buildAbsoluteFixturePath('peertube-plugin-test' + suffix) } - list (options: OverrideCommandOptions & { - start?: number - count?: number - sort?: string - pluginType?: PluginType_Type - uninstalled?: boolean - }) { + list ( + options: OverrideCommandOptions & { + start?: number + count?: number + sort?: string + pluginType?: PluginType_Type + uninstalled?: boolean + } + ) { const { start, count, sort, pluginType, uninstalled } = options const path = '/api/v1/plugins' @@ -50,15 +51,17 @@ export class PluginsCommand extends AbstractCommand { }) } - listAvailable (options: OverrideCommandOptions & { - start?: number - count?: number - sort?: string - pluginType?: PluginType_Type - currentPeerTubeEngine?: string - search?: string - expectedStatus?: HttpStatusCodeType - }) { + listAvailable ( + options: OverrideCommandOptions & { + start?: number + count?: number + sort?: string + pluginType?: PluginType_Type + currentPeerTubeEngine?: string + search?: string + expectedStatus?: HttpStatusCodeType + } + ) { const { start, count, sort, pluginType, search, currentPeerTubeEngine } = options const path = '/api/v1/plugins/available' @@ -81,9 +84,11 @@ export class PluginsCommand extends AbstractCommand { }) } - get (options: OverrideCommandOptions & { - npmName: string - }) { + get ( + options: OverrideCommandOptions & { + npmName: string + } + ) { const path = '/api/v1/plugins/' + options.npmName return this.getRequestBody({ @@ -95,10 +100,12 @@ export class PluginsCommand extends AbstractCommand { }) } - updateSettings (options: OverrideCommandOptions & { - npmName: string - settings: any - }) { + updateSettings ( + options: OverrideCommandOptions & { + npmName: string + settings: any + } + ) { const { npmName, settings } = options const path = '/api/v1/plugins/' + npmName + '/settings' @@ -112,9 +119,11 @@ export class PluginsCommand extends AbstractCommand { }) } - getRegisteredSettings (options: OverrideCommandOptions & { - npmName: string - }) { + getRegisteredSettings ( + options: OverrideCommandOptions & { + npmName: string + } + ) { const path = '/api/v1/plugins/' + options.npmName + '/registered-settings' return this.getRequestBody({ @@ -126,9 +135,11 @@ export class PluginsCommand extends AbstractCommand { }) } - getPublicSettings (options: OverrideCommandOptions & { - npmName: string - }) { + getPublicSettings ( + options: OverrideCommandOptions & { + npmName: string + } + ) { const { npmName } = options const path = '/api/v1/plugins/' + npmName + '/public-settings' @@ -141,9 +152,11 @@ export class PluginsCommand extends AbstractCommand { }) } - getTranslations (options: OverrideCommandOptions & { - locale: string - }) { + getTranslations ( + options: OverrideCommandOptions & { + locale: string + } + ) { const { locale } = options const path = '/plugins/translations/' + locale + '.json' @@ -156,11 +169,13 @@ export class PluginsCommand extends AbstractCommand { }) } - install (options: OverrideCommandOptions & { - path?: string - npmName?: string - pluginVersion?: string - }) { + install ( + options: OverrideCommandOptions & { + path?: string + npmName?: string + pluginVersion?: string + } + ) { const { npmName, path, pluginVersion } = options const apiPath = '/api/v1/plugins/install' @@ -174,10 +189,12 @@ export class PluginsCommand extends AbstractCommand { }) } - update (options: OverrideCommandOptions & { - path?: string - npmName?: string - }) { + update ( + options: OverrideCommandOptions & { + path?: string + npmName?: string + } + ) { const { npmName, path } = options const apiPath = '/api/v1/plugins/update' @@ -191,9 +208,11 @@ export class PluginsCommand extends AbstractCommand { }) } - uninstall (options: OverrideCommandOptions & { - npmName: string - }) { + uninstall ( + options: OverrideCommandOptions & { + npmName: string + } + ) { const { npmName } = options const apiPath = '/api/v1/plugins/uninstall' @@ -219,12 +238,14 @@ export class PluginsCommand extends AbstractCommand { }) } - getExternalAuth (options: OverrideCommandOptions & { - npmName: string - npmVersion: string - authName: string - query?: any - }) { + getExternalAuth ( + options: OverrideCommandOptions & { + npmName: string + npmVersion: string + authName: string + query?: any + } + ) { const { npmName, npmVersion, authName, query } = options const path = '/plugins/' + npmName + '/' + npmVersion + '/auth/' + authName diff --git a/packages/server-commands/src/server/servers.ts b/packages/server-commands/src/server/servers.ts index 113a129423..0a5a4a4cf5 100644 --- a/packages/server-commands/src/server/servers.ts +++ b/packages/server-commands/src/server/servers.ts @@ -35,7 +35,7 @@ async function cleanupTests (servers: PeerTubeServer[]) { for (const server of servers) { if (!server) continue - // eslint-disable-next-line @typescript-eslint/no-floating-promises + // oxlint-disable-next-line @typescript-eslint/no-floating-promises p = p.concat(server.servers.cleanupTests()) } diff --git a/packages/server-commands/src/shared/abstract-command.ts b/packages/server-commands/src/shared/abstract-command.ts index 86e96577b7..fa09cae9ec 100644 --- a/packages/server-commands/src/shared/abstract-command.ts +++ b/packages/server-commands/src/shared/abstract-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' import { buildAbsoluteFixturePath, getFileSize } from '@peertube/peertube-node-utils' @@ -419,7 +419,7 @@ export abstract class AbstractCommand { if (res.statusCode !== HttpStatusCode.PERMANENT_REDIRECT_308) { readable.off('data', onData) - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len const message = `Incorrect transient behaviour sending intermediary chunks. Status code is ${res.statusCode} instead of ${expectedStatus}` return reject(new Error(message)) diff --git a/packages/server-commands/src/users/blocklist-command.ts b/packages/server-commands/src/users/blocklist-command.ts index c77c561319..e8f66a9a45 100644 --- a/packages/server-commands/src/users/blocklist-command.ts +++ b/packages/server-commands/src/users/blocklist-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { AccountBlock, BlockStatus, HttpStatusCode, ResultList, ServerBlock } from '@peertube/peertube-models' import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js' @@ -13,7 +13,6 @@ type ListBlocklistOptions = OverrideCommandOptions & { } export class BlocklistCommand extends AbstractCommand { - listMyAccountBlocklist (options: ListBlocklistOptions) { const path = '/api/v1/users/me/blocklist/accounts' @@ -40,10 +39,12 @@ export class BlocklistCommand extends AbstractCommand { // --------------------------------------------------------------------------- - getStatus (options: OverrideCommandOptions & { - accounts?: string[] - hosts?: string[] - }) { + getStatus ( + options: OverrideCommandOptions & { + accounts?: string[] + hosts?: string[] + } + ) { const { accounts, hosts } = options const path = '/api/v1/blocklist/status' @@ -63,10 +64,12 @@ export class BlocklistCommand extends AbstractCommand { // --------------------------------------------------------------------------- - addToMyBlocklist (options: OverrideCommandOptions & { - account?: string - server?: string - }) { + addToMyBlocklist ( + options: OverrideCommandOptions & { + account?: string + server?: string + } + ) { const { account, server } = options const path = account @@ -86,10 +89,12 @@ export class BlocklistCommand extends AbstractCommand { }) } - addToServerBlocklist (options: OverrideCommandOptions & { - account?: string - server?: string - }) { + addToServerBlocklist ( + options: OverrideCommandOptions & { + account?: string + server?: string + } + ) { const { account, server } = options const path = account @@ -111,10 +116,12 @@ export class BlocklistCommand extends AbstractCommand { // --------------------------------------------------------------------------- - removeFromMyBlocklist (options: OverrideCommandOptions & { - account?: string - server?: string - }) { + removeFromMyBlocklist ( + options: OverrideCommandOptions & { + account?: string + server?: string + } + ) { const { account, server } = options const path = account @@ -130,10 +137,12 @@ export class BlocklistCommand extends AbstractCommand { }) } - removeFromServerBlocklist (options: OverrideCommandOptions & { - account?: string - server?: string - }) { + removeFromServerBlocklist ( + options: OverrideCommandOptions & { + account?: string + server?: string + } + ) { const { account, server } = options const path = account @@ -149,7 +158,7 @@ export class BlocklistCommand extends AbstractCommand { }) } - private listBlocklist (options: ListBlocklistOptions, path: string) { + private listBlocklist (options: ListBlocklistOptions, path: string) { const { start, count, search, sort = '-createdAt' } = options return this.getRequestBody>({ @@ -161,5 +170,4 @@ export class BlocklistCommand extends AbstractCommand { defaultExpectedStatus: HttpStatusCode.OK_200 }) } - } diff --git a/packages/server-commands/src/videos/index.ts b/packages/server-commands/src/videos/index.ts index df624b99a0..1115190292 100644 --- a/packages/server-commands/src/videos/index.ts +++ b/packages/server-commands/src/videos/index.ts @@ -17,7 +17,6 @@ export * from './services-command.js' export * from './storyboard-command.js' export * from './streaming-playlists-command.js' export * from './video-embed-privacy-command.js' -export * from './comments-command.js' export * from './video-studio-command.js' export * from './video-token-command.js' export * from './views-command.js' diff --git a/packages/server-commands/src/videos/live-command.ts b/packages/server-commands/src/videos/live-command.ts index fcc1475330..9009a89555 100644 --- a/packages/server-commands/src/videos/live-command.ts +++ b/packages/server-commands/src/videos/live-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { readdir } from 'fs/promises' import { join } from 'path' diff --git a/packages/server-commands/src/videos/video-token-command.ts b/packages/server-commands/src/videos/video-token-command.ts index 5812e484af..6f50e8af86 100644 --- a/packages/server-commands/src/videos/video-token-command.ts +++ b/packages/server-commands/src/videos/video-token-command.ts @@ -1,15 +1,16 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { HttpStatusCode, VideoToken } from '@peertube/peertube-models' import { unwrapBody } from '../requests/index.js' import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js' export class VideoTokenCommand extends AbstractCommand { - - create (options: OverrideCommandOptions & { - videoId: number | string - videoPassword?: string - }) { + create ( + options: OverrideCommandOptions & { + videoId: number | string + videoPassword?: string + } + ) { const { videoId, videoPassword } = options const path = '/api/v1/videos/' + videoId + '/token' @@ -23,10 +24,12 @@ export class VideoTokenCommand extends AbstractCommand { })) } - async getVideoFileToken (options: OverrideCommandOptions & { - videoId: number | string - videoPassword?: string - }) { + async getVideoFileToken ( + options: OverrideCommandOptions & { + videoId: number | string + videoPassword?: string + } + ) { const { files } = await this.create(options) return files.token diff --git a/packages/server-commands/src/videos/videos-command.ts b/packages/server-commands/src/videos/videos-command.ts index 9f5a0a03ab..690444abcd 100644 --- a/packages/server-commands/src/videos/videos-command.ts +++ b/packages/server-commands/src/videos/videos-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { getAllPrivacies, omit, pick, wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/server-commands/src/videos/views-command.ts b/packages/server-commands/src/videos/views-command.ts index 66725413fc..d8e9c61808 100644 --- a/packages/server-commands/src/videos/views-command.ts +++ b/packages/server-commands/src/videos/views-command.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { pick } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoView, VideoViewEvent } from '@peertube/peertube-models' import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js' diff --git a/packages/tests/src/api/activitypub/audience.ts b/packages/tests/src/api/activitypub/audience.ts index cf7f53bfd6..74dbf2ae34 100644 --- a/packages/tests/src/api/activitypub/audience.ts +++ b/packages/tests/src/api/activitypub/audience.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { PeerTubeServer, diff --git a/packages/tests/src/api/activitypub/cleaner.ts b/packages/tests/src/api/activitypub/cleaner.ts index 20415b9a42..534d0c30f2 100644 --- a/packages/tests/src/api/activitypub/cleaner.ts +++ b/packages/tests/src/api/activitypub/cleaner.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { SQLCommand } from '@tests/shared/sql-command.js' diff --git a/packages/tests/src/api/activitypub/client.ts b/packages/tests/src/api/activitypub/client.ts index a3be71951e..5b403068e3 100644 --- a/packages/tests/src/api/activitypub/client.ts +++ b/packages/tests/src/api/activitypub/client.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { arrayify } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/activitypub/fetch.ts b/packages/tests/src/api/activitypub/fetch.ts index c7f5288cc7..7d06a96bf2 100644 --- a/packages/tests/src/api/activitypub/fetch.ts +++ b/packages/tests/src/api/activitypub/fetch.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { SQLCommand } from '@tests/shared/sql-command.js' diff --git a/packages/tests/src/api/activitypub/forward.ts b/packages/tests/src/api/activitypub/forward.ts index 0afca40ee2..99589a6060 100644 --- a/packages/tests/src/api/activitypub/forward.ts +++ b/packages/tests/src/api/activitypub/forward.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { PeerTubeServer, cleanupTests, createMultipleServers, setAccessTokensToServers, waitJobs } from '@peertube/peertube-server-commands' import { expect } from 'chai' diff --git a/packages/tests/src/api/activitypub/refresher.ts b/packages/tests/src/api/activitypub/refresher.ts index 90aa1a5ade..d5b66efd61 100644 --- a/packages/tests/src/api/activitypub/refresher.ts +++ b/packages/tests/src/api/activitypub/refresher.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { SQLCommand } from '@tests/shared/sql-command.js' import { wait } from '@peertube/peertube-core-utils' @@ -68,7 +68,6 @@ describe('Test AP refresher', function () { }) describe('Videos refresher', function () { - it('Should remove a deleted remote video', async function () { this.timeout(60000) @@ -107,7 +106,6 @@ describe('Test AP refresher', function () { }) describe('Actors refresher', function () { - it('Should remove a deleted actor', async function () { this.timeout(60000) @@ -130,7 +128,6 @@ describe('Test AP refresher', function () { }) describe('Playlist refresher', function () { - it('Should remove a deleted playlist', async function () { this.timeout(60000) diff --git a/packages/tests/src/api/activitypub/security.ts b/packages/tests/src/api/activitypub/security.ts index 4a53230b0f..fb27809121 100644 --- a/packages/tests/src/api/activitypub/security.ts +++ b/packages/tests/src/api/activitypub/security.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/abuses.ts b/packages/tests/src/api/check-params/abuses.ts index d2f8a7c0e3..5a53a2fbbf 100644 --- a/packages/tests/src/api/check-params/abuses.ts +++ b/packages/tests/src/api/check-params/abuses.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { AbuseCreate, AbuseState, HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/accounts.ts b/packages/tests/src/api/check-params/accounts.ts index c3695827b1..22095c1112 100644 --- a/packages/tests/src/api/check-params/accounts.ts +++ b/packages/tests/src/api/check-params/accounts.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/auto-tags.ts b/packages/tests/src/api/check-params/auto-tags.ts index 6ec7ec126a..011d000785 100644 --- a/packages/tests/src/api/check-params/auto-tags.ts +++ b/packages/tests/src/api/check-params/auto-tags.ts @@ -1,10 +1,11 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { PeerTubeServer, cleanupTests, - createSingleServer, setAccessTokensToServers, + createSingleServer, + setAccessTokensToServers, setDefaultVideoChannel } from '@peertube/peertube-server-commands' @@ -49,7 +50,6 @@ describe('Test auto tag policies API validator', function () { }) describe('When getting available server auto tags', function () { - it('Should fail without token', async function () { await server.autoTags.getServerAvailable({ token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) }) diff --git a/packages/tests/src/api/check-params/blocklist.ts b/packages/tests/src/api/check-params/blocklist.ts index 3c6c362018..d7461eea8e 100644 --- a/packages/tests/src/api/check-params/blocklist.ts +++ b/packages/tests/src/api/check-params/blocklist.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/bulk.ts b/packages/tests/src/api/check-params/bulk.ts index def0c38eb5..52d4b54d39 100644 --- a/packages/tests/src/api/check-params/bulk.ts +++ b/packages/tests/src/api/check-params/bulk.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/channel-collaborators.ts b/packages/tests/src/api/check-params/channel-collaborators.ts index ad1e811950..52879b8491 100644 --- a/packages/tests/src/api/check-params/channel-collaborators.ts +++ b/packages/tests/src/api/check-params/channel-collaborators.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/channel-import-videos.ts b/packages/tests/src/api/check-params/channel-import-videos.ts index 3ada14ebb6..4e7b834c18 100644 --- a/packages/tests/src/api/check-params/channel-import-videos.ts +++ b/packages/tests/src/api/check-params/channel-import-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/check-params/channels.ts b/packages/tests/src/api/check-params/channels.ts index 80ff739466..7a421a5139 100644 --- a/packages/tests/src/api/check-params/channels.ts +++ b/packages/tests/src/api/check-params/channels.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { omit } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoChannelUpdate } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/config.ts b/packages/tests/src/api/check-params/config.ts index acb05fc36b..6dfcbb3be3 100644 --- a/packages/tests/src/api/check-params/config.ts +++ b/packages/tests/src/api/check-params/config.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { omit } from '@peertube/peertube-core-utils' import { ActorImageType, CustomConfig, HttpStatusCode, LogoType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/contact-form.ts b/packages/tests/src/api/check-params/contact-form.ts index a694661376..80d9193ac1 100644 --- a/packages/tests/src/api/check-params/contact-form.ts +++ b/packages/tests/src/api/check-params/contact-form.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/custom-pages.ts b/packages/tests/src/api/check-params/custom-pages.ts index 180a5e406a..03f991f05d 100644 --- a/packages/tests/src/api/check-params/custom-pages.ts +++ b/packages/tests/src/api/check-params/custom-pages.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { @@ -31,7 +31,6 @@ describe('Test custom pages validators', function () { }) describe('When updating instance homepage', function () { - it('Should fail with an unauthenticated user', async function () { await makePutBodyRequest({ url: server.url, @@ -63,7 +62,6 @@ describe('Test custom pages validators', function () { }) describe('When getting instance homapage', function () { - it('Should succeed with the correct params', async function () { await makeGetRequest({ url: server.url, diff --git a/packages/tests/src/api/check-params/debug.ts b/packages/tests/src/api/check-params/debug.ts index 4a7c18a62e..c7838012cf 100644 --- a/packages/tests/src/api/check-params/debug.ts +++ b/packages/tests/src/api/check-params/debug.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { @@ -32,7 +32,6 @@ describe('Test debug API validators', function () { }) describe('When getting debug endpoint', function () { - it('Should fail with a non authenticated user', async function () { await makeGetRequest({ url: server.url, diff --git a/packages/tests/src/api/check-params/follows.ts b/packages/tests/src/api/check-params/follows.ts index 1a2661bd90..9bfa9e06a7 100644 --- a/packages/tests/src/api/check-params/follows.ts +++ b/packages/tests/src/api/check-params/follows.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/jobs.ts b/packages/tests/src/api/check-params/jobs.ts index 23f52122ec..b4f36055f9 100644 --- a/packages/tests/src/api/check-params/jobs.ts +++ b/packages/tests/src/api/check-params/jobs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/live.ts b/packages/tests/src/api/check-params/live.ts index 2fff19e853..a40e96970f 100644 --- a/packages/tests/src/api/check-params/live.ts +++ b/packages/tests/src/api/check-params/live.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { omit } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/check-params/logs.ts b/packages/tests/src/api/check-params/logs.ts index e1cdbe61e1..4a56bb74ce 100644 --- a/packages/tests/src/api/check-params/logs.ts +++ b/packages/tests/src/api/check-params/logs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode } from '@peertube/peertube-models' @@ -33,7 +33,6 @@ describe('Test logs API validators', function () { }) describe('When getting logs', function () { - it('Should fail with a non authenticated user', async function () { await makeGetRequest({ url: server.url, diff --git a/packages/tests/src/api/check-params/metrics.ts b/packages/tests/src/api/check-params/metrics.ts index 0dfae26d02..16254f7a91 100644 --- a/packages/tests/src/api/check-params/metrics.ts +++ b/packages/tests/src/api/check-params/metrics.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { omit } from '@peertube/peertube-core-utils' import { HttpStatusCode, PlaybackMetricCreate, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/player-settings.ts b/packages/tests/src/api/check-params/player-settings.ts index 0360027a86..c9e0bb912a 100644 --- a/packages/tests/src/api/check-params/player-settings.ts +++ b/packages/tests/src/api/check-params/player-settings.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, PlayerChannelSettings, PlayerVideoSettings, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/plugins.ts b/packages/tests/src/api/check-params/plugins.ts index 7124ad6ee1..875ddd61d3 100644 --- a/packages/tests/src/api/check-params/plugins.ts +++ b/packages/tests/src/api/check-params/plugins.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode, PeerTubePlugin, PluginType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/redundancy.ts b/packages/tests/src/api/check-params/redundancy.ts index f7e79bc226..4023d55db6 100644 --- a/packages/tests/src/api/check-params/redundancy.ts +++ b/packages/tests/src/api/check-params/redundancy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode, VideoCreateResult } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/runners.ts b/packages/tests/src/api/check-params/runners.ts index fba47d9675..3badbb42e3 100644 --- a/packages/tests/src/api/check-params/runners.ts +++ b/packages/tests/src/api/check-params/runners.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, HttpStatusCodeType, diff --git a/packages/tests/src/api/check-params/search.ts b/packages/tests/src/api/check-params/search.ts index 2ceb572124..06aad2cc6c 100644 --- a/packages/tests/src/api/check-params/search.ts +++ b/packages/tests/src/api/check-params/search.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' diff --git a/packages/tests/src/api/check-params/services.ts b/packages/tests/src/api/check-params/services.ts index d317a7ef52..eb43be7a89 100644 --- a/packages/tests/src/api/check-params/services.ts +++ b/packages/tests/src/api/check-params/services.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, diff --git a/packages/tests/src/api/check-params/static.ts b/packages/tests/src/api/check-params/static.ts index 12136a2ace..1e863f1fb4 100644 --- a/packages/tests/src/api/check-params/static.ts +++ b/packages/tests/src/api/check-params/static.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getHLS } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoDetails, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/token-session.ts b/packages/tests/src/api/check-params/token-session.ts index e957c1f53d..22c2fb5d16 100644 --- a/packages/tests/src/api/check-params/token-session.ts +++ b/packages/tests/src/api/check-params/token-session.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, User } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/transcoding.ts b/packages/tests/src/api/check-params/transcoding.ts index 87f5a40ac5..0e7b03a13f 100644 --- a/packages/tests/src/api/check-params/transcoding.ts +++ b/packages/tests/src/api/check-params/transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserRole } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/two-factor.ts b/packages/tests/src/api/check-params/two-factor.ts index 0b1766eca2..e6042228d6 100644 --- a/packages/tests/src/api/check-params/two-factor.ts +++ b/packages/tests/src/api/check-params/two-factor.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { @@ -48,7 +48,6 @@ describe('Test two factor API validators', function () { }) describe('When requesting two factor', function () { - it('Should fail with an unknown user id', async function () { await server.twoFactor.request({ userId: 42, currentPassword: rootPassword, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) }) @@ -117,7 +116,6 @@ describe('Test two factor API validators', function () { }) describe('When confirming two factor request', function () { - it('Should fail with an unknown user id', async function () { await server.twoFactor.confirmRequest({ userId: 42, @@ -223,7 +221,6 @@ describe('Test two factor API validators', function () { }) describe('When disabling two factor', function () { - it('Should fail with an unknown user id', async function () { await server.twoFactor.disable({ userId: 42, diff --git a/packages/tests/src/api/check-params/upload-quota.ts b/packages/tests/src/api/check-params/upload-quota.ts index 017f575265..6cf9907666 100644 --- a/packages/tests/src/api/check-params/upload-quota.ts +++ b/packages/tests/src/api/check-params/upload-quota.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { randomInt } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/user-export.ts b/packages/tests/src/api/check-params/user-export.ts index 5e44e2eb18..aae1045034 100644 --- a/packages/tests/src/api/check-params/user-export.ts +++ b/packages/tests/src/api/check-params/user-export.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode } from '@peertube/peertube-models' @@ -43,7 +43,6 @@ describe('Test user export API validators', function () { }) describe('Request export', function () { - it('Should fail if export is disabled', async function () { await server.config.disableUserExport() @@ -134,7 +133,6 @@ describe('Test user export API validators', function () { }) describe('List exports', function () { - it('Should fail if export is disabled', async function () { await server.config.disableUserExport() @@ -180,7 +178,6 @@ describe('Test user export API validators', function () { }) describe('Deleting export', function () { - before(async function () { const { export: { id } } = await server.userExports.request({ userId, withVideoFiles: true }) userExportId = id @@ -258,7 +255,6 @@ describe('Test user export API validators', function () { }) describe('Downloading an export', function () { - before(async function () { await server.userExports.request({ userId, withVideoFiles: true }) await server.userExports.waitForCreation({ userId }) diff --git a/packages/tests/src/api/check-params/user-import.ts b/packages/tests/src/api/check-params/user-import.ts index 545a3e46f5..9429bf09c5 100644 --- a/packages/tests/src/api/check-params/user-import.ts +++ b/packages/tests/src/api/check-params/user-import.ts @@ -1,13 +1,7 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' -import { - cleanupTests, - createSingleServer, - PeerTubeServer, - setAccessTokensToServers, - waitJobs -} from '@peertube/peertube-server-commands' +import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@peertube/peertube-server-commands' import { expect } from 'chai' describe('Test user import API validators', function () { diff --git a/packages/tests/src/api/check-params/user-me.ts b/packages/tests/src/api/check-params/user-me.ts index 10085f46eb..ec55096943 100644 --- a/packages/tests/src/api/check-params/user-me.ts +++ b/packages/tests/src/api/check-params/user-me.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserNewFeatureInfo, UserRole, VideoCreateResult } from '@peertube/peertube-models' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/check-params/user-notifications.ts b/packages/tests/src/api/check-params/user-notifications.ts index d9ab1bc226..b1c032b650 100644 --- a/packages/tests/src/api/check-params/user-notifications.ts +++ b/packages/tests/src/api/check-params/user-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { io } from 'socket.io-client' import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' diff --git a/packages/tests/src/api/check-params/user-subscriptions.ts b/packages/tests/src/api/check-params/user-subscriptions.ts index ba34697cb4..b7f411282c 100644 --- a/packages/tests/src/api/check-params/user-subscriptions.ts +++ b/packages/tests/src/api/check-params/user-subscriptions.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { cleanupTests, diff --git a/packages/tests/src/api/check-params/users-admin.ts b/packages/tests/src/api/check-params/users-admin.ts index 5c942918f8..d8f1acb0e4 100644 --- a/packages/tests/src/api/check-params/users-admin.ts +++ b/packages/tests/src/api/check-params/users-admin.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadSort, checkBadStartPagination } from '@tests/shared/checks.js' import { MockSmtpServer } from '@tests/shared/mock-servers/mock-email.js' diff --git a/packages/tests/src/api/check-params/users-emails.ts b/packages/tests/src/api/check-params/users-emails.ts index 77abe766ca..b4356b617d 100644 --- a/packages/tests/src/api/check-params/users-emails.ts +++ b/packages/tests/src/api/check-params/users-emails.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserRole } from '@peertube/peertube-models' import { cleanupTests, diff --git a/packages/tests/src/api/check-params/video-blacklist.ts b/packages/tests/src/api/check-params/video-blacklist.ts index 694ddc7c2c..34c5850d4e 100644 --- a/packages/tests/src/api/check-params/video-blacklist.ts +++ b/packages/tests/src/api/check-params/video-blacklist.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoBlacklistType } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/video-captions.ts b/packages/tests/src/api/check-params/video-captions.ts index 79f33a1fcd..ef6357885e 100644 --- a/packages/tests/src/api/check-params/video-captions.ts +++ b/packages/tests/src/api/check-params/video-captions.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/video-change-ownership.ts b/packages/tests/src/api/check-params/video-change-ownership.ts index 87f5a19ffc..d506f65c7c 100644 --- a/packages/tests/src/api/check-params/video-change-ownership.ts +++ b/packages/tests/src/api/check-params/video-change-ownership.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoCreateResult } from '@peertube/peertube-models' import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/check-params/video-chapters.ts b/packages/tests/src/api/check-params/video-chapters.ts index e8e10796be..a886f6ef82 100644 --- a/packages/tests/src/api/check-params/video-chapters.ts +++ b/packages/tests/src/api/check-params/video-chapters.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, Video, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/video-comments.ts b/packages/tests/src/api/check-params/video-comments.ts index 8c58fca536..5f37ce87d5 100644 --- a/packages/tests/src/api/check-params/video-comments.ts +++ b/packages/tests/src/api/check-params/video-comments.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoCommentPolicy, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/video-files.ts b/packages/tests/src/api/check-params/video-files.ts index 5f4ff98835..210091f635 100644 --- a/packages/tests/src/api/check-params/video-files.ts +++ b/packages/tests/src/api/check-params/video-files.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, getHLS } from '@peertube/peertube-core-utils' import { HttpStatusCode, UserRole, VideoDetails, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/video-imports.ts b/packages/tests/src/api/check-params/video-imports.ts index 766ff8b4cd..483f2f141e 100644 --- a/packages/tests/src/api/check-params/video-imports.ts +++ b/packages/tests/src/api/check-params/video-imports.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { omit } from '@peertube/peertube-core-utils' import { HttpStatusCode, NSFWFlag, VideoCommentPolicy, VideoImportCreate, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/video-playlists.ts b/packages/tests/src/api/check-params/video-playlists.ts index 5b310f0746..1755dc108e 100644 --- a/packages/tests/src/api/check-params/video-playlists.ts +++ b/packages/tests/src/api/check-params/video-playlists.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, diff --git a/packages/tests/src/api/check-params/video-storyboards.ts b/packages/tests/src/api/check-params/video-storyboards.ts index 50e657a60a..e673ac0e3c 100644 --- a/packages/tests/src/api/check-params/video-storyboards.ts +++ b/packages/tests/src/api/check-params/video-storyboards.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/check-params/video-studio.ts b/packages/tests/src/api/check-params/video-studio.ts index f307a57f62..1da3726f4a 100644 --- a/packages/tests/src/api/check-params/video-studio.ts +++ b/packages/tests/src/api/check-params/video-studio.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, HttpStatusCodeType, VideoStudioTask } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/video-token.ts b/packages/tests/src/api/check-params/video-token.ts index a7ea5725a8..b2274d96b7 100644 --- a/packages/tests/src/api/check-params/video-token.ts +++ b/packages/tests/src/api/check-params/video-token.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/check-params/video-transcription.ts b/packages/tests/src/api/check-params/video-transcription.ts index e780c4fd86..8647b813bd 100644 --- a/packages/tests/src/api/check-params/video-transcription.ts +++ b/packages/tests/src/api/check-params/video-transcription.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserRole } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/videos-common-filters.ts b/packages/tests/src/api/check-params/videos-common-filters.ts index d03748471c..f91a033707 100644 --- a/packages/tests/src/api/check-params/videos-common-filters.ts +++ b/packages/tests/src/api/check-params/videos-common-filters.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { pick } from '@peertube/peertube-core-utils' import { HttpStatusCode, HttpStatusCodeType, UserRole, VideoInclude, VideoPrivacy, VideosCommonQuery } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/check-params/videos-history.ts b/packages/tests/src/api/check-params/videos-history.ts index 65d1e9fac4..1ea2699595 100644 --- a/packages/tests/src/api/check-params/videos-history.ts +++ b/packages/tests/src/api/check-params/videos-history.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { checkBadCountPagination, checkBadStartPagination } from '@tests/shared/checks.js' import { HttpStatusCode } from '@peertube/peertube-models' @@ -35,7 +35,6 @@ describe('Test videos history API validator', function () { }) describe('When notifying a user is watching a video', function () { - it('Should fail with a bad token', async function () { const fields = { currentTime: 5 } await makePutBodyRequest({ url: server.url, path: viewPath, fields, token: 'bad', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) diff --git a/packages/tests/src/api/check-params/videos-overviews.ts b/packages/tests/src/api/check-params/videos-overviews.ts index ba6f6ac694..5ee02f925b 100644 --- a/packages/tests/src/api/check-params/videos-overviews.ts +++ b/packages/tests/src/api/check-params/videos-overviews.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { cleanupTests, createSingleServer, PeerTubeServer } from '@peertube/peertube-server-commands' @@ -14,7 +14,6 @@ describe('Test videos overview API validator', function () { }) describe('When getting videos overview', function () { - it('Should fail with a bad pagination', async function () { await server.overviews.getVideos({ page: 0, expectedStatus: 400 }) await server.overviews.getVideos({ page: 100, expectedStatus: 400 }) diff --git a/packages/tests/src/api/check-params/videos.ts b/packages/tests/src/api/check-params/videos.ts index 998e8572c4..615451eda4 100644 --- a/packages/tests/src/api/check-params/videos.ts +++ b/packages/tests/src/api/check-params/videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { omit, randomInt } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/check-params/views-and-stats.ts b/packages/tests/src/api/check-params/views-and-stats.ts index 993477551b..f6466d47f2 100644 --- a/packages/tests/src/api/check-params/views-and-stats.ts +++ b/packages/tests/src/api/check-params/views-and-stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/watched-words.ts b/packages/tests/src/api/check-params/watched-words.ts index 1e1340f31e..d53bd55a6a 100644 --- a/packages/tests/src/api/check-params/watched-words.ts +++ b/packages/tests/src/api/check-params/watched-words.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserRole } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/live/live-audio-or-video-only.ts b/packages/tests/src/api/live/live-audio-or-video-only.ts index b5d5dbb1ff..2700b74f5a 100644 --- a/packages/tests/src/api/live/live-audio-or-video-only.ts +++ b/packages/tests/src/api/live/live-audio-or-video-only.ts @@ -1,9 +1,10 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { Video, VideoResolution } from '@peertube/peertube-models' import { PeerTubeServer, - cleanupTests, createMultipleServers, + cleanupTests, + createMultipleServers, doubleFollow, findExternalSavedVideo, setAccessTokensToServers, diff --git a/packages/tests/src/api/live/live-constraints.ts b/packages/tests/src/api/live/live-constraints.ts index cd9cefd349..1890344602 100644 --- a/packages/tests/src/api/live/live-constraints.ts +++ b/packages/tests/src/api/live/live-constraints.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { LiveVideoError, UserVideoQuota, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/live/live-fast-restream.ts b/packages/tests/src/api/live/live-fast-restream.ts index 61e3ee9c82..ac02aac58b 100644 --- a/packages/tests/src/api/live/live-fast-restream.ts +++ b/packages/tests/src/api/live/live-fast-restream.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/live/live-permanent.ts b/packages/tests/src/api/live/live-permanent.ts index 2206887d31..6e3148e129 100644 --- a/packages/tests/src/api/live/live-permanent.ts +++ b/packages/tests/src/api/live/live-permanent.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { LiveVideoCreate, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/live/live-privacy-update.ts b/packages/tests/src/api/live/live-privacy-update.ts index 139e32a1c5..e1b30fbfa2 100644 --- a/packages/tests/src/api/live/live-privacy-update.ts +++ b/packages/tests/src/api/live/live-privacy-update.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/live/live-rtmps.ts b/packages/tests/src/api/live/live-rtmps.ts index cd16460c3b..1839d97aa3 100644 --- a/packages/tests/src/api/live/live-rtmps.ts +++ b/packages/tests/src/api/live/live-rtmps.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPrivacy } from '@peertube/peertube-models' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/live/live-save-replay.ts b/packages/tests/src/api/live/live-save-replay.ts index 3136e7c6ea..77d272b8ce 100644 --- a/packages/tests/src/api/live/live-save-replay.ts +++ b/packages/tests/src/api/live/live-save-replay.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/live/live-socket-messages.ts b/packages/tests/src/api/live/live-socket-messages.ts index ea9151867b..179552bb00 100644 --- a/packages/tests/src/api/live/live-socket-messages.ts +++ b/packages/tests/src/api/live/live-socket-messages.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { LiveVideoCreate, LiveVideoEventPayload, VideoPrivacy, VideoState, VideoStateType } from '@peertube/peertube-models' @@ -35,7 +35,6 @@ describe('Test live socket messages', function () { }) describe('Live socket messages', function () { - async function createLiveWrapper (options: Partial = {}) { const liveAttributes = { name: 'live video', @@ -114,7 +113,9 @@ describe('Test live socket messages', function () { const videoId = await servers[0].videos.getId({ uuid: liveVideoUUID }) const localSocket = servers[0].socketIO.getLiveNotificationSocket() - localSocket.on('views-change', (data: LiveVideoEventPayload) => { localLastVideoViewers = data.viewers }) + localSocket.on('views-change', (data: LiveVideoEventPayload) => { + localLastVideoViewers = data.viewers + }) localSocket.emit('subscribe', { videoId }) } @@ -122,7 +123,9 @@ describe('Test live socket messages', function () { const videoId = await servers[1].videos.getId({ uuid: liveVideoUUID }) const remoteSocket = servers[1].socketIO.getLiveNotificationSocket() - remoteSocket.on('views-change', (data: LiveVideoEventPayload) => { remoteLastVideoViewers = data.viewers }) + remoteSocket.on('views-change', (data: LiveVideoEventPayload) => { + remoteLastVideoViewers = data.viewers + }) remoteSocket.emit('subscribe', { videoId }) } @@ -200,7 +203,9 @@ describe('Test live socket messages', function () { const videoId = await servers[0].videos.getId({ uuid: liveVideoUUID }) const localSocket = servers[0].socketIO.getLiveNotificationSocket() - localSocket.on('force-end', () => { hadForcedEndEvent = true }) + localSocket.on('force-end', () => { + hadForcedEndEvent = true + }) localSocket.emit('subscribe', { videoId }) } @@ -220,7 +225,7 @@ describe('Test live socket messages', function () { // Streaming session #2 ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo(rtmpOptions) - // eslint-disable-next-line no-unmodified-loop-condition + // oxlint-disable-next-line no-unmodified-loop-condition while (!hadForcedEndEvent) { await wait(500) } diff --git a/packages/tests/src/api/live/live.ts b/packages/tests/src/api/live/live.ts index ca4455195c..5c49dfbd65 100644 --- a/packages/tests/src/api/live/live.ts +++ b/packages/tests/src/api/live/live.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, wait } from '@peertube/peertube-core-utils' import { ffprobePromise } from '@peertube/peertube-ffmpeg' diff --git a/packages/tests/src/api/moderation/abuses.ts b/packages/tests/src/api/moderation/abuses.ts index 5e08921f66..4f27fdbc57 100644 --- a/packages/tests/src/api/moderation/abuses.ts +++ b/packages/tests/src/api/moderation/abuses.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/moderation/automatic-tags.ts b/packages/tests/src/api/moderation/automatic-tags.ts index 228a947c3b..5751e39f98 100644 --- a/packages/tests/src/api/moderation/automatic-tags.ts +++ b/packages/tests/src/api/moderation/automatic-tags.ts @@ -1,8 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPrivacy } from '@peertube/peertube-models' import { - cleanupTests, createMultipleServers, + cleanupTests, + createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, @@ -27,17 +28,15 @@ describe('Test automatic tags', function () { await servers[1].config.enableLive({ allowReplay: false }) - await doubleFollow(servers[0], servers[1]); + await doubleFollow(servers[0], servers[1]) - ({ uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'video' })) + ;({ uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'video' })) await waitJobs(servers) }) describe('Automatic tags on comments', function () { - describe('Built in external link auto tag', function () { - it('Should not assign external-link automatic tag with no URL inside the comment', async function () { const tests = [ 'my super comment', @@ -211,7 +210,6 @@ describe('Test automatic tags', function () { }) describe('Searching comments with specific tags', function () { - it('Should search in "comments on my videos" comments with specific automatic tags', async function () { { const { total, data } = await servers[0].comments.listCommentsOnMyVideos({ autoTagOneOf: [ 'unknown' ] }) @@ -251,11 +249,9 @@ describe('Test automatic tags', function () { } }) }) - }) describe('Automatic tags on videos', function () { - before(async function () { await servers[0].videos.removeAll() @@ -263,7 +259,6 @@ describe('Test automatic tags', function () { }) describe('Built in external link auto tag', function () { - it('Should not assign external-link automatic tag with no URL inside the video', async function () { const tests = [ 'my super video', @@ -461,7 +456,6 @@ describe('Test automatic tags', function () { }) describe('Searching videos with specific tags', function () { - it('Should search in admin videos with specific automatic tags', async function () { { const { total, data } = await servers[0].videos.listAllForAdmin({ autoTagOneOf: [ 'picsou list' ] }) @@ -480,7 +474,6 @@ describe('Test automatic tags', function () { } }) }) - }) after(async function () { diff --git a/packages/tests/src/api/moderation/blocklist-notification.ts b/packages/tests/src/api/moderation/blocklist-notification.ts index abf36313be..c5abc89644 100644 --- a/packages/tests/src/api/moderation/blocklist-notification.ts +++ b/packages/tests/src/api/moderation/blocklist-notification.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { UserNotificationType, UserNotificationType_Type } from '@peertube/peertube-models' @@ -55,7 +55,6 @@ describe('Test blocklist notifications', function () { } { - await servers[1].subscriptions.add({ token: remoteUserToken, targetUri: 'user1_channel@' + servers[0].host }) await servers[1].subscriptions.add({ token: remoteUserToken, targetUri: 'user2_channel@' + servers[0].host }) } @@ -100,7 +99,6 @@ describe('Test blocklist notifications', function () { }) describe('User blocks another user', function () { - before(async function () { this.timeout(30000) @@ -131,7 +129,6 @@ describe('Test blocklist notifications', function () { }) describe('User blocks another server', function () { - before(async function () { this.timeout(30000) @@ -162,7 +159,6 @@ describe('Test blocklist notifications', function () { }) describe('Server blocks a user', function () { - before(async function () { this.timeout(30000) @@ -195,7 +191,6 @@ describe('Test blocklist notifications', function () { }) describe('Server blocks a server', function () { - before(async function () { this.timeout(30000) diff --git a/packages/tests/src/api/moderation/blocklist.ts b/packages/tests/src/api/moderation/blocklist.ts index 5cb2d6a0d2..e8ec201847 100644 --- a/packages/tests/src/api/moderation/blocklist.ts +++ b/packages/tests/src/api/moderation/blocklist.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { UserNotificationType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/moderation/comment-approval.ts b/packages/tests/src/api/moderation/comment-approval.ts index 0c330b945a..8e2b29265e 100644 --- a/packages/tests/src/api/moderation/comment-approval.ts +++ b/packages/tests/src/api/moderation/comment-approval.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ActivityApproveReply, diff --git a/packages/tests/src/api/moderation/video-blacklist.ts b/packages/tests/src/api/moderation/video-blacklist.ts index d40ae0c927..a69b2266fc 100644 --- a/packages/tests/src/api/moderation/video-blacklist.ts +++ b/packages/tests/src/api/moderation/video-blacklist.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { sortObjectComparator } from '@peertube/peertube-core-utils' import { HttpStatusCode, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/moderation/watched-words.ts b/packages/tests/src/api/moderation/watched-words.ts index 3665529ff1..c6c138ee5a 100644 --- a/packages/tests/src/api/moderation/watched-words.ts +++ b/packages/tests/src/api/moderation/watched-words.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { cleanupTests, diff --git a/packages/tests/src/api/notifications/admin-notifications.ts b/packages/tests/src/api/notifications/admin-notifications.ts index 71db9e2e4a..7113cdde97 100644 --- a/packages/tests/src/api/notifications/admin-notifications.ts +++ b/packages/tests/src/api/notifications/admin-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { PluginType, UserNotification, UserNotificationType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/notifications/caption-notifications.ts b/packages/tests/src/api/notifications/caption-notifications.ts index 27449f8230..415ebbfd88 100644 --- a/packages/tests/src/api/notifications/caption-notifications.ts +++ b/packages/tests/src/api/notifications/caption-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification } from '@peertube/peertube-models' import { PeerTubeServer, cleanupTests, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/notifications/channel-collaborators-notification.ts b/packages/tests/src/api/notifications/channel-collaborators-notification.ts index 3bdc2cc1ab..1a97174ee2 100644 --- a/packages/tests/src/api/notifications/channel-collaborators-notification.ts +++ b/packages/tests/src/api/notifications/channel-collaborators-notification.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationType } from '@peertube/peertube-models' import { cleanupTests, PeerTubeServer, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/notifications/comments-notifications.ts b/packages/tests/src/api/notifications/comments-notifications.ts index 04e9dd74d4..85dcdb79b7 100644 --- a/packages/tests/src/api/notifications/comments-notifications.ts +++ b/packages/tests/src/api/notifications/comments-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationType, VideoCommentPolicy } from '@peertube/peertube-models' import { PeerTubeServer, cleanupTests, setDefaultAccountAvatar, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/notifications/moderation-notifications.ts b/packages/tests/src/api/notifications/moderation-notifications.ts index 1a5fb6959a..f1873e25fd 100644 --- a/packages/tests/src/api/notifications/moderation-notifications.ts +++ b/packages/tests/src/api/notifications/moderation-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { AbuseState, UserNotification, UserRole, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/notifications/notifications-api.ts b/packages/tests/src/api/notifications/notifications-api.ts index 3509522913..abebce18a5 100644 --- a/packages/tests/src/api/notifications/notifications-api.ts +++ b/packages/tests/src/api/notifications/notifications-api.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationSettingValue, UserNotificationType } from '@peertube/peertube-models' import { cleanupTests, PeerTubeServer, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/notifications/registrations-notifications.ts b/packages/tests/src/api/notifications/registrations-notifications.ts index a15272fa20..fab94116b7 100644 --- a/packages/tests/src/api/notifications/registrations-notifications.ts +++ b/packages/tests/src/api/notifications/registrations-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification } from '@peertube/peertube-models' import { cleanupTests, PeerTubeServer, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/notifications/user-notifications.ts b/packages/tests/src/api/notifications/user-notifications.ts index 82f80cf0d5..4ec6bdac9d 100644 --- a/packages/tests/src/api/notifications/user-notifications.ts +++ b/packages/tests/src/api/notifications/user-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { UserNotification, UserNotificationType, VideoPrivacy, VideoStudioTask } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/object-storage/live.ts b/packages/tests/src/api/object-storage/live.ts index ae77bb1582..470deea579 100644 --- a/packages/tests/src/api/object-storage/live.ts +++ b/packages/tests/src/api/object-storage/live.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/object-storage/video-imports.ts b/packages/tests/src/api/object-storage/video-imports.ts index 7cf44387a3..e0d0d227ee 100644 --- a/packages/tests/src/api/object-storage/video-imports.ts +++ b/packages/tests/src/api/object-storage/video-imports.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { expectStartWith } from '@tests/shared/checks.js' @@ -49,7 +49,6 @@ describe('Object storage for video import', function () { }) describe('Without transcoding', async function () { - before(async function () { await server.config.disableTranscoding() }) @@ -73,7 +72,6 @@ describe('Object storage for video import', function () { }) describe('With transcoding', async function () { - before(async function () { await server.config.enableTranscoding({ webVideo: true, hls: true, resolutions: 'max' }) }) diff --git a/packages/tests/src/api/object-storage/video-static-file-privacy.ts b/packages/tests/src/api/object-storage/video-static-file-privacy.ts index 162e20a02a..eda09c65ad 100644 --- a/packages/tests/src/api/object-storage/video-static-file-privacy.ts +++ b/packages/tests/src/api/object-storage/video-static-file-privacy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, getHLS } from '@peertube/peertube-core-utils' import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/object-storage/videos.ts b/packages/tests/src/api/object-storage/videos.ts index fcb1ba73f5..6fcebb667c 100644 --- a/packages/tests/src/api/object-storage/videos.ts +++ b/packages/tests/src/api/object-storage/videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, getHLS } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoDetails } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/redundancy/manage-redundancy.ts b/packages/tests/src/api/redundancy/manage-redundancy.ts index 9a045d8a5c..c1623031f9 100644 --- a/packages/tests/src/api/redundancy/manage-redundancy.ts +++ b/packages/tests/src/api/redundancy/manage-redundancy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPrivacy, VideoRedundanciesTarget } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/redundancy/redundancy-constraints.ts b/packages/tests/src/api/redundancy/redundancy-constraints.ts index f61b5166ba..6804f19c19 100644 --- a/packages/tests/src/api/redundancy/redundancy-constraints.ts +++ b/packages/tests/src/api/redundancy/redundancy-constraints.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/redundancy/redundancy.ts b/packages/tests/src/api/redundancy/redundancy.ts index ad27e0fb57..f5750d044c 100644 --- a/packages/tests/src/api/redundancy/redundancy.ts +++ b/packages/tests/src/api/redundancy/redundancy.ts @@ -1,12 +1,7 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' -import { - VideoDetails, - VideoPrivacy, - VideoRedundancyStrategy, - VideoRedundancyStrategyWithManual -} from '@peertube/peertube-models' +import { VideoDetails, VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@peertube/peertube-models' import { cleanupTests, createMultipleServers, @@ -221,7 +216,6 @@ async function disableRedundancyOnServer1 () { } describe('Test videos redundancy', function () { - describe('With most-views strategy', function () { const strategy = 'most-views' diff --git a/packages/tests/src/api/runners/runner-common.ts b/packages/tests/src/api/runners/runner-common.ts index be36439d34..0e10d72ab4 100644 --- a/packages/tests/src/api/runners/runner-common.ts +++ b/packages/tests/src/api/runners/runner-common.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/runners/runner-generate-storyboard.ts b/packages/tests/src/api/runners/runner-generate-storyboard.ts index a8acdded9f..3efd0bd061 100644 --- a/packages/tests/src/api/runners/runner-generate-storyboard.ts +++ b/packages/tests/src/api/runners/runner-generate-storyboard.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { GenerateStoryboardSuccess, RunnerJobGenerateStoryboardPayload } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/runners/runner-live-transcoding.ts b/packages/tests/src/api/runners/runner-live-transcoding.ts index 2456fa04d5..dc36231309 100644 --- a/packages/tests/src/api/runners/runner-live-transcoding.ts +++ b/packages/tests/src/api/runners/runner-live-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { FfmpegCommand } from 'fluent-ffmpeg' @@ -51,7 +51,6 @@ describe('Test runner live transcoding', function () { }) describe('Without transcoding enabled', function () { - before(async function () { await server.config.enableLive({ allowReplay: false, @@ -87,7 +86,6 @@ describe('Test runner live transcoding', function () { async function testPlaylistFile (fixture: string, expected: string) { const text = await server.streamingPlaylists.get({ url: `${baseUrl}/${video.uuid}/${fixture}` }) expect(await readFile(buildAbsoluteFixturePath(expected), 'utf-8')).to.equal(text) - } async function testTSFile (fixture: string, expected: string) { diff --git a/packages/tests/src/api/runners/runner-socket.ts b/packages/tests/src/api/runners/runner-socket.ts index 0ff44083d6..4bb65191a8 100644 --- a/packages/tests/src/api/runners/runner-socket.ts +++ b/packages/tests/src/api/runners/runner-socket.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' @@ -60,7 +60,7 @@ describe('Test runner socket', function () { await server.videos.quickUpload({ name: 'video1' }) await waitJobs([ server ]) - // eslint-disable-next-line no-unmodified-loop-condition + // oxlint-disable-next-line no-unmodified-loop-condition while (pings !== 1) { await wait(500) } @@ -68,7 +68,7 @@ describe('Test runner socket', function () { await server.videos.quickUpload({ name: 'video2' }) await waitJobs([ server ]) - // eslint-disable-next-line no-unmodified-loop-condition + // oxlint-disable-next-line no-unmodified-loop-condition while ((pings as number) !== 2) { await wait(500) } @@ -84,7 +84,7 @@ describe('Test runner socket', function () { await server.videos.quickUpload({ name: 'video3' }) await waitJobs([ server ]) - // eslint-disable-next-line no-unmodified-loop-condition + // oxlint-disable-next-line no-unmodified-loop-condition while (pings !== 1) { await wait(500) } @@ -92,7 +92,7 @@ describe('Test runner socket', function () { await server.runnerJobs.autoProcessWebVideoJob(runnerToken) await waitJobs([ server ]) - // eslint-disable-next-line no-unmodified-loop-condition + // oxlint-disable-next-line no-unmodified-loop-condition while ((pings as number) !== 2) { await wait(500) } diff --git a/packages/tests/src/api/runners/runner-studio-transcoding.ts b/packages/tests/src/api/runners/runner-studio-transcoding.ts index adf6941c35..e085218591 100644 --- a/packages/tests/src/api/runners/runner-studio-transcoding.ts +++ b/packages/tests/src/api/runners/runner-studio-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { readFile } from 'fs/promises' diff --git a/packages/tests/src/api/runners/runner-transcription.ts b/packages/tests/src/api/runners/runner-transcription.ts index e041f88097..c00313beaf 100644 --- a/packages/tests/src/api/runners/runner-transcription.ts +++ b/packages/tests/src/api/runners/runner-transcription.ts @@ -1,9 +1,6 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import { - RunnerJobTranscriptionPayload, - TranscriptionSuccess -} from '@peertube/peertube-models' +import { RunnerJobTranscriptionPayload, TranscriptionSuccess } from '@peertube/peertube-models' import { PeerTubeServer, cleanupTests, diff --git a/packages/tests/src/api/runners/runner-vod-transcoding.ts b/packages/tests/src/api/runners/runner-vod-transcoding.ts index 33d49fb63e..326b4a2c6e 100644 --- a/packages/tests/src/api/runners/runner-vod-transcoding.ts +++ b/packages/tests/src/api/runners/runner-vod-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { maxBy } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/search/search-activitypub-video-channels.ts b/packages/tests/src/api/search/search-activitypub-video-channels.ts index b63f45b187..8067346034 100644 --- a/packages/tests/src/api/search/search-activitypub-video-channels.ts +++ b/packages/tests/src/api/search/search-activitypub-video-channels.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/search/search-activitypub-video-playlists.ts b/packages/tests/src/api/search/search-activitypub-video-playlists.ts index 33ecfd8e7e..c343c73759 100644 --- a/packages/tests/src/api/search/search-activitypub-video-playlists.ts +++ b/packages/tests/src/api/search/search-activitypub-video-playlists.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/search/search-activitypub-videos.ts b/packages/tests/src/api/search/search-activitypub-videos.ts index 72759f21ed..16e6953071 100644 --- a/packages/tests/src/api/search/search-activitypub-videos.ts +++ b/packages/tests/src/api/search/search-activitypub-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/search/search-channels.ts b/packages/tests/src/api/search/search-channels.ts index 637440e7d6..0423b5fc86 100644 --- a/packages/tests/src/api/search/search-channels.ts +++ b/packages/tests/src/api/search/search-channels.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { VideoChannel } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/search/search-index.ts b/packages/tests/src/api/search/search-index.ts index 552dcc3902..9c76a86b04 100644 --- a/packages/tests/src/api/search/search-index.ts +++ b/packages/tests/src/api/search/search-index.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { BooleanBothQuery, @@ -107,7 +107,7 @@ describe('Test index search', function () { expect(video.licence.label).to.equal('Attribution - Share Alike') expect(video.privacy.label).to.equal('Public') expect(video.duration).to.equal(113) - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated expect(video.thumbnailUrl.startsWith('https://framatube.org/lazy-static/thumbnails')).to.be.true expect(video.account.host).to.equal('framatube.org') @@ -376,7 +376,7 @@ describe('Test index search', function () { const videoPlaylist = body.data[0] expect(videoPlaylist.url).to.equal('https://peertube2.cpy.re/videos/watch/playlist/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a') - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated expect(videoPlaylist.thumbnailUrl).to.exist expect(videoPlaylist.embedUrl).to.equal('https://peertube2.cpy.re/video-playlists/embed/fgei1ws1oa6FCaJ2qZPG29') diff --git a/packages/tests/src/api/search/search-playlists.ts b/packages/tests/src/api/search/search-playlists.ts index cd16e202e9..7254060cab 100644 --- a/packages/tests/src/api/search/search-playlists.ts +++ b/packages/tests/src/api/search/search-playlists.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { VideoPlaylistPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/search/search-videos.ts b/packages/tests/src/api/search/search-videos.ts index ef95966b9b..1074a69c64 100644 --- a/packages/tests/src/api/search/search-videos.ts +++ b/packages/tests/src/api/search/search-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/server/auto-follows.ts b/packages/tests/src/api/server/auto-follows.ts index be3696e9b7..ab17347d70 100644 --- a/packages/tests/src/api/server/auto-follows.ts +++ b/packages/tests/src/api/server/auto-follows.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { MockInstancesIndex } from '@tests/shared/mock-servers/mock-instances-index.js' diff --git a/packages/tests/src/api/server/bulk.ts b/packages/tests/src/api/server/bulk.ts index 725bcfef28..7d6bc80e62 100644 --- a/packages/tests/src/api/server/bulk.ts +++ b/packages/tests/src/api/server/bulk.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/api/server/config-defaults.ts b/packages/tests/src/api/server/config-defaults.ts index fd39705458..d3b1739754 100644 --- a/packages/tests/src/api/server/config-defaults.ts +++ b/packages/tests/src/api/server/config-defaults.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoCommentPolicy, VideoDetails, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/config.ts b/packages/tests/src/api/server/config.ts index d99c82c921..6940684062 100644 --- a/packages/tests/src/api/server/config.ts +++ b/packages/tests/src/api/server/config.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ActorImageType, CustomConfig, HttpStatusCode, LogoType, VideoCommentPolicy, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/contact-form.ts b/packages/tests/src/api/server/contact-form.ts index e2bc066128..bad656fba6 100644 --- a/packages/tests/src/api/server/contact-form.ts +++ b/packages/tests/src/api/server/contact-form.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { MockSmtpServer } from '@tests/shared/mock-servers/mock-email.js' diff --git a/packages/tests/src/api/server/email.ts b/packages/tests/src/api/server/email.ts index 3a7823ff3d..cf5ab2afc8 100644 --- a/packages/tests/src/api/server/email.ts +++ b/packages/tests/src/api/server/email.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoCreateResult } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/follow-constraints.ts b/packages/tests/src/api/server/follow-constraints.ts index bc056d81fa..4b3774be72 100644 --- a/packages/tests/src/api/server/follow-constraints.ts +++ b/packages/tests/src/api/server/follow-constraints.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/follows-moderation.ts b/packages/tests/src/api/server/follows-moderation.ts index b832a9f041..f72571c0ed 100644 --- a/packages/tests/src/api/server/follows-moderation.ts +++ b/packages/tests/src/api/server/follows-moderation.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ActorFollow, FollowState } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/follows.ts b/packages/tests/src/api/server/follows.ts index a9d8edac6f..0895147f47 100644 --- a/packages/tests/src/api/server/follows.ts +++ b/packages/tests/src/api/server/follows.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { Video, VideoCommentPolicy, VideoPrivacy } from '@peertube/peertube-models' import { PeerTubeServer, cleanupTests, createMultipleServers, setAccessTokensToServers, waitJobs } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/server/handle-down.ts b/packages/tests/src/api/server/handle-down.ts index f371a474d1..9e425325b9 100644 --- a/packages/tests/src/api/server/handle-down.ts +++ b/packages/tests/src/api/server/handle-down.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, JobState, VideoCommentPolicy, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/server/homepage.ts b/packages/tests/src/api/server/homepage.ts index 082a2fb91f..370f31d00a 100644 --- a/packages/tests/src/api/server/homepage.ts +++ b/packages/tests/src/api/server/homepage.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/server/jobs.ts b/packages/tests/src/api/server/jobs.ts index ac232b0578..ae95f884ef 100644 --- a/packages/tests/src/api/server/jobs.ts +++ b/packages/tests/src/api/server/jobs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/server/lazy-static.ts b/packages/tests/src/api/server/lazy-static.ts index aa8a7e093b..fec5b7bc4c 100644 --- a/packages/tests/src/api/server/lazy-static.ts +++ b/packages/tests/src/api/server/lazy-static.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/server/logs.ts b/packages/tests/src/api/server/logs.ts index ad6b072fb9..396f213b27 100644 --- a/packages/tests/src/api/server/logs.ts +++ b/packages/tests/src/api/server/logs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode } from '@peertube/peertube-models' @@ -26,7 +26,6 @@ describe('Test logs', function () { }) describe('With the standard log file', function () { - it('Should get logs with a start date', async function () { this.timeout(60000) @@ -146,7 +145,6 @@ describe('Test logs', function () { }) describe('With the audit log', function () { - it('Should get logs with a start date', async function () { this.timeout(60000) @@ -199,7 +197,6 @@ describe('Test logs', function () { }) describe('When creating log from the client', function () { - it('Should create a warn client log', async function () { const now = new Date() @@ -263,7 +260,6 @@ describe('Test logs', function () { }) describe('With some log options', function () { - it('Should not crash when enabling `prettify_sql` config', async function () { await server.kill() await server.run({ log: { prettify_sql: true } }) diff --git a/packages/tests/src/api/server/open-telemetry.ts b/packages/tests/src/api/server/open-telemetry.ts index c7fef6c075..6de8ad05b4 100644 --- a/packages/tests/src/api/server/open-telemetry.ts +++ b/packages/tests/src/api/server/open-telemetry.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' import { @@ -114,7 +114,7 @@ describe('Open Telemetry', function () { const res = await makeRawRequest({ url: metricsUrl, expectedStatus: HttpStatusCode.OK_200 }) const label = - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len `{videoOrigin="local",playerMode="p2p-media-loader",resolution="1080",fps="30",p2pEnabled="false",videoUUID="${video.uuid}",otel_scope_name="default"}` expect(res.text).to.contain(`peertube_playback_p2p_peers${label} 42`) expect(res.text).to.not.contain(`peertube_playback_p2p_peers${label} 7`) diff --git a/packages/tests/src/api/server/plugins.ts b/packages/tests/src/api/server/plugins.ts index 2dccf3d30e..a8fe09703d 100644 --- a/packages/tests/src/api/server/plugins.ts +++ b/packages/tests/src/api/server/plugins.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists, remove } from 'fs-extra/esm' diff --git a/packages/tests/src/api/server/proxy.ts b/packages/tests/src/api/server/proxy.ts index 2f4bd76a1c..34080a1f20 100644 --- a/packages/tests/src/api/server/proxy.ts +++ b/packages/tests/src/api/server/proxy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode, HttpStatusCodeType, VideoPrivacy } from '@peertube/peertube-models' @@ -40,7 +40,6 @@ describe('Test proxy', function () { }) describe('Federation', function () { - it('Should succeed federation with the appropriate proxy config', async function () { this.timeout(40000) @@ -83,7 +82,6 @@ describe('Test proxy', function () { }) describe('Videos import', async function () { - function getProxyConfig (url: string) { return { import: { diff --git a/packages/tests/src/api/server/reverse-proxy.ts b/packages/tests/src/api/server/reverse-proxy.ts index 7607cf72ac..47e6df5a68 100644 --- a/packages/tests/src/api/server/reverse-proxy.ts +++ b/packages/tests/src/api/server/reverse-proxy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' @@ -125,7 +125,6 @@ describe('Test application behind a reverse proxy', function () { } await server.registrations.register({ username: 'test43', expectedStatus: HttpStatusCode.OK_200 }) - }) it('Should rate limit API calls', async function () { diff --git a/packages/tests/src/api/server/services.ts b/packages/tests/src/api/server/services.ts index cc7acfb80f..f4fef53034 100644 --- a/packages/tests/src/api/server/services.ts +++ b/packages/tests/src/api/server/services.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, Video, VideoPlaylistPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/slow-follows.ts b/packages/tests/src/api/server/slow-follows.ts index d031090018..95f0cdca2f 100644 --- a/packages/tests/src/api/server/slow-follows.ts +++ b/packages/tests/src/api/server/slow-follows.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { Job } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/server/ssrf.ts b/packages/tests/src/api/server/ssrf.ts index 105d8141bb..5f5bd60b92 100644 --- a/packages/tests/src/api/server/ssrf.ts +++ b/packages/tests/src/api/server/ssrf.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { @@ -38,7 +38,6 @@ describe('Test SSRF requests', function () { }) describe('Disabled SSRF protection', function () { - it('Should not forbid non-unicast federation', async function () { const { uuid } = await servers[0].videos.quickUpload({ name: 'video' }) await waitJobs(servers) diff --git a/packages/tests/src/api/server/stats.ts b/packages/tests/src/api/server/stats.ts index 2c0f28ae2d..3454e9c2ac 100644 --- a/packages/tests/src/api/server/stats.ts +++ b/packages/tests/src/api/server/stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' @@ -51,7 +51,6 @@ describe('Test stats (excluding redundancy)', function () { }) describe('Total stats', function () { - it('Should have the correct stats on instance 1', async function () { const data = await servers[0].stats.get() @@ -205,7 +204,6 @@ describe('Test stats (excluding redundancy)', function () { }) describe('File sizes', function () { - it('Should correctly count video file sizes if transcoding is enabled', async function () { this.timeout(120000) @@ -252,7 +250,6 @@ describe('Test stats (excluding redundancy)', function () { }) describe('ActivityPub', function () { - it('Should have the correct AP stats', async function () { this.timeout(240000) @@ -272,7 +269,18 @@ describe('Test stats (excluding redundancy)', function () { expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed) const apTypes: ActivityType[] = [ - 'Create', 'Update', 'Delete', 'Follow', 'Accept', 'Announce', 'Undo', 'Like', 'Reject', 'View', 'Dislike', 'Flag' + 'Create', + 'Update', + 'Delete', + 'Follow', + 'Accept', + 'Announce', + 'Undo', + 'Like', + 'Reject', + 'View', + 'Dislike', + 'Flag' ] const processed = apTypes.reduce( @@ -370,10 +378,10 @@ describe('Test stats (excluding redundancy)', function () { let userToken: string before(async function () { - userToken = await servers[0].users.generateUserAndToken('reporter'); + userToken = await servers[0].users.generateUserAndToken('reporter') - ({ id: videoId } = await servers[0].videos.quickUpload({ name: 'to_report' })); - ({ id: commentId } = await servers[0].comments.createThread({ videoId, text: 'text' })) + ;({ id: videoId } = await servers[0].videos.quickUpload({ name: 'to_report' })) + ;({ id: commentId } = await servers[0].comments.createThread({ videoId, text: 'text' })) }) it('Should not abuses stats available', async function () { @@ -387,8 +395,8 @@ describe('Test stats (excluding redundancy)', function () { it('Should create abuses, process one and have correct stats', async function () { beforeTimestamp = new Date().getTime() - const { abuse: abuse1 } = await servers[0].abuses.report({ videoId, token: userToken, reason: 'abuse reason' }); - ({ abuse: { id: abuse2 } } = await servers[0].abuses.report({ accountId: userAccountId, token: userToken, reason: 'abuse reason' })) + const { abuse: abuse1 } = await servers[0].abuses.report({ videoId, token: userToken, reason: 'abuse reason' }) + ;({ abuse: { id: abuse2 } } = await servers[0].abuses.report({ accountId: userAccountId, token: userToken, reason: 'abuse reason' })) await servers[0].abuses.report({ commentId, token: userToken, reason: 'abuse reason' }) await wait(1500) @@ -430,7 +438,6 @@ describe('Test stats (excluding redundancy)', function () { }) describe('Disabling stats', async function () { - it('Should disable registration requests and abuses stats', async function () { this.timeout(60000) diff --git a/packages/tests/src/api/server/stun.ts b/packages/tests/src/api/server/stun.ts index 381bb5670e..47daea9e3d 100644 --- a/packages/tests/src/api/server/stun.ts +++ b/packages/tests/src/api/server/stun.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { randomBytes } from 'node:crypto' import dgram from 'node:dgram' diff --git a/packages/tests/src/api/server/tracker.ts b/packages/tests/src/api/server/tracker.ts index 9f703e6c32..bdffd705a2 100644 --- a/packages/tests/src/api/server/tracker.ts +++ b/packages/tests/src/api/server/tracker.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */ import { cleanupTests, diff --git a/packages/tests/src/api/stats/video-downloads-counter.ts b/packages/tests/src/api/stats/video-downloads-counter.ts index bc1538d051..b45eb12cde 100644 --- a/packages/tests/src/api/stats/video-downloads-counter.ts +++ b/packages/tests/src/api/stats/video-downloads-counter.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/stats/video-views-counter.ts b/packages/tests/src/api/stats/video-views-counter.ts index cbf6730f78..730995c2e7 100644 --- a/packages/tests/src/api/stats/video-views-counter.ts +++ b/packages/tests/src/api/stats/video-views-counter.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { buildUUID } from '@peertube/peertube-node-utils' @@ -23,7 +23,6 @@ describe('Test video views/viewers counters', function () { } function runTests (options: { useSessionId: boolean }) { - const generateSession = () => { if (!options.useSessionId) return undefined @@ -85,9 +84,9 @@ describe('Test video views/viewers counters', function () { let command: FfmpegCommand before(async function () { - this.timeout(240000); + this.timeout(240000) - ({ vodVideoId, liveVideoId, ffmpegCommand: command } = await prepareViewsVideos({ servers, live: true, vod: true })) + ;({ vodVideoId, liveVideoId, ffmpegCommand: command } = await prepareViewsVideos({ servers, live: true, vod: true })) }) it('Should display no views and viewers', async function () { @@ -204,7 +203,6 @@ describe('Test video views/viewers counters', function () { } describe('Federation', function () { - before(async function () { this.timeout(120000) @@ -220,7 +218,6 @@ describe('Test video views/viewers counters', function () { }) describe('View minimum duration config', function () { - it('Should update "count_view_after" config', async function () { this.timeout(120000) @@ -256,9 +253,9 @@ describe('Test video views/viewers counters', function () { before(async function () { this.timeout(120000) - servers = await prepareViewsServers({ viewExpiration: '5 seconds', trustViewerSessionId: false }); + servers = await prepareViewsServers({ viewExpiration: '5 seconds', trustViewerSessionId: false }) - ({ uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'video' })) + ;({ uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'video' })) await waitJobs(servers) }) @@ -280,5 +277,4 @@ describe('Test video views/viewers counters', function () { await cleanupTests(servers) }) }) - }) diff --git a/packages/tests/src/api/stats/video-views-overall-stats.ts b/packages/tests/src/api/stats/video-views-overall-stats.ts index 4553c2974f..fa23402a0a 100644 --- a/packages/tests/src/api/stats/video-views-overall-stats.ts +++ b/packages/tests/src/api/stats/video-views-overall-stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { VideoStatsOverall } from '@peertube/peertube-models' @@ -84,7 +84,6 @@ describe('Test views overall stats', function () { before(async function () { this.timeout(240000) - ;({ vodVideoId, liveVideoId, ffmpegCommand: command } = await prepareViewsVideos({ servers, live: true, vod: true })) }) @@ -243,7 +242,6 @@ describe('Test views overall stats', function () { before(async function () { this.timeout(240000) - ;({ vodVideoId: videoUUID } = await prepareViewsVideos({ servers, live: true, vod: true })) }) diff --git a/packages/tests/src/api/stats/video-views-retention-stats.ts b/packages/tests/src/api/stats/video-views-retention-stats.ts index f665d1201a..848d74c312 100644 --- a/packages/tests/src/api/stats/video-views-retention-stats.ts +++ b/packages/tests/src/api/stats/video-views-retention-stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { PeerTubeServer, cleanupTests } from '@peertube/peertube-server-commands' @@ -18,15 +18,14 @@ describe('Test views retention stats', function () { let vodVideoId: string function runTests (options: { useSessionId: boolean }) { - const sessionField = options.useSessionId ? 'sessionId' : 'xForwardedFor' before(async function () { - this.timeout(240000); + this.timeout(240000) - ({ vodVideoId } = await prepareViewsVideos({ servers, live: false, vod: true })) + ;({ vodVideoId } = await prepareViewsVideos({ servers, live: false, vod: true })) }) it('Should display empty retention', async function () { diff --git a/packages/tests/src/api/stats/video-views-timeserie-stats.ts b/packages/tests/src/api/stats/video-views-timeserie-stats.ts index 90a0dbf2af..183f7db43f 100644 --- a/packages/tests/src/api/stats/video-views-timeserie-stats.ts +++ b/packages/tests/src/api/stats/video-views-timeserie-stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@peertube/peertube-models' import { buildUUID } from '@peertube/peertube-node-utils' @@ -31,9 +31,9 @@ describe('Test views timeserie stats', function () { let vodVideoId: string before(async function () { - this.timeout(240000); + this.timeout(240000) - ({ vodVideoId } = await prepareViewsVideos({ servers, live: false, vod: true })) + ;({ vodVideoId } = await prepareViewsVideos({ servers, live: false, vod: true })) }) it('Should display empty metric stats', async function () { @@ -82,7 +82,6 @@ describe('Test views timeserie stats', function () { } function runTests (options: { useSessionId: boolean }) { - const generateSession = () => { if (!options.useSessionId) return undefined @@ -90,9 +89,9 @@ describe('Test views timeserie stats', function () { } before(async function () { - this.timeout(240000); + this.timeout(240000) - ({ vodVideoId, liveVideoId, ffmpegCommand: command } = await prepareViewsVideos({ servers, live: true, vod: true })) + ;({ vodVideoId, liveVideoId, ffmpegCommand: command } = await prepareViewsVideos({ servers, live: true, vod: true })) }) it('Should display appropriate viewers metrics', async function () { diff --git a/packages/tests/src/api/stats/video-views-user-agent-stats.ts b/packages/tests/src/api/stats/video-views-user-agent-stats.ts index 56d7900362..4bbd665c3d 100644 --- a/packages/tests/src/api/stats/video-views-user-agent-stats.ts +++ b/packages/tests/src/api/stats/video-views-user-agent-stats.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ +/* oxlint-disable @typescript-eslint/no-unused-expressions */ import { buildUUID } from '@peertube/peertube-node-utils' import { PeerTubeServer, cleanupTests, waitJobs } from '@peertube/peertube-server-commands' import { prepareViewsServers, processViewersStats } from '@tests/shared/views.js' diff --git a/packages/tests/src/api/stats/videos-views-cleaner.ts b/packages/tests/src/api/stats/videos-views-cleaner.ts index 556b148aa2..5db0925616 100644 --- a/packages/tests/src/api/stats/videos-views-cleaner.ts +++ b/packages/tests/src/api/stats/videos-views-cleaner.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { buildUUID } from '@peertube/peertube-node-utils' import { diff --git a/packages/tests/src/api/transcoding/audio-only.ts b/packages/tests/src/api/transcoding/audio-only.ts index e98cfb6ffd..ce78c3f73f 100644 --- a/packages/tests/src/api/transcoding/audio-only.ts +++ b/packages/tests/src/api/transcoding/audio-only.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { getAudioStream, getVideoStreamDimensionsInfo } from '@peertube/peertube-ffmpeg' @@ -53,7 +53,6 @@ describe('Test audio only video transcoding', function () { for (const concurrency of [ 1, 2 ]) { describe(`With transcoding concurrency ${concurrency}`, function () { - before(async function () { await servers[0].config.setTranscodingConcurrency(concurrency) }) diff --git a/packages/tests/src/api/transcoding/create-transcoding.ts b/packages/tests/src/api/transcoding/create-transcoding.ts index aafa3b21c8..9767eb9528 100644 --- a/packages/tests/src/api/transcoding/create-transcoding.ts +++ b/packages/tests/src/api/transcoding/create-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoDetails, VideoResolution } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/transcoding/force-audio-web-video-transcoding.ts b/packages/tests/src/api/transcoding/force-audio-web-video-transcoding.ts index 344bfffc99..a779ee0b1a 100644 --- a/packages/tests/src/api/transcoding/force-audio-web-video-transcoding.ts +++ b/packages/tests/src/api/transcoding/force-audio-web-video-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { cleanupTests, diff --git a/packages/tests/src/api/transcoding/hls.ts b/packages/tests/src/api/transcoding/hls.ts index 4a5f703db1..4309731296 100644 --- a/packages/tests/src/api/transcoding/hls.ts +++ b/packages/tests/src/api/transcoding/hls.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' @@ -141,7 +141,6 @@ describe('Test HLS videos', function () { for (const concurrency of [ 1, 2 ]) { describe(`With concurrency ${concurrency}`, function () { - describe('With Web Video & HLS enabled', function () { runTestSuite({ hlsOnly: false, concurrency }) }) diff --git a/packages/tests/src/api/transcoding/split-audio-and-video.ts b/packages/tests/src/api/transcoding/split-audio-and-video.ts index 9d6ecdc040..2b2d7a1ea5 100644 --- a/packages/tests/src/api/transcoding/split-audio-and-video.ts +++ b/packages/tests/src/api/transcoding/split-audio-and-video.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { sortBy } from '@peertube/peertube-core-utils' import { HLSTranscodingPayload, HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/transcoding/transcoder-limits.ts b/packages/tests/src/api/transcoding/transcoder-limits.ts index a198005d4f..2319242929 100644 --- a/packages/tests/src/api/transcoding/transcoder-limits.ts +++ b/packages/tests/src/api/transcoding/transcoder-limits.ts @@ -1,11 +1,7 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate } from '@peertube/peertube-core-utils' -import { - getVideoStreamBitrate, - getVideoStreamDimensionsInfo, - getVideoStreamFPS -} from '@peertube/peertube-ffmpeg' +import { getVideoStreamBitrate, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@peertube/peertube-ffmpeg' import { VideoResolution } from '@peertube/peertube-models' import { cleanupTests, diff --git a/packages/tests/src/api/transcoding/transcoder.ts b/packages/tests/src/api/transcoding/transcoder.ts index 4f686d1858..11877b648b 100644 --- a/packages/tests/src/api/transcoding/transcoder.ts +++ b/packages/tests/src/api/transcoding/transcoder.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, omit } from '@peertube/peertube-core-utils' import { ffprobePromise, getAudioStream, hasAudioStream } from '@peertube/peertube-ffmpeg' diff --git a/packages/tests/src/api/transcoding/update-while-transcoding.ts b/packages/tests/src/api/transcoding/update-while-transcoding.ts index 792b7bc3ee..8f3749a93e 100644 --- a/packages/tests/src/api/transcoding/update-while-transcoding.ts +++ b/packages/tests/src/api/transcoding/update-while-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { VideoPrivacy } from '@peertube/peertube-models' @@ -20,7 +20,6 @@ describe('Test update video privacy while transcoding', function () { const videoUUIDs: string[] = [] function runTestSuite (hlsOnly: boolean, objectStorageBaseUrl?: string) { - it('Should not have an error while quickly updating a private video to public after upload #1', async function () { this.timeout(360_000) @@ -102,7 +101,6 @@ describe('Test update video privacy while transcoding', function () { }) describe('With only HLS enabled', function () { - before(async function () { await servers[0].config.updateExistingConfig({ newConfig: { diff --git a/packages/tests/src/api/users/oauth.ts b/packages/tests/src/api/users/oauth.ts index 4bf66c059f..25042649c9 100644 --- a/packages/tests/src/api/users/oauth.ts +++ b/packages/tests/src/api/users/oauth.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, MyUser, OAuth2ErrorCode, PeerTubeProblemDocument } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/users/registrations.ts b/packages/tests/src/api/users/registrations.ts index 52ef535265..f30db405d3 100644 --- a/packages/tests/src/api/users/registrations.ts +++ b/packages/tests/src/api/users/registrations.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserRegistrationState, UserRole } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/users/two-factor.ts b/packages/tests/src/api/users/two-factor.ts index fda125d20b..b094e1b9ed 100644 --- a/packages/tests/src/api/users/two-factor.ts +++ b/packages/tests/src/api/users/two-factor.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode, HttpStatusCodeType } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/users/user-export.ts b/packages/tests/src/api/users/user-export.ts index bfd900c5df..d17f879026 100644 --- a/packages/tests/src/api/users/user-export.ts +++ b/packages/tests/src/api/users/user-export.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { hasAudioStream, hasVideoStream } from '@peertube/peertube-ffmpeg' diff --git a/packages/tests/src/api/users/user-import.ts b/packages/tests/src/api/users/user-import.ts index 170e55ec87..ff0a020bbb 100644 --- a/packages/tests/src/api/users/user-import.ts +++ b/packages/tests/src/api/users/user-import.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, diff --git a/packages/tests/src/api/users/user-subscriptions.ts b/packages/tests/src/api/users/user-subscriptions.ts index a0c61a6127..84217be94d 100644 --- a/packages/tests/src/api/users/user-subscriptions.ts +++ b/packages/tests/src/api/users/user-subscriptions.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { VideoPrivacy } from '@peertube/peertube-models' @@ -54,7 +54,6 @@ describe('Test users subscriptions', function () { }) describe('Distinction between server videos and user videos', function () { - it('Should display videos of server 2 on server 1', async function () { const { total } = await servers[0].videos.list() @@ -89,7 +88,6 @@ describe('Test users subscriptions', function () { }) describe('Subscription endpoints', function () { - it('Should list subscriptions', async function () { { const body = await command.list() @@ -174,7 +172,6 @@ describe('Test users subscriptions', function () { }) describe('Subscription videos', function () { - it('Should list subscription videos', async function () { { const body = await servers[0].videos.listMySubscriptionVideos() @@ -308,7 +305,6 @@ describe('Test users subscriptions', function () { }) describe('Existing subscription video update', function () { - it('Should update a video of server 3 and see the updated video on server 1', async function () { this.timeout(30000) @@ -322,7 +318,6 @@ describe('Test users subscriptions', function () { }) describe('Subscription removal', function () { - it('Should remove user of server 3 subscription', async function () { this.timeout(30000) @@ -372,7 +367,6 @@ describe('Test users subscriptions', function () { }) describe('Re-follow', function () { - it('Should follow user of server 3 again', async function () { this.timeout(60000) @@ -418,7 +412,6 @@ describe('Test users subscriptions', function () { }) describe('Followers listing', function () { - it('Should list user 3 followers', async function () { { const { total, data } = await servers[2].accounts.listFollowers({ @@ -582,7 +575,6 @@ describe('Test users subscriptions', function () { }) describe('Subscription videos privacy', function () { - it('Should update video as internal and not see from remote server', async function () { this.timeout(30000) diff --git a/packages/tests/src/api/users/user-videos.ts b/packages/tests/src/api/users/user-videos.ts index 03230aa54c..96093c9dc8 100644 --- a/packages/tests/src/api/users/user-videos.ts +++ b/packages/tests/src/api/users/user-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/users/users-email-verification.ts b/packages/tests/src/api/users/users-email-verification.ts index b3d907906a..0a16bf0cf8 100644 --- a/packages/tests/src/api/users/users-email-verification.ts +++ b/packages/tests/src/api/users/users-email-verification.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { MockSmtpServer } from '@tests/shared/mock-servers/mock-email.js' diff --git a/packages/tests/src/api/users/users-multiple-servers.ts b/packages/tests/src/api/users/users-multiple-servers.ts index 5c3812e351..3d050845e0 100644 --- a/packages/tests/src/api/users/users-multiple-servers.ts +++ b/packages/tests/src/api/users/users-multiple-servers.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { MyUser } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/users/users.ts b/packages/tests/src/api/users/users.ts index 0558bef682..4036fa10ca 100644 --- a/packages/tests/src/api/users/users.ts +++ b/packages/tests/src/api/users/users.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { AbuseState, HttpStatusCode, UserAdminFlag, UserNewFeatureInfo, UserRole, VideoPlaylistType } from '@peertube/peertube-models' import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/api/videos/channel-activities.ts b/packages/tests/src/api/videos/channel-activities.ts index 2dd5751cfe..0d76c9dc3f 100644 --- a/packages/tests/src/api/videos/channel-activities.ts +++ b/packages/tests/src/api/videos/channel-activities.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { LiveVideoLatencyMode, diff --git a/packages/tests/src/api/videos/channel-collaborators.ts b/packages/tests/src/api/videos/channel-collaborators.ts index 90fa6b67cf..5396bd88c0 100644 --- a/packages/tests/src/api/videos/channel-collaborators.ts +++ b/packages/tests/src/api/videos/channel-collaborators.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { BulkRemoveCommentsOfBody, HttpStatusCode, VideoChannelCollaboratorState, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/videos/channel-import-videos.ts b/packages/tests/src/api/videos/channel-import-videos.ts index 5174936d32..524040d245 100644 --- a/packages/tests/src/api/videos/channel-import-videos.ts +++ b/packages/tests/src/api/videos/channel-import-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { areHttpImportTestsDisabled, areYoutubeImportTestsDisabled } from '@peertube/peertube-node-utils' import { diff --git a/packages/tests/src/api/videos/fep-1b12.ts b/packages/tests/src/api/videos/fep-1b12.ts index 47784660c2..ebc4370d10 100644 --- a/packages/tests/src/api/videos/fep-1b12.ts +++ b/packages/tests/src/api/videos/fep-1b12.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPlaylistPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/videos/generate-download.ts b/packages/tests/src/api/videos/generate-download.ts index 9120b7012b..5b80d30ad4 100644 --- a/packages/tests/src/api/videos/generate-download.ts +++ b/packages/tests/src/api/videos/generate-download.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getHLS } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoDetails, VideoFile, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/multiple-servers.ts b/packages/tests/src/api/videos/multiple-servers.ts index 9f86677e6b..3733d3b828 100644 --- a/packages/tests/src/api/videos/multiple-servers.ts +++ b/packages/tests/src/api/videos/multiple-servers.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { maxBy, wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoCommentPolicy, VideoCommentThreadTree, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/player-settings.ts b/packages/tests/src/api/videos/player-settings.ts index 3bc9b56ae1..f53d219b3d 100644 --- a/packages/tests/src/api/videos/player-settings.ts +++ b/packages/tests/src/api/videos/player-settings.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoCreateResult } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/videos/resumable-upload.ts b/packages/tests/src/api/videos/resumable-upload.ts index 808ef799c8..b7c3574190 100644 --- a/packages/tests/src/api/videos/resumable-upload.ts +++ b/packages/tests/src/api/videos/resumable-upload.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists } from 'fs-extra/esm' diff --git a/packages/tests/src/api/videos/single-server.ts b/packages/tests/src/api/videos/single-server.ts index 88c7e9ceb1..1eb3e547a2 100644 --- a/packages/tests/src/api/videos/single-server.ts +++ b/packages/tests/src/api/videos/single-server.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { Video, VideoCommentPolicy, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/video-captions-playlist.ts b/packages/tests/src/api/videos/video-captions-playlist.ts index cc52607c52..644d6f7372 100644 --- a/packages/tests/src/api/videos/video-captions-playlist.ts +++ b/packages/tests/src/api/videos/video-captions-playlist.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getHLS } from '@peertube/peertube-core-utils' import { ffprobePromise } from '@peertube/peertube-ffmpeg' diff --git a/packages/tests/src/api/videos/video-captions.ts b/packages/tests/src/api/videos/video-captions.ts index f9d92b312c..7ed7bc139f 100644 --- a/packages/tests/src/api/videos/video-captions.ts +++ b/packages/tests/src/api/videos/video-captions.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/video-change-ownership.ts b/packages/tests/src/api/videos/video-change-ownership.ts index 358fed7a07..bbaa2fb8e4 100644 --- a/packages/tests/src/api/videos/video-change-ownership.ts +++ b/packages/tests/src/api/videos/video-change-ownership.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/api/videos/video-channel-syncs.ts b/packages/tests/src/api/videos/video-channel-syncs.ts index daff8481aa..2ccfcc0bee 100644 --- a/packages/tests/src/api/videos/video-channel-syncs.ts +++ b/packages/tests/src/api/videos/video-channel-syncs.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoChannelSyncState, VideoImportState, VideoInclude, VideoPrivacy } from '@peertube/peertube-models' import { areHttpImportTestsDisabled, areYoutubeImportTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-channels.ts b/packages/tests/src/api/videos/video-channels.ts index e02a8591cd..891465d8aa 100644 --- a/packages/tests/src/api/videos/video-channels.ts +++ b/packages/tests/src/api/videos/video-channels.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { ActorImageType, User, VideoChannel } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/video-chapters.ts b/packages/tests/src/api/videos/video-chapters.ts index e6a4a17577..440fb75b86 100644 --- a/packages/tests/src/api/videos/video-chapters.ts +++ b/packages/tests/src/api/videos/video-chapters.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoChapter, VideoCreateResult, VideoPrivacy } from '@peertube/peertube-models' import { areHttpImportTestsDisabled, areYoutubeImportTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-comments.ts b/packages/tests/src/api/videos/video-comments.ts index 43c57db39b..e33286f117 100644 --- a/packages/tests/src/api/videos/video-comments.ts +++ b/packages/tests/src/api/videos/video-comments.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoCreateResult } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/videos/video-description.ts b/packages/tests/src/api/videos/video-description.ts index 3e5f40a7c8..efdc243c5a 100644 --- a/packages/tests/src/api/videos/video-description.ts +++ b/packages/tests/src/api/videos/video-description.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/api/videos/video-embed-privacy.ts b/packages/tests/src/api/videos/video-embed-privacy.ts index 10d7fd0b1b..2927002b11 100644 --- a/packages/tests/src/api/videos/video-embed-privacy.ts +++ b/packages/tests/src/api/videos/video-embed-privacy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoEmbedPrivacy, VideoEmbedPrivacyPolicy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/videos/video-files.ts b/packages/tests/src/api/videos/video-files.ts index 242f737cb4..d04d8c9705 100644 --- a/packages/tests/src/api/videos/video-files.ts +++ b/packages/tests/src/api/videos/video-files.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-imports.ts b/packages/tests/src/api/videos/video-imports.ts index bc03303269..3fa2733730 100644 --- a/packages/tests/src/api/videos/video-imports.ts +++ b/packages/tests/src/api/videos/video-imports.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { CustomConfig, HttpStatusCode, Video, VideoImportState, VideoPrivacy, VideoResolution, VideoState } from '@peertube/peertube-models' import { areHttpImportTestsDisabled, areYoutubeImportTestsDisabled } from '@peertube/peertube-node-utils' @@ -130,9 +130,9 @@ describe('Test video imports', function () { const pathRegexp = new RegExp(`^/lazy-static/thumbnails/.+.${extension}$`) const urlRegexp = new RegExp(`^${servers[0].url}/lazy-static/thumbnails/.+.${extension}$`) - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated expect(video.thumbnailPath).to.match(pathRegexp) - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated expect(video.previewPath).to.match(pathRegexp) for (const thumbnail of video.thumbnails) { diff --git a/packages/tests/src/api/videos/video-nsfw.ts b/packages/tests/src/api/videos/video-nsfw.ts index 7e869badd3..5188cd0da3 100644 --- a/packages/tests/src/api/videos/video-nsfw.ts +++ b/packages/tests/src/api/videos/video-nsfw.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { CustomConfig, diff --git a/packages/tests/src/api/videos/video-passwords.ts b/packages/tests/src/api/videos/video-passwords.ts index b04a870b5c..e665d7a79e 100644 --- a/packages/tests/src/api/videos/video-passwords.ts +++ b/packages/tests/src/api/videos/video-passwords.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/api/videos/video-playlist-thumbnails.ts b/packages/tests/src/api/videos/video-playlist-thumbnails.ts index 84a7e3def1..14198d867e 100644 --- a/packages/tests/src/api/videos/video-playlist-thumbnails.ts +++ b/packages/tests/src/api/videos/video-playlist-thumbnails.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPlaylistPrivacy } from '@peertube/peertube-models' import { @@ -214,7 +214,7 @@ describe('Playlist thumbnail', function () { for (const server of servers) { const p = await getPlaylistWithoutThumbnail(server) - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated expect(p.thumbnailPath).to.be.null expect(p.thumbnails).to.have.lengthOf(0) } diff --git a/packages/tests/src/api/videos/video-playlists.ts b/packages/tests/src/api/videos/video-playlists.ts index 703c2f74e4..5e05da96a8 100644 --- a/packages/tests/src/api/videos/video-playlists.ts +++ b/packages/tests/src/api/videos/video-playlists.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/videos/video-privacy.ts b/packages/tests/src/api/videos/video-privacy.ts index 9171463a46..37aa339905 100644 --- a/packages/tests/src/api/videos/video-privacy.ts +++ b/packages/tests/src/api/videos/video-privacy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' @@ -50,7 +50,6 @@ describe('Test video privacy', function () { }) describe('Private and internal videos', function () { - it('Should upload a private and internal videos on server 1', async function () { this.timeout(50000) @@ -131,7 +130,6 @@ describe('Test video privacy', function () { }) describe('Unlisted videos', function () { - it('Should upload an unlisted video on server 2', async function () { this.timeout(120000) @@ -210,7 +208,6 @@ describe('Test video privacy', function () { }) describe('Privacy update', function () { - it('Should update the private and internal videos to public on server 1', async function () { this.timeout(100000) diff --git a/packages/tests/src/api/videos/video-schedule-update.ts b/packages/tests/src/api/videos/video-schedule-update.ts index 175c39c276..559833890e 100644 --- a/packages/tests/src/api/videos/video-schedule-update.ts +++ b/packages/tests/src/api/videos/video-schedule-update.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/video-source.ts b/packages/tests/src/api/videos/video-source.ts index 31c214768f..89796f90f6 100644 --- a/packages/tests/src/api/videos/video-source.ts +++ b/packages/tests/src/api/videos/video-source.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoInclude, VideoPrivacy } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-state.ts b/packages/tests/src/api/videos/video-state.ts index e89724c8dc..d0e41f0257 100644 --- a/packages/tests/src/api/videos/video-state.ts +++ b/packages/tests/src/api/videos/video-state.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { sortBy } from '@peertube/peertube-core-utils' import { MoveVideoStoragePayload, VideoState, VideoTranscodingPayload } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-static-file-privacy.ts b/packages/tests/src/api/videos/video-static-file-privacy.ts index fff3b2c006..1d26256bb1 100644 --- a/packages/tests/src/api/videos/video-static-file-privacy.ts +++ b/packages/tests/src/api/videos/video-static-file-privacy.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, HttpStatusCodeType, LiveVideo, VideoDetails, VideoPrivacy, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/api/videos/video-storyboard.ts b/packages/tests/src/api/videos/video-storyboard.ts index 07c9e27da0..9b43959dd1 100644 --- a/packages/tests/src/api/videos/video-storyboard.ts +++ b/packages/tests/src/api/videos/video-storyboard.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPrivacy } from '@peertube/peertube-models' import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/video-transcription.ts b/packages/tests/src/api/videos/video-transcription.ts index 6dbf13595e..98a801f6f1 100644 --- a/packages/tests/src/api/videos/video-transcription.ts +++ b/packages/tests/src/api/videos/video-transcription.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { VideoPrivacy, VideoResolution } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/api/videos/videos-common-filters.ts b/packages/tests/src/api/videos/videos-common-filters.ts index fb59d59d5e..bbb71273c5 100644 --- a/packages/tests/src/api/videos/videos-common-filters.ts +++ b/packages/tests/src/api/videos/videos-common-filters.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { pick } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/api/videos/videos-history.ts b/packages/tests/src/api/videos/videos-history.ts index 75c0fcebd9..f54c095d27 100644 --- a/packages/tests/src/api/videos/videos-history.ts +++ b/packages/tests/src/api/videos/videos-history.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/api/videos/videos-overview.ts b/packages/tests/src/api/videos/videos-overview.ts index 7d74d6db2c..ba46851f1a 100644 --- a/packages/tests/src/api/videos/videos-overview.ts +++ b/packages/tests/src/api/videos/videos-overview.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/cli/create-generate-storyboard-job.ts b/packages/tests/src/cli/create-generate-storyboard-job.ts index 2acca28e4f..7d9e8decc0 100644 --- a/packages/tests/src/cli/create-generate-storyboard-job.ts +++ b/packages/tests/src/cli/create-generate-storyboard-job.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/cli/create-import-video-file-job.ts b/packages/tests/src/cli/create-import-video-file-job.ts index b670abf505..d0cdab70ef 100644 --- a/packages/tests/src/cli/create-import-video-file-job.ts +++ b/packages/tests/src/cli/create-import-video-file-job.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled, buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' @@ -155,7 +155,6 @@ function runTests (enableObjectStorage: boolean) { } describe('Test create import video jobs CLI', function () { - describe('On filesystem', function () { runTests(false) }) diff --git a/packages/tests/src/cli/create-move-video-storage-job.ts b/packages/tests/src/cli/create-move-video-storage-job.ts index 8139c71996..f29a4b737d 100644 --- a/packages/tests/src/cli/create-move-video-storage-job.ts +++ b/packages/tests/src/cli/create-move-video-storage-job.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoDetails, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/cli/house-keeping.ts b/packages/tests/src/cli/house-keeping.ts index b031b814d2..1510387106 100644 --- a/packages/tests/src/cli/house-keeping.ts +++ b/packages/tests/src/cli/house-keeping.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/cli/peertube.ts b/packages/tests/src/cli/peertube.ts index 1ab6326ff9..4684b7228a 100644 --- a/packages/tests/src/cli/peertube.ts +++ b/packages/tests/src/cli/peertube.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/cli/plugins.ts b/packages/tests/src/cli/plugins.ts index c63371ee90..142586b9ae 100644 --- a/packages/tests/src/cli/plugins.ts +++ b/packages/tests/src/cli/plugins.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { @@ -43,11 +43,11 @@ describe('Test plugin CLI', function () { const config = await server.config.getConfig() const plugin = config.plugin.registered - .find(p => p.name === 'test') + .find(p => p.name === 'test') expect(plugin).to.not.be.undefined const theme = config.theme.registered - .find(t => t.name === 'background-red') + .find(t => t.name === 'background-red') expect(theme).to.not.be.undefined }) @@ -66,7 +66,7 @@ describe('Test plugin CLI', function () { const config = await server.config.getConfig() const plugin = config.plugin.registered - .find(p => p.name === 'test') + .find(p => p.name === 'test') expect(plugin).to.be.undefined }) diff --git a/packages/tests/src/cli/prune-storage.ts b/packages/tests/src/cli/prune-storage.ts index 1da86db191..7f535ee761 100644 --- a/packages/tests/src/cli/prune-storage.ts +++ b/packages/tests/src/cli/prune-storage.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles } from '@peertube/peertube-core-utils' import { FileStorage, HttpStatusCode, HttpStatusCodeType, VideoPlaylistPrivacy, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/cli/update-host.ts b/packages/tests/src/cli/update-host.ts index 10022086fd..6efcb31dbc 100644 --- a/packages/tests/src/cli/update-host.ts +++ b/packages/tests/src/cli/update-host.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { getAllFiles } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/client/embed-html.ts b/packages/tests/src/client/embed-html.ts index 2c25965add..8bdee9db75 100644 --- a/packages/tests/src/client/embed-html.ts +++ b/packages/tests/src/client/embed-html.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ServerConfig } from '@peertube/peertube-models' import { cleanupTests, makeHTMLRequest, PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/client/head-tags.ts b/packages/tests/src/client/head-tags.ts index 228e0e8b5a..7e02f8b7c7 100644 --- a/packages/tests/src/client/head-tags.ts +++ b/packages/tests/src/client/head-tags.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { findAppropriateImage } from '@peertube/peertube-core-utils' import { Account, HttpStatusCode, VideoPlaylistCreateResult } from '@peertube/peertube-models' diff --git a/packages/tests/src/client/index-html.ts b/packages/tests/src/client/index-html.ts index ded5854d4e..21bb36319d 100644 --- a/packages/tests/src/client/index-html.ts +++ b/packages/tests/src/client/index-html.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPlaylistCreateResult } from '@peertube/peertube-models' import { cleanupTests, makeGetRequest, makeHTMLRequest, PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/client/jsonld.ts b/packages/tests/src/client/jsonld.ts index ed45a17a21..e32bc3e28e 100644 --- a/packages/tests/src/client/jsonld.ts +++ b/packages/tests/src/client/jsonld.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { maxBy } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoCreateResult, VideoPlaylistCreateResult, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/client/oembed.ts b/packages/tests/src/client/oembed.ts index 803bd8a670..f419f2a133 100644 --- a/packages/tests/src/client/oembed.ts +++ b/packages/tests/src/client/oembed.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode, VideoPlaylistCreateResult } from '@peertube/peertube-models' @@ -15,9 +15,9 @@ describe('Test oEmbed HTML tags', function () { let playlistIds: (string | number)[] = [] before(async function () { - this.timeout(120000); + this.timeout(120000) - ({ servers, playlistIds, videoIds, playlist, playlistName } = await prepareClientTests()) + ;({ servers, playlistIds, videoIds, playlist, playlistName } = await prepareClientTests()) }) it('Should have valid oEmbed discovery tags for videos', async function () { @@ -31,8 +31,8 @@ describe('Test oEmbed HTML tags', function () { }) const expectedLink = `` + `url=http%3A%2F%2F${servers[0].hostname}%3A${servers[0].port}%2Fw%2F${servers[0].store.video.shortUUID}" ` + + `title="${servers[0].store.video.name}" />` expect(res.text).to.contain(expectedLink) } @@ -71,8 +71,8 @@ describe('Test oEmbed HTML tags', function () { }) const expectedLink = `` + `url=http%3A%2F%2F${servers[0].hostname}%3A${servers[0].port}%2Fw%2F${servers[0].store.video.shortUUID}%3Fstart%3D1m2s" ` + + `title="${servers[0].store.video.name}" />` expect(res.text).to.contain(expectedLink) }) @@ -90,8 +90,8 @@ describe('Test oEmbed HTML tags', function () { }) const expectedLink = `` + `url=http%3A%2F%2F${servers[0].hostname}%3A${servers[0].port}%2Fw%2Fp%2F${playlist.shortUUID}%3FplaylistPosition%3D415" ` + + `title="${playlistName}" />` expect(res.text).to.contain(expectedLink) }) diff --git a/packages/tests/src/external-plugins/akismet.ts b/packages/tests/src/external-plugins/akismet.ts index 89d7784714..1ce4be04bf 100644 --- a/packages/tests/src/external-plugins/akismet.ts +++ b/packages/tests/src/external-plugins/akismet.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { HttpStatusCode } from '@peertube/peertube-models' @@ -38,7 +38,6 @@ describe('Official plugin Akismet', function () { }) describe('Local threads/replies', function () { - before(async function () { const { uuid } = await servers[0].videos.quickUpload({ name: 'video 1' }) videoUUID = uuid @@ -67,7 +66,6 @@ describe('Official plugin Akismet', function () { }) describe('Remote threads/replies', function () { - before(async function () { this.timeout(60000) @@ -126,7 +124,6 @@ describe('Official plugin Akismet', function () { }) describe('Signup', function () { - before(async function () { await servers[0].config.updateExistingConfig({ newConfig: { diff --git a/packages/tests/src/external-plugins/auth-ldap.ts b/packages/tests/src/external-plugins/auth-ldap.ts index f127b80c63..a9c5679719 100644 --- a/packages/tests/src/external-plugins/auth-ldap.ts +++ b/packages/tests/src/external-plugins/auth-ldap.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, UserRole } from '@peertube/peertube-models' import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/external-plugins/auth-openid-connect.ts b/packages/tests/src/external-plugins/auth-openid-connect.ts index 67e61d3c46..0e73044085 100644 --- a/packages/tests/src/external-plugins/auth-openid-connect.ts +++ b/packages/tests/src/external-plugins/auth-openid-connect.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, HttpStatusCodeType, UserRole } from '@peertube/peertube-models' diff --git a/packages/tests/src/external-plugins/auto-block-videos.ts b/packages/tests/src/external-plugins/auto-block-videos.ts index a2d79d6e30..9bd56ea99f 100644 --- a/packages/tests/src/external-plugins/auto-block-videos.ts +++ b/packages/tests/src/external-plugins/auto-block-videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/external-plugins/auto-mute.ts b/packages/tests/src/external-plugins/auto-mute.ts index a4d8c38392..158ccb1535 100644 --- a/packages/tests/src/external-plugins/auto-mute.ts +++ b/packages/tests/src/external-plugins/auto-mute.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/external-plugins/privacy-remover.ts b/packages/tests/src/external-plugins/privacy-remover.ts index 467234f031..ea9dbe9535 100644 --- a/packages/tests/src/external-plugins/privacy-remover.ts +++ b/packages/tests/src/external-plugins/privacy-remover.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { @@ -29,7 +29,6 @@ describe('Official plugin Privacy Remover', function () { }) describe('When disabling public privacy', function () { - before(async function () { await servers[0].plugins.updateSettings({ npmName: 'peertube-plugin-privacy-remover', @@ -68,7 +67,6 @@ describe('Official plugin Privacy Remover', function () { }) describe('When enabling public privacy', function () { - before(async function () { await servers[0].plugins.updateSettings({ npmName: 'peertube-plugin-privacy-remover', diff --git a/packages/tests/src/feeds/feeds.ts b/packages/tests/src/feeds/feeds.ts index cac3b7c7ed..6abe5e76da 100644 --- a/packages/tests/src/feeds/feeds.ts +++ b/packages/tests/src/feeds/feeds.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoCommentPolicy, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/jiwer/jiwer-cli.spec.ts b/packages/tests/src/jiwer/jiwer-cli.spec.ts index 06645f35ae..b7a069d0e3 100644 --- a/packages/tests/src/jiwer/jiwer-cli.spec.ts +++ b/packages/tests/src/jiwer/jiwer-cli.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable max-len */ +/* oxlint-disable max-len */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { join } from 'path' import { mkdir, rm, writeFile } from 'node:fs/promises' @@ -13,7 +13,9 @@ describe('Jiwer CLI', function () { before(async function () { await mkdir(transcriptDirectory, { recursive: true }) - await writeFile(join(transcriptDirectory, 'openai.txt'), `Communiquez lors d'une classe transplante. Utilisez les photos prises lors de cette classe pour raconter quotidiennement le séjour vécu. + await writeFile( + join(transcriptDirectory, 'openai.txt'), + `Communiquez lors d'une classe transplante. Utilisez les photos prises lors de cette classe pour raconter quotidiennement le séjour vécu. C'est le scénario P-Dagujic présenté par monsieur Navoli, professeur ainsi que le 3 sur une école alimentaire de Montpellier. La première application a utilisé ce ralame déatec. L'enseignant va alors transférer les différentes photos réalisés lors de la classe transplante. Dans un dossier, spécifique pour que les élèves puissent le retrouver plus facilement. Il téléverse donc ses photos dans le dossier, dans le venté, dans la médiatèque de la classe. @@ -23,7 +25,8 @@ Ils illustront ses articles à l'aide des photos de que mon numérique mise à n Pour se faire, il pourront utiliser les diteurs avancés qui les renvèrent directement dans la médiatèque de la classe où il pourront retrouver le dossier créé par leurs enseignants. Une fois leur article terminée, les élèves soumétront se lui-ci au professeur qui pourra soit la noté pour correction ou le public. Ensuite, il pourront lire et commenter ce de leurs camarades ou répondre aux commentaires de la veille. -`) +` + ) }) it(`returns coherent wer`, async function () { diff --git a/packages/tests/src/misc-endpoints.ts b/packages/tests/src/misc-endpoints.ts index 2a4b02f552..ddd09a0fa6 100644 --- a/packages/tests/src/misc-endpoints.ts +++ b/packages/tests/src/misc-endpoints.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { uuidToShort } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/nginx.ts b/packages/tests/src/nginx.ts index baf5ff97db..a0f87e6ca4 100644 --- a/packages/tests/src/nginx.ts +++ b/packages/tests/src/nginx.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { makeRawRequest } from '@peertube/peertube-server-commands' @@ -6,11 +6,11 @@ import { makeRawRequest } from '@peertube/peertube-server-commands' describe('Test nginx', function () { it('Should serve public HLS/web video files', async function () { const urls = [ - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/85c8e811-3eb7-4823-8dc5-3c268b6dad60/efad77e7-805d-4b20-8bc9-6e99cee38b20-240-fragmented.mp4', - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/85c8e811-3eb7-4823-8dc5-3c268b6dad60/1afbabfa-5f16-452e-8165-fe9a9a21cdb2-master.m3u8', - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/85c8e811-3eb7-4823-8dc5-3c268b6dad60/efad77e7-805d-4b20-8bc9-6e99cee38b20-240.m3u8' ] @@ -21,13 +21,13 @@ describe('Test nginx', function () { it('Should not serve private HLS/web video files', async function () { const urls = [ - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/private/72f0e8ee-84b9-44b1-9202-3e72ee7f1b65/531f27fe-bb86-42ed-9cf1-eb5bffc4a609-master.m3u8', - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/private/72f0e8ee-84b9-44b1-9202-3e72ee7f1b65/057dbf01-0557-414c-a546-a1cc82ac5d99-480.m3u8', - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/private/72f0e8ee-84b9-44b1-9202-3e72ee7f1b65/c9ef3aa7-5ab6-41c5-91c2-058c50a70c3c-segments-sha256.json', - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'https://peertube2.cpy.re/static/streaming-playlists/hls/private/72f0e8ee-84b9-44b1-9202-3e72ee7f1b65/057dbf01-0557-414c-a546-a1cc82ac5d99-480-fragmented.mp4', 'https://peertube2.cpy.re/static/web-videos/private/72f0e8ee-84b9-44b1-9202-3e72ee7f1b65-480.mp4' ] diff --git a/packages/tests/src/peertube-runner/client-cli.ts b/packages/tests/src/peertube-runner/client-cli.ts index 814b7f13a8..3c697b5698 100644 --- a/packages/tests/src/peertube-runner/client-cli.ts +++ b/packages/tests/src/peertube-runner/client-cli.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { PeerTubeRunnerProcess } from '@tests/shared/peertube-runner-process.js' diff --git a/packages/tests/src/peertube-runner/custom-upload.ts b/packages/tests/src/peertube-runner/custom-upload.ts index a045fa5897..1b4eaf05c4 100644 --- a/packages/tests/src/peertube-runner/custom-upload.ts +++ b/packages/tests/src/peertube-runner/custom-upload.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, RunnerJobState, RunnerJobVODPayload } from '@peertube/peertube-models' diff --git a/packages/tests/src/peertube-runner/generate-storyboard.ts b/packages/tests/src/peertube-runner/generate-storyboard.ts index 4cfbc453fa..fb67f7848a 100644 --- a/packages/tests/src/peertube-runner/generate-storyboard.ts +++ b/packages/tests/src/peertube-runner/generate-storyboard.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { RunnerJobState, VideoPrivacy } from '@peertube/peertube-models' diff --git a/packages/tests/src/peertube-runner/live-transcoding.ts b/packages/tests/src/peertube-runner/live-transcoding.ts index 0c8beefd18..63f8b75ecd 100644 --- a/packages/tests/src/peertube-runner/live-transcoding.ts +++ b/packages/tests/src/peertube-runner/live-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { HttpStatusCode, RunnerJobState, VideoPrivacy } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/peertube-runner/replace-file.ts b/packages/tests/src/peertube-runner/replace-file.ts index 4e6e94ac23..ead627da18 100644 --- a/packages/tests/src/peertube-runner/replace-file.ts +++ b/packages/tests/src/peertube-runner/replace-file.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles } from '@peertube/peertube-core-utils' import { cleanupTests, diff --git a/packages/tests/src/peertube-runner/shutdown.ts b/packages/tests/src/peertube-runner/shutdown.ts index 0101e918fc..5a184844d6 100644 --- a/packages/tests/src/peertube-runner/shutdown.ts +++ b/packages/tests/src/peertube-runner/shutdown.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { RunnerJob, RunnerJobState } from '@peertube/peertube-models' diff --git a/packages/tests/src/peertube-runner/video-state.ts b/packages/tests/src/peertube-runner/video-state.ts index 4db4b3f5ad..0f775420fe 100644 --- a/packages/tests/src/peertube-runner/video-state.ts +++ b/packages/tests/src/peertube-runner/video-state.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { sortBy } from '@peertube/peertube-core-utils' import { MoveVideoStoragePayload, RunnerJobType, RunnerJobVODPayload, VideoState } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/peertube-runner/video-transcription.ts b/packages/tests/src/peertube-runner/video-transcription.ts index ddb305b261..cbe2460eca 100644 --- a/packages/tests/src/peertube-runner/video-transcription.ts +++ b/packages/tests/src/peertube-runner/video-transcription.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { RunnerJobState, VideoResolution } from '@peertube/peertube-models' diff --git a/packages/tests/src/peertube-runner/vod-transcoding.ts b/packages/tests/src/peertube-runner/vod-transcoding.ts index b0e5ac5356..3ced1f35f7 100644 --- a/packages/tests/src/peertube-runner/vod-transcoding.ts +++ b/packages/tests/src/peertube-runner/vod-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAllFiles, wait } from '@peertube/peertube-core-utils' import { VideoPrivacy, VideoResolution } from '@peertube/peertube-models' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/plugins/action-hooks.ts b/packages/tests/src/plugins/action-hooks.ts index 95db5c1571..af2ca2a63a 100644 --- a/packages/tests/src/plugins/action-hooks.ts +++ b/packages/tests/src/plugins/action-hooks.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@peertube/peertube-models' import { @@ -52,7 +52,6 @@ describe('Test plugin action hooks', function () { }) describe('Videos hooks', function () { - it('Should run action:api.video.uploaded', async function () { const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video' } }) videoUUID = uuid @@ -113,7 +112,6 @@ describe('Test plugin action hooks', function () { }) describe('Live hooks', function () { - it('Should run action:api.live-video.created', async function () { const attributes = { name: 'live', @@ -268,7 +266,6 @@ describe('Test plugin action hooks', function () { }) describe('Notification hook', function () { - it('Should run action:notifier.notification.created', async function () { await checkHook('action:notifier.notification.created', false) }) diff --git a/packages/tests/src/plugins/external-auth.ts b/packages/tests/src/plugins/external-auth.ts index 8bb624ebbe..4ce0bbc653 100644 --- a/packages/tests/src/plugins/external-auth.ts +++ b/packages/tests/src/plugins/external-auth.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' @@ -79,7 +79,7 @@ describe('Test external auth plugins', function () { const auths = config.plugin.registeredExternalAuths expect(auths).to.have.lengthOf(10) - const auth2 = auths.find((a) => a.authName === 'external-auth-2') + const auth2 = auths.find(a => a.authName === 'external-auth-2') expect(auth2).to.exist expect(auth2.authDisplayName).to.equal('External Auth 2') expect(auth2.npmName).to.equal('peertube-plugin-test-external-auth-one') @@ -402,7 +402,7 @@ describe('Test external auth plugins', function () { const auths = config.plugin.registeredExternalAuths expect(auths).to.have.lengthOf(8) - const auth2 = auths.find((a) => a.authName === 'external-auth-2') + const auth2 = auths.find(a => a.authName === 'external-auth-2') expect(auth2).to.not.exist }) @@ -435,7 +435,6 @@ describe('Test external auth plugins', function () { }) it('Should redirect to an external site after login if externalRedirectUri is set', async function () { - const res = await server.plugins.getExternalAuth({ npmName: 'test-external-auth-three', npmVersion: '0.0.1', @@ -448,9 +447,9 @@ describe('Test external auth plugins', function () { const location = res.header.location expect(location.startsWith('https://external.com/some/redirect/path?')).to.be.true - + const searchParams = decodeQueryString(location) - + expect(searchParams.externalAuthToken).to.exist expect(searchParams.username).to.equal('cid') diff --git a/packages/tests/src/plugins/filter-hooks.ts b/packages/tests/src/plugins/filter-hooks.ts index 6bae1b6dd6..964054f2f4 100644 --- a/packages/tests/src/plugins/filter-hooks.ts +++ b/packages/tests/src/plugins/filter-hooks.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode, diff --git a/packages/tests/src/plugins/html-injection.ts b/packages/tests/src/plugins/html-injection.ts index 269a45b987..e18b03f4ec 100644 --- a/packages/tests/src/plugins/html-injection.ts +++ b/packages/tests/src/plugins/html-injection.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/plugins/id-and-pass-auth.ts b/packages/tests/src/plugins/id-and-pass-auth.ts index 9fcdf5aa92..f92169c53c 100644 --- a/packages/tests/src/plugins/id-and-pass-auth.ts +++ b/packages/tests/src/plugins/id-and-pass-auth.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { wait } from '@peertube/peertube-core-utils' diff --git a/packages/tests/src/plugins/plugin-helpers.ts b/packages/tests/src/plugins/plugin-helpers.ts index 0c041282ab..9c5ff9ddc6 100644 --- a/packages/tests/src/plugins/plugin-helpers.ts +++ b/packages/tests/src/plugins/plugin-helpers.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists } from 'fs-extra/esm' diff --git a/packages/tests/src/plugins/plugin-router.ts b/packages/tests/src/plugins/plugin-router.ts index 82cf0321ea..ace8cd6b08 100644 --- a/packages/tests/src/plugins/plugin-router.ts +++ b/packages/tests/src/plugins/plugin-router.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/plugins/plugin-settings.ts b/packages/tests/src/plugins/plugin-settings.ts index ec43a8aedf..b1f02f2efa 100644 --- a/packages/tests/src/plugins/plugin-settings.ts +++ b/packages/tests/src/plugins/plugin-settings.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/plugins/plugin-storage.ts b/packages/tests/src/plugins/plugin-storage.ts index f9b0ead0c2..8baa6eaebe 100644 --- a/packages/tests/src/plugins/plugin-storage.ts +++ b/packages/tests/src/plugins/plugin-storage.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists } from 'fs-extra/esm' diff --git a/packages/tests/src/plugins/plugin-transcoding.ts b/packages/tests/src/plugins/plugin-transcoding.ts index e23cff6c8e..da1068ea09 100644 --- a/packages/tests/src/plugins/plugin-transcoding.ts +++ b/packages/tests/src/plugins/plugin-transcoding.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getAudioStream, getVideoStream, getVideoStreamFPS, hasAudioStream, hasVideoStream } from '@peertube/peertube-ffmpeg' import { VideoPrivacy, VideoResolution } from '@peertube/peertube-models' @@ -78,7 +78,6 @@ describe('Test transcoding plugins', function () { }) describe('When using a plugin adding profiles to existing encoders', function () { - async function checkVideoFPS (uuid: string, type: 'above' | 'below', fps: number) { const video = await server.videos.get({ id: uuid }) const files = video.files.concat(...video.streamingPlaylists.map(p => p.files)) @@ -129,7 +128,6 @@ describe('Test transcoding plugins', function () { }) describe('VOD', function () { - it('Should not use the plugin profile if not chosen by the admin', async function () { this.timeout(240000) @@ -177,7 +175,6 @@ describe('Test transcoding plugins', function () { }) describe('Live', function () { - it('Should not use the plugin profile if not chosen by the admin', async function () { this.timeout(240000) @@ -245,11 +242,9 @@ describe('Test transcoding plugins', function () { await checkVideoFPS(videoUUID, 'above', 20) }) }) - }) describe('When using a plugin adding new encoders', function () { - before(async function () { await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-transcoding-two') }) diff --git a/packages/tests/src/plugins/plugin-unloading.ts b/packages/tests/src/plugins/plugin-unloading.ts index 70310bc8c1..36e58ff2a6 100644 --- a/packages/tests/src/plugins/plugin-unloading.ts +++ b/packages/tests/src/plugins/plugin-unloading.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/plugins/plugin-websocket.ts b/packages/tests/src/plugins/plugin-websocket.ts index 832dcebd0e..58870811d7 100644 --- a/packages/tests/src/plugins/plugin-websocket.ts +++ b/packages/tests/src/plugins/plugin-websocket.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import WebSocket from 'ws' import { diff --git a/packages/tests/src/plugins/translations.ts b/packages/tests/src/plugins/translations.ts index a69e141342..a216343942 100644 --- a/packages/tests/src/plugins/translations.ts +++ b/packages/tests/src/plugins/translations.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/plugins/video-constants.ts b/packages/tests/src/plugins/video-constants.ts index b81240a649..b6abdc24c4 100644 --- a/packages/tests/src/plugins/video-constants.ts +++ b/packages/tests/src/plugins/video-constants.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { diff --git a/packages/tests/src/server-helpers/activitypub.ts b/packages/tests/src/server-helpers/activitypub.ts index 7cfc791aca..34a5c65abc 100644 --- a/packages/tests/src/server-helpers/activitypub.ts +++ b/packages/tests/src/server-helpers/activitypub.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { signAndContextify } from '@peertube/peertube-server/core/helpers/activity-pub-utils.js' diff --git a/packages/tests/src/server-helpers/core-utils.ts b/packages/tests/src/server-helpers/core-utils.ts index 15129604ea..55abdef47d 100644 --- a/packages/tests/src/server-helpers/core-utils.ts +++ b/packages/tests/src/server-helpers/core-utils.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import snakeCase from 'lodash-es/snakeCase.js' diff --git a/packages/tests/src/server-helpers/crypto.ts b/packages/tests/src/server-helpers/crypto.ts index afb86aac7f..92fdfcda79 100644 --- a/packages/tests/src/server-helpers/crypto.ts +++ b/packages/tests/src/server-helpers/crypto.ts @@ -1,10 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { decrypt, encrypt } from '@peertube/peertube-server/core/helpers/peertube-crypto.js' describe('Encrypt/Descrypt', function () { - it('Should encrypt and decrypt the string', async function () { const secret = 'my_secret' const str = 'my super string' @@ -24,7 +23,7 @@ describe('Encrypt/Descrypt', function () { try { decrypted = await decrypt(encrypted, 'my_sicret') - } catch { } + } catch {} expect(decrypted).to.not.equal(encrypted) }) diff --git a/packages/tests/src/server-helpers/dns.ts b/packages/tests/src/server-helpers/dns.ts index 444f4e14d7..cb34751600 100644 --- a/packages/tests/src/server-helpers/dns.ts +++ b/packages/tests/src/server-helpers/dns.ts @@ -1,10 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { isResolvingToUnicastOnly } from '@peertube/peertube-server/core/helpers/dns.js' describe('DNS helpers', function () { - it('Should correctly check unicast IPs', async function () { expect(await isResolvingToUnicastOnly('cpy.re')).to.be.true expect(await isResolvingToUnicastOnly('framasoft.org')).to.be.true diff --git a/packages/tests/src/server-helpers/image.ts b/packages/tests/src/server-helpers/image.ts index 140ecf1af1..22003f6a54 100644 --- a/packages/tests/src/server-helpers/image.ts +++ b/packages/tests/src/server-helpers/image.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { remove } from 'fs-extra/esm' diff --git a/packages/tests/src/server-helpers/markdown.ts b/packages/tests/src/server-helpers/markdown.ts index ce727bc64e..a1d7cf3ab0 100644 --- a/packages/tests/src/server-helpers/markdown.ts +++ b/packages/tests/src/server-helpers/markdown.ts @@ -1,12 +1,10 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { mdToPlainText } from '@peertube/peertube-server/core/helpers/markdown.js' import { expect } from 'chai' describe('Markdown helpers', function () { - describe('Plain text', function () { - it('Should convert a list to plain text', function () { const result = mdToPlainText(`* list 1 * list 2 diff --git a/packages/tests/src/server-helpers/mentions.ts b/packages/tests/src/server-helpers/mentions.ts index e95b93b7bb..0307ae5fdf 100644 --- a/packages/tests/src/server-helpers/mentions.ts +++ b/packages/tests/src/server-helpers/mentions.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { extractMentions } from '@peertube/peertube-server/core/helpers/mentions.js' diff --git a/packages/tests/src/server-helpers/password.ts b/packages/tests/src/server-helpers/password.ts index a18d1958bb..0d6a122f79 100644 --- a/packages/tests/src/server-helpers/password.ts +++ b/packages/tests/src/server-helpers/password.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { ADMIN_MEMORABLE_PASSWORD_GENERATION_LENGTH } from '@peertube/peertube-server/core/initializers/constants.js' import { expect } from 'chai' import { generatePassword } from 'password-generator' diff --git a/packages/tests/src/server-helpers/regexp.ts b/packages/tests/src/server-helpers/regexp.ts index ae0a0555b9..863b9eb7e5 100644 --- a/packages/tests/src/server-helpers/regexp.ts +++ b/packages/tests/src/server-helpers/regexp.ts @@ -1,10 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wordsToRegExp } from '@peertube/peertube-server/core/helpers/regexp.js' import { expect } from 'chai' describe('Regexp', function () { - it('Should correctly create a regex from multiple latin words', function () { const regexp = wordsToRegExp([ 'hi', 'toto ', 'hello picsou' ]) diff --git a/packages/tests/src/server-helpers/request.ts b/packages/tests/src/server-helpers/request.ts index b3d0f7aaa1..e089c15548 100644 --- a/packages/tests/src/server-helpers/request.ts +++ b/packages/tests/src/server-helpers/request.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists, remove } from 'fs-extra/esm' @@ -27,7 +27,6 @@ describe('Request helpers', function () { try { await doRequestAndSaveToFile(FIXTURE_URLS.file4K, destPath1, { bodyKBLimit: 3 }) } catch { - await wait(500) expect(await pathExists(destPath1)).to.be.false return diff --git a/packages/tests/src/server-helpers/validator.ts b/packages/tests/src/server-helpers/validator.ts index 122f659989..21ca0fd5bd 100644 --- a/packages/tests/src/server-helpers/validator.ts +++ b/packages/tests/src/server-helpers/validator.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { isStableOrUnstableVersionValid, isStableVersionValid } from '@peertube/peertube-server/core/helpers/custom-validators/misc.js' import {} from '@peertube/peertube-server/core/helpers/custom-validators/plugins.js' diff --git a/packages/tests/src/server-helpers/version.ts b/packages/tests/src/server-helpers/version.ts index 76892d1e78..6a126d2a89 100644 --- a/packages/tests/src/server-helpers/version.ts +++ b/packages/tests/src/server-helpers/version.ts @@ -1,10 +1,9 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { compareSemVer } from '@peertube/peertube-core-utils' describe('Version', function () { - it('Should correctly compare two stable versions', async function () { expect(compareSemVer('3.4.0', '3.5.0')).to.be.below(0) expect(compareSemVer('3.5.0', '3.4.0')).to.be.above(0) diff --git a/packages/tests/src/server-helpers/youtube-dl.ts b/packages/tests/src/server-helpers/youtube-dl.ts index 575e013795..f4922d5e70 100644 --- a/packages/tests/src/server-helpers/youtube-dl.ts +++ b/packages/tests/src/server-helpers/youtube-dl.ts @@ -1,11 +1,10 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { YoutubeDLCLI } from '@peertube/peertube-server/core/helpers/youtube-dl/youtube-dl-cli.js' import { CONFIG } from '@peertube/peertube-server/core/initializers/config.js' describe('YoutubeDLCLI', function () { - describe('wrapWithJSRuntimeOptions', function () { let cli: any diff --git a/packages/tests/src/server-lib/video-constant-registry-factory.ts b/packages/tests/src/server-lib/video-constant-registry-factory.ts index 9522e1c3b7..74060dbff0 100644 --- a/packages/tests/src/server-lib/video-constant-registry-factory.ts +++ b/packages/tests/src/server-lib/video-constant-registry-factory.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ +/* oxlint-disable @typescript-eslint/no-unused-expressions */ import { expect } from 'chai' import { VideoPlaylistPrivacyType, VideoPrivacyType } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/shared/actors.ts b/packages/tests/src/shared/actors.ts index f1f102be46..f771a2d847 100644 --- a/packages/tests/src/shared/actors.ts +++ b/packages/tests/src/shared/actors.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { Account, AccountSummary, HttpStatusCode, VideoChannel, VideoChannelSummary } from '@peertube/peertube-models' import { makeRawRequest, PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/shared/checks.ts b/packages/tests/src/shared/checks.ts index 30c38f90d8..3c8e46ae7b 100644 --- a/packages/tests/src/shared/checks.ts +++ b/packages/tests/src/shared/checks.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { HttpStatusCode } from '@peertube/peertube-models' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' @@ -130,7 +130,7 @@ export async function testImage (options: { await writeFile(fixturePath, body) } - // eslint-disable-next-line preserve-caught-error + // oxlint-disable-next-line preserve-caught-error throw new Error(`${errorMsg}: ${err.message}`) } } diff --git a/packages/tests/src/shared/directories.ts b/packages/tests/src/shared/directories.ts index d7d7cbfbc9..8eeb8cc256 100644 --- a/packages/tests/src/shared/directories.ts +++ b/packages/tests/src/shared/directories.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { pathExists } from 'fs-extra/esm' diff --git a/packages/tests/src/shared/fixture-urls.ts b/packages/tests/src/shared/fixture-urls.ts index 8b46a57d85..5170337d42 100644 --- a/packages/tests/src/shared/fixture-urls.ts +++ b/packages/tests/src/shared/fixture-urls.ts @@ -21,7 +21,7 @@ export const FIXTURE_URLS = { youtubePlaylist: 'https://youtube.com/playlist?list=PLRGXHPrcPd2yc2KdswlAWOxIJ8G3vgy4h', magnet: - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len 'magnet:?xs=https%3A%2F%2Fpeertube2.cpy.re%2Flazy-static%2Ftorrents%2Fb209ca00-c8bb-4b2b-b421-1ede169f3dbc-720.torrent&xt=urn:btih:0f498834733e8057ed5c6f2ee2b4efd8d84a76ee&dn=super+peertube2+video&tr=https%3A%2F%2Fpeertube2.cpy.re%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fpeertube2.cpy.re%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fpeertube2.cpy.re%2Fstatic%2Fwebseed%2Fb209ca00-c8bb-4b2b-b421-1ede169f3dbc-720.mp4', badVideo: 'https://download.cpy.re/peertube/bad_video.mp4', diff --git a/packages/tests/src/shared/import-export.ts b/packages/tests/src/shared/import-export.ts index 82e007cd89..2be795d52e 100644 --- a/packages/tests/src/shared/import-export.ts +++ b/packages/tests/src/shared/import-export.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ +/* oxlint-disable @typescript-eslint/no-unused-expressions */ import { ffprobePromise } from '@peertube/peertube-ffmpeg' import { ActivityCreate, @@ -217,13 +217,13 @@ export async function prepareImportExportTests (options: { // Videos const externalVideo = await remoteServer.videos.quickUpload({ name: 'external video', privacy: VideoPrivacy.PUBLIC }) - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len const noahPrivateVideo = await server.videos.quickUpload({ name: 'noah private video', token: noahToken, privacy: VideoPrivacy.PRIVATE }) const noahVideo = await server.videos.quickUpload({ name: 'noah public video', token: noahToken, privacy: VideoPrivacy.PUBLIC }) await server.playerSettings.updateForVideo({ videoId: noahVideo.uuid, theme: 'lucide' }) - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len const noahVideo2 = await server.videos.upload({ token: noahToken, attributes: { @@ -302,7 +302,7 @@ export async function prepareImportExportTests (options: { const noahPlaylist = await server.playlists.quickCreate({ displayName: 'noah playlist 1', token: noahToken }) await server.playlists.quickCreate({ displayName: 'noah playlist 2', token: noahToken, privacy: VideoPlaylistPrivacy.PRIVATE }) - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len await server.playlists.addElement({ playlistId: noahPlaylist.uuid, token: noahToken, diff --git a/packages/tests/src/shared/live.ts b/packages/tests/src/shared/live.ts index 7507098e8d..f7defb5b10 100644 --- a/packages/tests/src/shared/live.ts +++ b/packages/tests/src/shared/live.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@peertube/peertube-ffmpeg' import { LiveVideo, VideoResolution, VideoStreamingPlaylistType } from '@peertube/peertube-models' diff --git a/packages/tests/src/shared/notifications/check-admin-notifications.ts b/packages/tests/src/shared/notifications/check-admin-notifications.ts index b01b7496ee..48f1fca3f7 100644 --- a/packages/tests/src/shared/notifications/check-admin-notifications.ts +++ b/packages/tests/src/shared/notifications/check-admin-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { PluginType_Type, UserNotification, UserNotificationType } from '@peertube/peertube-models' import { expect } from 'chai' diff --git a/packages/tests/src/shared/notifications/check-channel-notifications.ts b/packages/tests/src/shared/notifications/check-channel-notifications.ts index cc89d7814f..7706909e36 100644 --- a/packages/tests/src/shared/notifications/check-channel-notifications.ts +++ b/packages/tests/src/shared/notifications/check-channel-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, diff --git a/packages/tests/src/shared/notifications/check-comment-notifications.ts b/packages/tests/src/shared/notifications/check-comment-notifications.ts index c19024eecb..280e97db9c 100644 --- a/packages/tests/src/shared/notifications/check-comment-notifications.ts +++ b/packages/tests/src/shared/notifications/check-comment-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationType } from '@peertube/peertube-models' import { expect } from 'chai' diff --git a/packages/tests/src/shared/notifications/check-follow-notifications.ts b/packages/tests/src/shared/notifications/check-follow-notifications.ts index fffe236c44..539313794d 100644 --- a/packages/tests/src/shared/notifications/check-follow-notifications.ts +++ b/packages/tests/src/shared/notifications/check-follow-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationType } from '@peertube/peertube-models' import { expect } from 'chai' diff --git a/packages/tests/src/shared/notifications/check-moderation-notifications.ts b/packages/tests/src/shared/notifications/check-moderation-notifications.ts index aaae18b74e..8352d8f42a 100644 --- a/packages/tests/src/shared/notifications/check-moderation-notifications.ts +++ b/packages/tests/src/shared/notifications/check-moderation-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { AbuseState, AbuseStateType, UserNotification, UserNotificationType } from '@peertube/peertube-models' import { expect } from 'chai' diff --git a/packages/tests/src/shared/notifications/check-video-notifications.ts b/packages/tests/src/shared/notifications/check-video-notifications.ts index 6fdb1f5220..08ffe351b4 100644 --- a/packages/tests/src/shared/notifications/check-video-notifications.ts +++ b/packages/tests/src/shared/notifications/check-video-notifications.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification, UserNotificationType } from '@peertube/peertube-models' import { expect } from 'chai' diff --git a/packages/tests/src/shared/notifications/notifications-common.ts b/packages/tests/src/shared/notifications/notifications-common.ts index 7901351d48..a8bfa408b6 100644 --- a/packages/tests/src/shared/notifications/notifications-common.ts +++ b/packages/tests/src/shared/notifications/notifications-common.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/shared/notifications/shared/notification-checker.ts b/packages/tests/src/shared/notifications/shared/notification-checker.ts index b2667ae59d..0b8c1c5870 100644 --- a/packages/tests/src/shared/notifications/shared/notification-checker.ts +++ b/packages/tests/src/shared/notifications/shared/notification-checker.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { UserNotification } from '@peertube/peertube-models' import { PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/shared/plugins.ts b/packages/tests/src/shared/plugins.ts index c2afcbcbf8..4b2ddf9f80 100644 --- a/packages/tests/src/shared/plugins.ts +++ b/packages/tests/src/shared/plugins.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' import { PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/shared/storyboard.ts b/packages/tests/src/shared/storyboard.ts index 76201ac07a..4cca16c1d8 100644 --- a/packages/tests/src/shared/storyboard.ts +++ b/packages/tests/src/shared/storyboard.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { makeRawRequest, PeerTubeServer } from '@peertube/peertube-server-commands' diff --git a/packages/tests/src/shared/streaming-playlists.ts b/packages/tests/src/shared/streaming-playlists.ts index 121276ff89..7cef232676 100644 --- a/packages/tests/src/shared/streaming-playlists.ts +++ b/packages/tests/src/shared/streaming-playlists.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { getHLS, removeFragmentedMP4Ext, uuidRegex, wait } from '@peertube/peertube-core-utils' import { diff --git a/packages/tests/src/shared/tracker.ts b/packages/tests/src/shared/tracker.ts index fe4dd9b14d..38bcc2754a 100644 --- a/packages/tests/src/shared/tracker.ts +++ b/packages/tests/src/shared/tracker.ts @@ -5,7 +5,7 @@ export async function checkTrackerInfohash (serverUrl: string, infohash: string) const path = '/tracker/announce' // From bittorrent-tracker - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated const infohashBinary = escape(Buffer.from(infohash, 'hex').toString('binary')).replace(/[@*/+]/g, function (char) { return '%' + char.charCodeAt(0).toString(16).toUpperCase() }) diff --git a/packages/tests/src/shared/transcription.ts b/packages/tests/src/shared/transcription.ts index 906b3419d9..92a8fabfa5 100644 --- a/packages/tests/src/shared/transcription.ts +++ b/packages/tests/src/shared/transcription.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { HttpStatusCode } from '@peertube/peertube-models' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' diff --git a/packages/tests/src/shared/videos.ts b/packages/tests/src/shared/videos.ts index 74d622abfd..3baebad97f 100644 --- a/packages/tests/src/shared/videos.ts +++ b/packages/tests/src/shared/videos.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +/* oxlint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ import { uuidRegex } from '@peertube/peertube-core-utils' import { ffprobePromise } from '@peertube/peertube-ffmpeg' @@ -500,20 +500,20 @@ export async function checkThumbnails (options: { await testImageGeneratedByFFmpeg({ name: thumbnail.filename, url: videoThumbnail.fileUrl }) } - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated await testImageGeneratedByFFmpeg({ name: thumbnails.find(t => t.width === 280 && t.height === 157).filename, - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated url: server.url + entity.thumbnailPath }) const preview = thumbnails.find(t => t.width === 1920 && t.height === 1080) if (video && preview) { - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated await testImageGeneratedByFFmpeg({ name: preview.filename, - // eslint-disable-next-line @typescript-eslint/no-deprecated + // oxlint-disable-next-line @typescript-eslint/no-deprecated url: server.url + video.previewPath }) } diff --git a/packages/tests/src/transcription/transcript/transcript-file-evaluator.spec.ts b/packages/tests/src/transcription/transcript/transcript-file-evaluator.spec.ts index 0ee2fba2f7..0f722ddd17 100644 --- a/packages/tests/src/transcription/transcript/transcript-file-evaluator.spec.ts +++ b/packages/tests/src/transcription/transcript/transcript-file-evaluator.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions, no-new, max-len */ +/* oxlint-disable @typescript-eslint/no-unused-expressions, no-new, max-len */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { TranscriptFile } from '@peertube/peertube-transcription' import { TranscriptFileEvaluator } from '@peertube/peertube-transcription-devtools' @@ -37,7 +37,8 @@ describe('Transcript File Evaluator', function () { }) const hypothesis = await TranscriptFile.write({ path: join(transcriptDirectory, 'openai.txt'), - content: `Communiquez lors d'une classe transplante. Utilisez les photos prises lors de cette classe pour raconter quotidiennement le séjour vécu. + content: + `Communiquez lors d'une classe transplante. Utilisez les photos prises lors de cette classe pour raconter quotidiennement le séjour vécu. C'est le scénario P-Dagujic présenté par monsieur Navoli, professeur ainsi que le 3 sur une école alimentaire de Montpellier. La première application a utilisé ce ralame déatec. L'enseignant va alors transférer les différentes photos réalisés lors de la classe transplante. Dans un dossier, spécifique pour que les élèves puissent le retrouver plus facilement. Il téléverse donc ses photos dans le dossier, dans le venté, dans la médiatèque de la classe. diff --git a/packages/tests/src/transcription/transcript/transcript-file.spec.ts b/packages/tests/src/transcription/transcript/transcript-file.spec.ts index e2e3c194a2..e4eb2e3542 100644 --- a/packages/tests/src/transcription/transcript/transcript-file.spec.ts +++ b/packages/tests/src/transcription/transcript/transcript-file.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ +/* oxlint-disable @typescript-eslint/no-unused-expressions */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { TranscriptFile } from '@peertube/peertube-transcription' import { expect } from 'chai' diff --git a/packages/tests/src/transcription/whisper/openai-transcriber.spec.ts b/packages/tests/src/transcription/whisper/openai-transcriber.spec.ts index 314ba48f60..f7b9f85c09 100644 --- a/packages/tests/src/transcription/whisper/openai-transcriber.spec.ts +++ b/packages/tests/src/transcription/whisper/openai-transcriber.spec.ts @@ -1,11 +1,6 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions, max-len */ +/* oxlint-disable @typescript-eslint/no-unused-expressions, max-len */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' -import { - OpenaiTranscriber, - TranscriptFile, - TranscriptionModel, - WhisperBuiltinModel -} from '@peertube/peertube-transcription' +import { OpenaiTranscriber, TranscriptFile, TranscriptionModel, WhisperBuiltinModel } from '@peertube/peertube-transcription' import { TranscriptFileEvaluator, levenshteinDistance } from '@peertube/peertube-transcription-devtools' import { createConsoleLogger } from '@tests/shared/common.js' import { downloadCustomModelsIfNeeded, getCustomModelPath } from '@tests/shared/transcription.js' @@ -53,7 +48,13 @@ describe('Open AI Whisper transcriber', function () { it('Should transcribe a media file and provide a valid path to a transcript file in `vtt` format', async function () { this.timeout(3 * 1000 * 60) - const transcript = await transcriber.transcribe({ mediaFilePath: shortVideoPath, language: 'en', format: 'vtt', model, transcriptDirectory }) + const transcript = await transcriber.transcribe({ + mediaFilePath: shortVideoPath, + language: 'en', + format: 'vtt', + model, + transcriptDirectory + }) expect(transcript.format).to.equals('vtt') expect(transcript.language).to.equals('en') @@ -61,7 +62,13 @@ describe('Open AI Whisper transcriber', function () { }) it('May produce a transcript file in the `srt` format', async function () { - const transcript = await transcriber.transcribe({ mediaFilePath: shortVideoPath, language: 'en', format: 'srt', model, transcriptDirectory }) + const transcript = await transcriber.transcribe({ + mediaFilePath: shortVideoPath, + language: 'en', + format: 'srt', + model, + transcriptDirectory + }) expect(transcript.format).to.equals('srt') expect(transcript.language).to.equals('en') @@ -69,7 +76,13 @@ describe('Open AI Whisper transcriber', function () { }) it('May produce a transcript file in the `txt` format', async function () { - const transcript = await transcriber.transcribe({ mediaFilePath: shortVideoPath, language: 'en', format: 'txt', model, transcriptDirectory }) + const transcript = await transcriber.transcribe({ + mediaFilePath: shortVideoPath, + language: 'en', + format: 'txt', + model, + transcriptDirectory + }) expect(transcript.format).to.equals('txt') expect(transcript.language).to.equals('en') @@ -95,7 +108,13 @@ describe('Open AI Whisper transcriber', function () { it('May transcribe a media file in french', async function () { this.timeout(5 * 1000 * 60) - const transcript = await transcriber.transcribe({ mediaFilePath: frVideoPath, language: 'fr', format: 'txt', model, transcriptDirectory }) + const transcript = await transcriber.transcribe({ + mediaFilePath: frVideoPath, + language: 'fr', + format: 'txt', + model, + transcriptDirectory + }) expect(transcript.format).to.equals('txt') expect(transcript.language).to.equals('fr') diff --git a/packages/tests/src/transcription/whisper/whisper-ctranslate2.spec.ts b/packages/tests/src/transcription/whisper/whisper-ctranslate2.spec.ts index ea25e411d6..d34b57d846 100644 --- a/packages/tests/src/transcription/whisper/whisper-ctranslate2.spec.ts +++ b/packages/tests/src/transcription/whisper/whisper-ctranslate2.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions, max-len */ +/* oxlint-disable @typescript-eslint/no-unused-expressions, max-len */ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { Ctranslate2Transcriber, OpenaiTranscriber, TranscriptFile, TranscriptionModel } from '@peertube/peertube-transcription' import { TranscriptFileEvaluator, levenshteinDistance } from '@peertube/peertube-transcription-devtools' diff --git a/packages/transcription-devtools/src/levenshtein.ts b/packages/transcription-devtools/src/levenshtein.ts index 474ab608a2..c25d1fa3ba 100644 --- a/packages/transcription-devtools/src/levenshtein.ts +++ b/packages/transcription-devtools/src/levenshtein.ts @@ -94,7 +94,7 @@ export function levenshteinDistance (a: string, b: string): number { dd = ++x for (y = 0; y < len; y += 2) { dy = vector[y] - // eslint-disable-next-line no-multi-assign + // oxlint-disable-next-line no-multi-assign vector[y] = dd = min(dy, d0, dd, bx0, vector[y + 1]) d0 = dy } diff --git a/packages/transcription/src/whisper/whisper-builtin-model.ts b/packages/transcription/src/whisper/whisper-builtin-model.ts index 32981ad203..ab49e1912a 100644 --- a/packages/transcription/src/whisper/whisper-builtin-model.ts +++ b/packages/transcription/src/whisper/whisper-builtin-model.ts @@ -3,8 +3,7 @@ import { TranscriptionModel } from '../transcription-model.js' export type WhisperBuiltinModelName = 'tiny' | 'base' | 'small' | 'medium' | 'large' | 'large-v2' | 'large-v3' export class WhisperBuiltinModel extends TranscriptionModel { - - // eslint-disable-next-line @typescript-eslint/no-useless-constructor + // oxlint-disable-next-line @typescript-eslint/no-useless-constructor constructor (name: WhisperBuiltinModelName) { super(name) } diff --git a/packages/types-generator/generate-package.ts b/packages/types-generator/generate-package.ts index 26b224d176..f23f662d15 100644 --- a/packages/types-generator/generate-package.ts +++ b/packages/types-generator/generate-package.ts @@ -41,8 +41,10 @@ async function run () { await remove(typesDistTMPPath) execSync(`npm run tsc -- -b ${typesTsConfigPath} --verbose`, { stdio: 'inherit' }) - // eslint-disable-next-line max-len - execSync(`npm run resolve-tspaths -- --project ${distTmpTsConfigPath} --src ${typesDistTMPPath} --out ${typesDistTMPPath}`, { stdio: 'inherit' }) + // oxlint-disable-next-line max-len + execSync(`npm run resolve-tspaths -- --project ${distTmpTsConfigPath} --src ${typesDistTMPPath} --out ${typesDistTMPPath}`, { + stdio: 'inherit' + }) execSync(`./node_modules/.bin/rollup -c ${rollupConfig}`, { stdio: 'inherit' }) await remove(typesDistTMPPath) diff --git a/packages/typescript-utils/src/types.ts b/packages/typescript-utils/src/types.ts index 40a3b941a4..a15ee03ba4 100644 --- a/packages/typescript-utils/src/types.ts +++ b/packages/typescript-utils/src/types.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/array-type */ +/* oxlint-disable @typescript-eslint/array-type */ export type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never @@ -46,7 +46,7 @@ export type Awaitable = T | PromiseLike // Thanks https://stackoverflow.com/a/52761156 export type OverloadedParameters = - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len T extends { (...args: infer A1): any, (...args: infer A2): any, (...args: infer A3): any, (...args: infer A4): any } ? A1 | A2 | A3 | A4 : T extends { (...args: infer A1): any, (...args: infer A2): any, (...args: infer A3): any } ? A1 | A2 | A3 : T extends { (...args: infer A1): any, (...args: infer A2): any } ? A1 | A2 : diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebfd2adaa6..9ebfdc60dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -489,12 +489,9 @@ importers: depcheck: specifier: ^1.4.7 version: 1.4.7 - eslint: - specifier: ^9.39.3 - version: 9.39.3(jiti@2.6.1) - eslint-config-love: - specifier: ^133.0.0 - version: 133.0.0(@typescript-eslint/parser@8.56.1(eslint@9.39.3(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.3(jiti@2.6.1))(typescript@5.9.3) + eslint-plugin-eslint-comments: + specifier: ^3.2.0 + version: 3.2.0(eslint@9.39.3(jiti@2.6.1)) fast-xml-parser: specifier: ^5.5.6 version: 5.5.6 @@ -510,6 +507,12 @@ importers: mocha: specifier: ^11.7.5 version: 11.7.5 + oxlint: + specifier: ^1.57.0 + version: 1.57.0(oxlint-tsgolint@0.17.4) + oxlint-tsgolint: + specifier: ^0.17.4 + version: 0.17.4 pixelmatch: specifier: ^7.1.0 version: 7.1.0 @@ -843,7 +846,7 @@ importers: version: 8.0.2(@types/node@20.19.33)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2) vite-plugin-checker: specifier: ^0.12.0 - version: 0.12.0(eslint@9.39.3(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(stylelint@16.26.1(typescript@5.9.3))(typescript@5.9.3)(vite@8.0.2) + version: 0.12.0(eslint@9.39.3(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.57.0(oxlint-tsgolint@0.17.4))(stylelint@16.26.1(typescript@5.9.3))(typescript@5.9.3)(vite@8.0.2) vite-plugin-node-polyfills: specifier: ^0.25.0 version: 0.25.0(rollup@4.59.0)(vite@8.0.2) @@ -2991,6 +2994,150 @@ packages: '@oxc-project/types@0.122.0': resolution: {integrity: sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==} + '@oxlint-tsgolint/darwin-arm64@0.17.4': + resolution: {integrity: sha512-XEA7vl/T1+wiVnMq2MR6u5OYr2pwKHiAPgklxpK8tPrjQ1ci/amNmwI8ECn6TPXSCsC8SJsSN5xvzXm5H3dTfw==} + cpu: [arm64] + os: [darwin] + + '@oxlint-tsgolint/darwin-x64@0.17.4': + resolution: {integrity: sha512-EY2wmHWqkz72B0/ddMiAM564ZXpEuN1i7JqJJhLmDUQfiHX0/X0EqK3xlSScMCFcVicitOxbKO9oqbde3658yg==} + cpu: [x64] + os: [darwin] + + '@oxlint-tsgolint/linux-arm64@0.17.4': + resolution: {integrity: sha512-XL2X8hgp3/TZWeHFLUnWrveTCBPxy1kNtpzfvVkLtBgyoaRyopPYL0Mnm+ypXKgGvUdcjDaiJhnRjFHWmqZkew==} + cpu: [arm64] + os: [linux] + + '@oxlint-tsgolint/linux-x64@0.17.4': + resolution: {integrity: sha512-jT+aWtQuU8jefwfBLAZu16p4t8xUDjxL6KKlOeuwX3cS6NO60ITJ4Glm8eQYq5cGsOmYIKXNIe4ckPpL5LC+5g==} + cpu: [x64] + os: [linux] + + '@oxlint-tsgolint/win32-arm64@0.17.4': + resolution: {integrity: sha512-pnnkBaI5tHBFhx+EhmpUHccBT3VOAXTgWK2eQBVLE4a/ywhpHN+8D6/QQN+ZTaA4LTkKowvlGD6vDOVP5KRPvw==} + cpu: [arm64] + os: [win32] + + '@oxlint-tsgolint/win32-x64@0.17.4': + resolution: {integrity: sha512-JxT81aEUBNA/s01Ql2OQ2DLAsuM0M+mK9iLHunukOdPMhjA6NvFE/GtTablBYJKScK21d/xTvnoSLgQU3l22Cw==} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.57.0': + resolution: {integrity: sha512-C7EiyfAJG4B70496eV543nKiq5cH0o/xIh/ufbjQz3SIvHhlDDsyn+mRFh+aW8KskTyUpyH2LGWL8p2oN6bl1A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.57.0': + resolution: {integrity: sha512-9i80AresjZ/FZf5xK8tKFbhQnijD4s1eOZw6/FHUwD59HEZbVLRc2C88ADYJfLZrF5XofWDiRX/Ja9KefCLy7w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.57.0': + resolution: {integrity: sha512-0eUfhRz5L2yKa9I8k3qpyl37XK3oBS5BvrgdVIx599WZK63P8sMbg+0s4IuxmIiZuBK68Ek+Z+gcKgeYf0otsg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.57.0': + resolution: {integrity: sha512-UvrSuzBaYOue+QMAcuDITe0k/Vhj6KZGjfnI6x+NkxBTke/VoM7ZisaxgNY0LWuBkTnd1OmeQfEQdQ48fRjkQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.57.0': + resolution: {integrity: sha512-wtQq0dCoiw4bUwlsNVDJJ3pxJA218fOezpgtLKrbQqUtQJcM9yP8z+I9fu14aHg0uyAxIY+99toL6uBa2r7nxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.57.0': + resolution: {integrity: sha512-qxFWl2BBBFcT4djKa+OtMdnLgoHEJXpqjyGwz8OhW35ImoCwR5qtAGqApNYce5260FQqoAHW8S8eZTjiX67Tsg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.57.0': + resolution: {integrity: sha512-SQoIsBU7J0bDW15/f0/RvxHfY3Y0+eB/caKBQtNFbuerTiA6JCYx9P1MrrFTwY2dTm/lMgTSgskvCEYk2AtG/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.57.0': + resolution: {integrity: sha512-jqxYd1W6WMeozsCmqe9Rzbu3SRrGTyGDAipRlRggetyYbUksJqJKvUNTQtZR/KFoJPb+grnSm5SHhdWrywv3RQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxlint/binding-linux-arm64-musl@1.57.0': + resolution: {integrity: sha512-i66WyEPVEvq9bxRUCJ/MP5EBfnTDN3nhwEdFZFTO5MmLLvzngfWEG3NSdXQzTT3vk5B9i6C2XSIYBh+aG6uqyg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxlint/binding-linux-ppc64-gnu@1.57.0': + resolution: {integrity: sha512-oMZDCwz4NobclZU3pH+V1/upVlJZiZvne4jQP+zhJwt+lmio4XXr4qG47CehvrW1Lx2YZiIHuxM2D4YpkG3KVA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxlint/binding-linux-riscv64-gnu@1.57.0': + resolution: {integrity: sha512-uoBnjJ3MMEBbfnWC1jSFr7/nSCkcQYa72NYoNtLl1imshDnWSolYCjzb8LVCwYCCfLJXD+0gBLD7fyC14c0+0g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-riscv64-musl@1.57.0': + resolution: {integrity: sha512-BdrwD7haPZ8a9KrZhKJRSj6jwCor+Z8tHFZ3PT89Y3Jq5v3LfMfEePeAmD0LOTWpiTmzSzdmyw9ijneapiVHKQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-s390x-gnu@1.57.0': + resolution: {integrity: sha512-BNs+7ZNsRstVg2tpNxAXfMX/Iv5oZh204dVyb8Z37+/gCh+yZqNTlg6YwCLIMPSk5wLWIGOaQjT0GUOahKYImw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxlint/binding-linux-x64-gnu@1.57.0': + resolution: {integrity: sha512-AghS18w+XcENcAX0+BQGLiqjpqpaxKJa4cWWP0OWNLacs27vHBxu7TYkv9LUSGe5w8lOJHeMxcYfZNOAPqw2bg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxlint/binding-linux-x64-musl@1.57.0': + resolution: {integrity: sha512-E/FV3GB8phu/Rpkhz5T96hAiJlGzn91qX5yj5gU754P5cmVGXY1Jw/VSjDSlZBCY3VHjsVLdzgdkJaomEmcNOg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxlint/binding-openharmony-arm64@1.57.0': + resolution: {integrity: sha512-xvZ2yZt0nUVfU14iuGv3V25jpr9pov5N0Wr28RXnHFxHCRxNDMtYPHV61gGLhN9IlXM96gI4pyYpLSJC5ClLCQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.57.0': + resolution: {integrity: sha512-Z4D8Pd0AyHBKeazhdIXeUUy5sIS3Mo0veOlzlDECg6PhRRKgEsBJCCV1n+keUZtQ04OP+i7+itS3kOykUyNhDg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.57.0': + resolution: {integrity: sha512-StOZ9nFMVKvevicbQfql6Pouu9pgbeQnu60Fvhz2S6yfMaii+wnueLnqQ5I1JPgNF0Syew4voBlAaHD13wH6tw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.57.0': + resolution: {integrity: sha512-6PuxhYgth8TuW0+ABPOIkGdBYw+qYGxgIdXPHSVpiCDm+hqTTWCmC739St1Xni0DJBt8HnSHTG67i1y6gr8qrA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@paralleldrive/cuid2@2.3.1': resolution: {integrity: sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==} @@ -8676,6 +8823,20 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} + oxlint-tsgolint@0.17.4: + resolution: {integrity: sha512-4F/NXJiK2KnK4LQiULUPXRzVq0LOfextGvwCVRW1VKQbF5epI3MDMEGVAl5XjAGL6IFc7xBc/eVA95wczPeEQg==} + hasBin: true + + oxlint@1.57.0: + resolution: {integrity: sha512-DGFsuBX5MFZX9yiDdtKjTrYPq45CZ8Fft6qCltJITYZxfwYjVdGf/6wycGYTACloauwIPxUnYhBVeZbHvleGhw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=0.15.0' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + p-cancelable@4.0.1: resolution: {integrity: sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==} engines: {node: '>=14.16'} @@ -13770,6 +13931,81 @@ snapshots: '@oxc-project/types@0.122.0': {} + '@oxlint-tsgolint/darwin-arm64@0.17.4': + optional: true + + '@oxlint-tsgolint/darwin-x64@0.17.4': + optional: true + + '@oxlint-tsgolint/linux-arm64@0.17.4': + optional: true + + '@oxlint-tsgolint/linux-x64@0.17.4': + optional: true + + '@oxlint-tsgolint/win32-arm64@0.17.4': + optional: true + + '@oxlint-tsgolint/win32-x64@0.17.4': + optional: true + + '@oxlint/binding-android-arm-eabi@1.57.0': + optional: true + + '@oxlint/binding-android-arm64@1.57.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.57.0': + optional: true + + '@oxlint/binding-darwin-x64@1.57.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.57.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.57.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.57.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.57.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.57.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.57.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.57.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.57.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.57.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.57.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.57.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.57.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.57.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.57.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.57.0': + optional: true + '@paralleldrive/cuid2@2.3.1': dependencies: '@noble/hashes': 1.8.0 @@ -13818,7 +14054,7 @@ snapshots: detect-libc: 2.1.2 is-glob: 4.0.3 node-addon-api: 7.1.1 - picomatch: 4.0.3 + picomatch: 4.0.4 optionalDependencies: '@parcel/watcher-android-arm64': 2.5.6 '@parcel/watcher-darwin-arm64': 2.5.6 @@ -14187,7 +14423,7 @@ snapshots: dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 - picomatch: 4.0.3 + picomatch: 4.0.4 optionalDependencies: rollup: 4.59.0 @@ -14688,7 +14924,7 @@ snapshots: eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 - picomatch: 4.0.3 + picomatch: 4.0.4 '@stylistic/stylelint-plugin@3.1.3(stylelint@16.26.1(typescript@5.9.3))': dependencies: @@ -15270,7 +15506,7 @@ snapshots: '@vitejs/devtools-rpc': 0.1.11(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) birpc: 4.0.0 ohash: 2.0.11 - vite: 8.0.2(@types/node@20.19.33)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2) + vite: 8.0.2(@types/node@25.3.0)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2) transitivePeerDependencies: - typescript - ws @@ -15359,7 +15595,7 @@ snapshots: perfect-debounce: 2.1.0 sirv: 3.0.2 tinyexec: 1.0.4 - vite: 8.0.2(@types/node@20.19.33)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2) + vite: 8.0.2(@types/node@25.3.0)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2) vue: 3.5.30(typescript@5.9.3) ws: 8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: @@ -19378,7 +19614,7 @@ snapshots: chalk: 4.1.2 ci-info: 4.4.0 graceful-fs: 4.2.11 - picomatch: 4.0.3 + picomatch: 4.0.4 jiti@2.6.1: {} @@ -20666,6 +20902,38 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 + oxlint-tsgolint@0.17.4: + optionalDependencies: + '@oxlint-tsgolint/darwin-arm64': 0.17.4 + '@oxlint-tsgolint/darwin-x64': 0.17.4 + '@oxlint-tsgolint/linux-arm64': 0.17.4 + '@oxlint-tsgolint/linux-x64': 0.17.4 + '@oxlint-tsgolint/win32-arm64': 0.17.4 + '@oxlint-tsgolint/win32-x64': 0.17.4 + + oxlint@1.57.0(oxlint-tsgolint@0.17.4): + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.57.0 + '@oxlint/binding-android-arm64': 1.57.0 + '@oxlint/binding-darwin-arm64': 1.57.0 + '@oxlint/binding-darwin-x64': 1.57.0 + '@oxlint/binding-freebsd-x64': 1.57.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.57.0 + '@oxlint/binding-linux-arm-musleabihf': 1.57.0 + '@oxlint/binding-linux-arm64-gnu': 1.57.0 + '@oxlint/binding-linux-arm64-musl': 1.57.0 + '@oxlint/binding-linux-ppc64-gnu': 1.57.0 + '@oxlint/binding-linux-riscv64-gnu': 1.57.0 + '@oxlint/binding-linux-riscv64-musl': 1.57.0 + '@oxlint/binding-linux-s390x-gnu': 1.57.0 + '@oxlint/binding-linux-x64-gnu': 1.57.0 + '@oxlint/binding-linux-x64-musl': 1.57.0 + '@oxlint/binding-openharmony-arm64': 1.57.0 + '@oxlint/binding-win32-arm64-msvc': 1.57.0 + '@oxlint/binding-win32-ia32-msvc': 1.57.0 + '@oxlint/binding-win32-x64-msvc': 1.57.0 + oxlint-tsgolint: 0.17.4 + p-cancelable@4.0.1: {} p-event@4.2.0: @@ -22930,7 +23198,7 @@ snapshots: ts-declaration-location@1.0.7(typescript@5.9.3): dependencies: - picomatch: 4.0.3 + picomatch: 4.0.4 typescript: 5.9.3 ts-node@10.9.2(@swc/core@1.15.17)(@types/node@20.19.33)(typescript@5.9.3): @@ -23337,7 +23605,7 @@ snapshots: dependencies: global: 4.4.0 - vite-plugin-checker@0.12.0(eslint@9.39.3(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(stylelint@16.26.1(typescript@5.9.3))(typescript@5.9.3)(vite@8.0.2): + vite-plugin-checker@0.12.0(eslint@9.39.3(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.57.0(oxlint-tsgolint@0.17.4))(stylelint@16.26.1(typescript@5.9.3))(typescript@5.9.3)(vite@8.0.2): dependencies: '@babel/code-frame': 7.29.0 chokidar: 4.0.3 @@ -23352,6 +23620,7 @@ snapshots: eslint: 9.39.3(jiti@2.6.1) meow: 13.2.0 optionator: 0.9.4 + oxlint: 1.57.0(oxlint-tsgolint@0.17.4) stylelint: 16.26.1(typescript@5.9.3) typescript: 5.9.3 @@ -23399,6 +23668,24 @@ snapshots: tsx: 4.21.0 yaml: 2.8.2 + vite@8.0.2(@types/node@25.3.0)(@vitejs/devtools@0.1.11)(esbuild@0.27.3)(jiti@2.6.1)(sass-embedded@1.97.3)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.8 + rolldown: 1.0.0-rc.11 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 25.3.0 + '@vitejs/devtools': 0.1.11(@pnpm/logger@1001.0.1)(bufferutil@4.1.0)(ioredis@5.9.3)(typescript@5.9.3)(utf-8-validate@6.0.6)(vite@8.0.2) + esbuild: 0.27.3 + fsevents: 2.3.3 + jiti: 2.6.1 + sass: 1.97.3 + sass-embedded: 1.97.3 + tsx: 4.21.0 + yaml: 2.8.2 + vm-browserify@1.1.2: {} void-elements@3.1.0: {} diff --git a/scripts/ci.sh b/scripts/ci.sh index e82b2ea83c..0d91047734 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -144,7 +144,7 @@ elif [ "$1" = "external-plugins" ]; then runJSTest "$1" 1 $externalPluginsFiles MOCHA_PARALLEL=true runJSTest "$1" $((2*$speedFactor)) $peertubeRunnerFiles elif [ "$1" = "lint" ]; then - npm run eslint + npm run oxlint -- --import-plugin --promise-plugin --node-plugin npm run swagger-cli -- validate support/doc/api/openapi.yaml diff --git a/server/core/controllers/api/blocklist.ts b/server/core/controllers/api/blocklist.ts index 01f87d5ffc..4d2e5c6c31 100644 --- a/server/core/controllers/api/blocklist.ts +++ b/server/core/controllers/api/blocklist.ts @@ -12,11 +12,7 @@ const blocklistRouter = express.Router() blocklistRouter.use(apiRateLimiter) -blocklistRouter.get('/status', - optionalAuthenticate, - blocklistStatusValidator, - asyncMiddleware(getBlocklistStatus) -) +blocklistRouter.get('/status', optionalAuthenticate, blocklistStatusValidator, asyncMiddleware(getBlocklistStatus)) // --------------------------------------------------------------------------- @@ -105,6 +101,6 @@ async function populateAccountBlocklistStatus (options: { function getStatus (block: { accountId: number }, serverActor: MActorAccountId, user?: MUserAccountId) { return { blockedByServer: !!(block?.accountId === serverActor.Account.id), - blockedByUser: !!(block && user && block.accountId === user.Account.id) + blockedByUser: !!(block && block.accountId === user?.Account.id) } } diff --git a/server/core/controllers/feeds/comment-feeds.ts b/server/core/controllers/feeds/comment-feeds.ts index 80d621e710..5d3dc0efc0 100644 --- a/server/core/controllers/feeds/comment-feeds.ts +++ b/server/core/controllers/feeds/comment-feeds.ts @@ -1,10 +1,10 @@ import { toSafeHtml } from '@server/helpers/markdown.js' -import { cacheRouteFactory } from '@server/middlewares/index.js' import express from 'express' import { CONFIG } from '../../initializers/config.js' import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../../initializers/constants.js' import { asyncMiddleware, + cacheRouteFactory, feedsAccountOrChannelFiltersValidator, feedsFormatValidator, setFeedFormatContentType, diff --git a/server/core/controllers/feeds/video-feeds.ts b/server/core/controllers/feeds/video-feeds.ts index 088b62c686..74f825aab3 100644 --- a/server/core/controllers/feeds/video-feeds.ts +++ b/server/core/controllers/feeds/video-feeds.ts @@ -2,7 +2,6 @@ import { Feed } from '@peertube/feed' import { buildDownloadFilesUrl } from '@peertube/peertube-core-utils' import { VideoInclude, VideoResolution } from '@peertube/peertube-models' import { getVideoFileMimeType } from '@server/lib/video-file.js' -import { cacheRouteFactory } from '@server/middlewares/index.js' import { VideoModel } from '@server/models/video/video.js' import express from 'express' import { extname } from 'path' @@ -10,6 +9,7 @@ import { buildNSFWFilters } from '../../helpers/express-utils.js' import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../../initializers/constants.js' import { asyncMiddleware, + cacheRouteFactory, commonVideosFiltersValidatorFactory, feedsAccountOrChannelFiltersValidator, feedsFormatValidator, diff --git a/server/core/helpers/core-utils.ts b/server/core/helpers/core-utils.ts index 832b26d204..6692c86cd3 100644 --- a/server/core/helpers/core-utils.ts +++ b/server/core/helpers/core-utils.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-useless-call */ +/* oxlint-disable no-useless-call */ /* Different from 'utils' because we don't import other PeerTube modules. diff --git a/server/core/helpers/hpagent.ts b/server/core/helpers/hpagent.ts index 28912194b9..b30c11b206 100644 --- a/server/core/helpers/hpagent.ts +++ b/server/core/helpers/hpagent.ts @@ -112,7 +112,8 @@ export class HttpsProxyAgent extends https.Agent { if (this.proxy.username || this.proxy.password) { const base64 = Buffer.from( `${decodeURIComponent(this.proxy.username || '')}:${decodeURIComponent(this.proxy.password || '')} - `).toString('base64') + ` + ).toString('base64') requestOptions.headers['proxy-authorization'] = `Basic ${base64}` } @@ -130,7 +131,7 @@ export class HttpsProxyAgent extends https.Agent { if (response.statusCode === 200) { try { // FIXME: typings doesn't include createConnection type in HTTP agent - // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // oxlint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error const secureSocket = super.createConnection({ ...options, socket }) callback(null, secureSocket) diff --git a/server/core/initializers/checker-after-init.ts b/server/core/initializers/checker-after-init.ts index 68e22be6f4..87d8faa403 100644 --- a/server/core/initializers/checker-after-init.ts +++ b/server/core/initializers/checker-after-init.ts @@ -364,7 +364,7 @@ function checkObjectStorageConfig () { } if (CONFIG.OBJECT_STORAGE.MAX_UPLOAD_PART > parseBytes('250MB')) { - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len logger.warn( `Object storage max upload part seems to have a big value (${CONFIG.OBJECT_STORAGE.MAX_UPLOAD_PART} bytes). ` + `Consider using a lower one (like 100MB).` diff --git a/server/core/initializers/migrations/0925-live-schedule-at.ts b/server/core/initializers/migrations/0925-live-schedule-at.ts index a76e134bf9..af77648005 100644 --- a/server/core/initializers/migrations/0925-live-schedule-at.ts +++ b/server/core/initializers/migrations/0925-live-schedule-at.ts @@ -8,7 +8,7 @@ async function up (utils: { const { transaction } = utils const query = - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len `CREATE TABLE IF NOT EXISTS "videoLiveSchedule" ("id" SERIAL , "startAt" TIMESTAMP WITH TIME ZONE NOT NULL, "liveVideoId" INTEGER REFERENCES "videoLive" ("id") ON DELETE CASCADE ON UPDATE CASCADE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));` await utils.sequelize.query(query, { transaction }) diff --git a/server/core/lib/activitypub/actors/get.ts b/server/core/lib/activitypub/actors/get.ts index 7aa2606e35..f554bdb611 100644 --- a/server/core/lib/activitypub/actors/get.ts +++ b/server/core/lib/activitypub/actors/get.ts @@ -95,7 +95,7 @@ async function getOrCreateAPOwner (actorObject: ActivityPubActor, actorId: strin } catch (err) { logger.error(`Cannot get or create account attributed to video channel ${actorId}`) - // eslint-disable-next-line preserve-caught-error + // oxlint-disable-next-line preserve-caught-error throw new Error(err) } } diff --git a/server/core/lib/activitypub/actors/webfinger.ts b/server/core/lib/activitypub/actors/webfinger.ts index ccb6a62eae..79b2214ff4 100644 --- a/server/core/lib/activitypub/actors/webfinger.ts +++ b/server/core/lib/activitypub/actors/webfinger.ts @@ -6,7 +6,7 @@ import { ActorModel } from '@server/models/actor/actor.js' import { MActorFull } from '@server/types/models/index.js' import WebFinger from 'webfinger.js' -// eslint-disable-next-line @typescript-eslint/no-deprecated +// oxlint-disable-next-line @typescript-eslint/no-deprecated const webfinger = new WebFinger({ tls_only: isProdInstance(), uri_fallback: false, diff --git a/server/core/lib/auth/oauth-model.ts b/server/core/lib/auth/oauth-model.ts index bf411df3f1..c088747f27 100644 --- a/server/core/lib/auth/oauth-model.ts +++ b/server/core/lib/auth/oauth-model.ts @@ -145,7 +145,7 @@ async function getUser (usernameOrEmail?: string, password?: string, options?: { } // If we don't find the user, or if the user belongs to a plugin - if (!user || user.pluginAuth !== null || !password) return null + if (user?.pluginAuth !== null || !password) return null const passwordMatch = await user.isPasswordMatch(password) if (passwordMatch !== true) return null diff --git a/server/core/lib/internal-event-emitter.ts b/server/core/lib/internal-event-emitter.ts index 567f6e6a7c..edb55e1587 100644 --- a/server/core/lib/internal-event-emitter.ts +++ b/server/core/lib/internal-event-emitter.ts @@ -13,7 +13,7 @@ export interface PeerTubeInternalEvents { 'chapters-updated': (options: { video: MVideoImmutable }) => void } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging declare interface InternalEventEmitter { on( event: U, @@ -26,7 +26,7 @@ declare interface InternalEventEmitter { ): boolean } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging class InternalEventEmitter extends EventEmitter { private static instance: InternalEventEmitter diff --git a/server/core/lib/live/shared/muxing-session.ts b/server/core/lib/live/shared/muxing-session.ts index c2e5798e45..3159cf780a 100644 --- a/server/core/lib/live/shared/muxing-session.ts +++ b/server/core/lib/live/shared/muxing-session.ts @@ -49,7 +49,7 @@ interface MuxingSessionEvents { 'after-cleanup': (options: { videoUUID: string }) => void } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging declare interface MuxingSession { on( event: U, @@ -62,7 +62,7 @@ declare interface MuxingSession { ): boolean } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging class MuxingSession extends EventEmitter implements MuxingSession { private transcodingWrapper: AbstractTranscodingWrapper diff --git a/server/core/lib/live/shared/transcoding-wrapper/abstract-transcoding-wrapper.ts b/server/core/lib/live/shared/transcoding-wrapper/abstract-transcoding-wrapper.ts index a0e4de62f5..6f0579cb84 100644 --- a/server/core/lib/live/shared/transcoding-wrapper/abstract-transcoding-wrapper.ts +++ b/server/core/lib/live/shared/transcoding-wrapper/abstract-transcoding-wrapper.ts @@ -10,7 +10,7 @@ interface TranscodingWrapperEvents { 'error': (options: { err: Error }) => void } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging declare interface AbstractTranscodingWrapper { on( event: U, @@ -51,7 +51,7 @@ interface AbstractTranscodingWrapperOptions { outDirectory: string } -// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +// oxlint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging abstract class AbstractTranscodingWrapper extends EventEmitter { protected readonly videoLive: MVideoLiveVideo @@ -110,7 +110,7 @@ abstract class AbstractTranscodingWrapper extends EventEmitter { abstract run (): Promise - abstract abort (error?: LiveVideoErrorType): void + abstract abort (abortError?: LiveVideoErrorType): void } export { diff --git a/server/core/lib/local-video-creator.ts b/server/core/lib/local-video-creator.ts index be10776e26..f21e9d0cbf 100644 --- a/server/core/lib/local-video-creator.ts +++ b/server/core/lib/local-video-creator.ts @@ -281,7 +281,7 @@ export class LocalVideoCreator { inputPath: this.options.thumbnail.path, video: this.video }).catch(err => { - // eslint-disable-next-line @typescript-eslint/only-throw-error + // oxlint-disable-next-line @typescript-eslint/only-throw-error throw PeerTubeError.fromError(err, 'INVALID_IMAGE_FILE') }) } diff --git a/server/core/lib/notifier/notifier.ts b/server/core/lib/notifier/notifier.ts index 83112e0c3b..edc99a162d 100644 --- a/server/core/lib/notifier/notifier.ts +++ b/server/core/lib/notifier/notifier.ts @@ -385,7 +385,7 @@ class Notifier { private async sendNotifications (models: (new(payload: T) => AbstractNotification)[], payload: T) { for (const model of models) { - // eslint-disable-next-line new-cap + // oxlint-disable-next-line new-cap await this.notify(new model(payload)) } } diff --git a/server/core/lib/object-storage/object-storage-helpers.ts b/server/core/lib/object-storage/object-storage-helpers.ts index ef77240806..62e46fab73 100644 --- a/server/core/lib/object-storage/object-storage-helpers.ts +++ b/server/core/lib/object-storage/object-storage-helpers.ts @@ -358,7 +358,7 @@ async function uploadToStorage (options: { { ...lTags(), responseMetadata: response.$metadata } ) } catch (err) { - // eslint-disable-next-line @typescript-eslint/only-throw-error + // oxlint-disable-next-line @typescript-eslint/only-throw-error throw parseS3Error(err) } } diff --git a/server/core/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts b/server/core/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts index d7f889803b..f160384b3c 100644 --- a/server/core/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts +++ b/server/core/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts @@ -178,7 +178,7 @@ export class NodeJSObserversBuilder { const data = {} - // eslint-disable-next-line @typescript-eslint/prefer-for-of + // oxlint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < resources.length; i++) { const resource = resources[i] diff --git a/server/core/lib/runners/job-handlers/abstract-vod-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/abstract-vod-transcoding-job-handler.ts index 20c0a62bb1..96374e6de3 100644 --- a/server/core/lib/runners/job-handlers/abstract-vod-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/abstract-vod-transcoding-job-handler.ts @@ -13,9 +13,10 @@ import { MRunnerJob } from '@server/types/models/runners/index.js' import { AbstractJobHandler } from './abstract-job-handler.js' import { loadRunnerVideo } from './shared/utils.js' -// eslint-disable-next-line max-len -export abstract class AbstractVODTranscodingJobHandler extends AbstractJobHandler { - +// oxlint-disable-next-line max-len +export abstract class AbstractVODTranscodingJobHandler + extends AbstractJobHandler +{ protected isAbortSupported () { return true } diff --git a/server/core/lib/runners/job-handlers/live-rtmp-hls-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/live-rtmp-hls-transcoding-job-handler.ts index a596c83a2c..5960ddcf56 100644 --- a/server/core/lib/runners/job-handlers/live-rtmp-hls-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/live-rtmp-hls-transcoding-job-handler.ts @@ -35,7 +35,7 @@ type CreateOptions = { outputDirectory: string } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export class LiveRTMPHLSTranscodingJobHandler extends AbstractJobHandler { diff --git a/server/core/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts index 027fde2a2a..985fccfde7 100644 --- a/server/core/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts @@ -32,7 +32,7 @@ type CreateOptions = { priority: number } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export class VideoStudioTranscodingJobHandler extends AbstractJobHandler { diff --git a/server/core/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts index 095d9e72db..5f07ee1380 100644 --- a/server/core/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts @@ -25,7 +25,7 @@ type CreateOptions = { dependsOnRunnerJob?: MRunnerJob } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export class VODAudioMergeTranscodingJobHandler extends AbstractVODTranscodingJobHandler { diff --git a/server/core/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts index 8cebf992e0..37b88cd6cc 100644 --- a/server/core/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts @@ -36,7 +36,7 @@ type CreateOptions = { dependsOnRunnerJob?: MRunnerJob } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export class VODHLSTranscodingJobHandler extends AbstractVODTranscodingJobHandler { diff --git a/server/core/lib/runners/job-handlers/vod-web-video-transcoding-job-handler.ts b/server/core/lib/runners/job-handlers/vod-web-video-transcoding-job-handler.ts index 881c31a065..6fe34dc8c4 100644 --- a/server/core/lib/runners/job-handlers/vod-web-video-transcoding-job-handler.ts +++ b/server/core/lib/runners/job-handlers/vod-web-video-transcoding-job-handler.ts @@ -25,7 +25,7 @@ type CreateOptions = { dependsOnRunnerJob?: MRunnerJob } -// eslint-disable-next-line max-len +// oxlint-disable-next-line max-len export class VODWebVideoTranscodingJobHandler extends AbstractVODTranscodingJobHandler { diff --git a/server/core/lib/uploadx.ts b/server/core/lib/uploadx.ts index f47461622d..a6cb1ecfbf 100644 --- a/server/core/lib/uploadx.ts +++ b/server/core/lib/uploadx.ts @@ -41,7 +41,7 @@ export function safeUploadXCleanup (file: FileQuery) { export function buildUploadXFile (reqBody: T) { return { - // eslint-disable-next-line @typescript-eslint/no-misused-spread + // oxlint-disable-next-line @typescript-eslint/no-misused-spread ...reqBody, path: getResumableUploadPath(reqBody.name), diff --git a/server/core/lib/user-import-export/exporters/videos-exporter.ts b/server/core/lib/user-import-export/exporters/videos-exporter.ts index 6347ceeef5..3ac8657645 100644 --- a/server/core/lib/user-import-export/exporters/videos-exporter.ts +++ b/server/core/lib/user-import-export/exporters/videos-exporter.ts @@ -43,6 +43,7 @@ import { PassThrough, Readable } from 'stream' import { AbstractUserExporter, ExportResult } from './abstract-user-exporter.js' export class VideosExporter extends AbstractUserExporter { + // oxlint-disable-next-line no-useless-constructor constructor ( private readonly options: ConstructorParameters>[0] & { withVideoFiles: boolean diff --git a/server/core/lib/user-import-export/importers/user-video-history-importer.ts b/server/core/lib/user-import-export/importers/user-video-history-importer.ts index 402330a287..3e1564f9c4 100644 --- a/server/core/lib/user-import-export/importers/user-video-history-importer.ts +++ b/server/core/lib/user-import-export/importers/user-video-history-importer.ts @@ -7,9 +7,10 @@ import { AbstractUserImporter } from './abstract-user-importer.js' type SanitizedObject = Pick -// eslint-disable-next-line max-len -export class UserVideoHistoryImporter extends AbstractUserImporter { - +// oxlint-disable-next-line max-len +export class UserVideoHistoryImporter + extends AbstractUserImporter +{ protected getImportObjects (json: UserVideoHistoryExportJSON) { return json.watchedVideos } diff --git a/server/core/lib/user-import-export/importers/watched-words-lists-importer.ts b/server/core/lib/user-import-export/importers/watched-words-lists-importer.ts index 3bd457035c..f9d4c68347 100644 --- a/server/core/lib/user-import-export/importers/watched-words-lists-importer.ts +++ b/server/core/lib/user-import-export/importers/watched-words-lists-importer.ts @@ -6,9 +6,10 @@ import { AbstractUserImporter } from './abstract-user-importer.js' type SanitizedObject = Pick -// eslint-disable-next-line max-len -export class WatchedWordsListsImporter extends AbstractUserImporter { - +// oxlint-disable-next-line max-len +export class WatchedWordsListsImporter + extends AbstractUserImporter +{ protected getImportObjects (json: WatchedWordsListsJSON) { return json.watchedWordLists } diff --git a/server/core/lib/video-captions.ts b/server/core/lib/video-captions.ts index 024a9bd038..9e6ddeb82f 100644 --- a/server/core/lib/video-captions.ts +++ b/server/core/lib/video-captions.ts @@ -239,7 +239,7 @@ export async function onTranscriptionEnded (options: { const existing = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language) if (existing && !existing.automaticallyGenerated) { logger.info( - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len `Do not replace existing caption for video ${video.uuid} after transcription (subtitle may have been added while during the transcription process)`, lTags(video.uuid) ) diff --git a/server/core/lib/webtorrent.ts b/server/core/lib/webtorrent.ts index c094f39874..bd7c35bcd1 100644 --- a/server/core/lib/webtorrent.ts +++ b/server/core/lib/webtorrent.ts @@ -30,7 +30,7 @@ export async function downloadWebTorrentVideo (target: { uri: string, torrentNam const directoryPath = join(CONFIG.STORAGE.TMP_DIR, 'webtorrent') await ensureDir(directoryPath) - // eslint-disable-next-line new-cap + // oxlint-disable-next-line new-cap const webtorrent = new (await import('webtorrent')).default({ natUpnp: false, natPmp: false, diff --git a/server/core/middlewares/validators/videos/videos.ts b/server/core/middlewares/validators/videos/videos.ts index 03268dc00c..640cde4122 100644 --- a/server/core/middlewares/validators/videos/videos.ts +++ b/server/core/middlewares/validators/videos/videos.ts @@ -590,7 +590,7 @@ export const commonVideosFiltersValidatorFactory = (options: { const user = res.locals.oauth?.token.User - if ((!user || user.hasRight(UserRight.SEE_ALL_VIDEOS) !== true)) { + if ((user?.hasRight(UserRight.SEE_ALL_VIDEOS) !== true)) { if (query.include || (options.allowPrivacyFilterForAllUsers !== true && query.privacyOneOf) || query.autoTagOneOf) { return res.fail({ status: HttpStatusCode.UNAUTHORIZED_401, diff --git a/server/core/models/actor/sql/instance-list-followers-query-builder.ts b/server/core/models/actor/sql/instance-list-followers-query-builder.ts index f116302436..b3773c80d0 100644 --- a/server/core/models/actor/sql/instance-list-followers-query-builder.ts +++ b/server/core/models/actor/sql/instance-list-followers-query-builder.ts @@ -1,6 +1,5 @@ import { ActivityPubActorType, FollowState } from '@peertube/peertube-models' import { AbstractListQueryOptions } from '@server/models/shared/abstract-list-query.js' -import { Sequelize } from 'sequelize' import { InstanceListFollowsQueryBuilder } from './shared/instance-list-follows-query-builder.js' export interface ListFollowersOptions extends AbstractListQueryOptions { @@ -11,13 +10,6 @@ export interface ListFollowersOptions extends AbstractListQueryOptions { } export class InstanceListFollowersQueryBuilder extends InstanceListFollowsQueryBuilder { - constructor ( - protected readonly sequelize: Sequelize, - protected readonly options: ListFollowersOptions - ) { - super(sequelize, options) - } - protected buildSubQueryWhere () { this.buildActorFollowingJoin() diff --git a/server/core/models/actor/sql/instance-list-following-query-builder.ts b/server/core/models/actor/sql/instance-list-following-query-builder.ts index f49d65f24d..647b9b88c8 100644 --- a/server/core/models/actor/sql/instance-list-following-query-builder.ts +++ b/server/core/models/actor/sql/instance-list-following-query-builder.ts @@ -1,6 +1,5 @@ import { ActivityPubActorType, FollowState } from '@peertube/peertube-models' import { AbstractListQueryOptions } from '@server/models/shared/abstract-list-query.js' -import { Sequelize } from 'sequelize' import { InstanceListFollowsQueryBuilder } from './shared/instance-list-follows-query-builder.js' export interface ListFollowingOptions extends AbstractListQueryOptions { @@ -11,13 +10,6 @@ export interface ListFollowingOptions extends AbstractListQueryOptions { } export class InstanceListFollowingQueryBuilder extends InstanceListFollowsQueryBuilder { - constructor ( - protected readonly sequelize: Sequelize, - protected readonly options: ListFollowingOptions - ) { - super(sequelize, options) - } - protected buildSubQueryWhere () { this.buildActorFollowingJoin() diff --git a/server/core/models/runner/runner-job.ts b/server/core/models/runner/runner-job.ts index ac5975b580..1076cde935 100644 --- a/server/core/models/runner/runner-job.ts +++ b/server/core/models/runner/runner-job.ts @@ -320,7 +320,7 @@ export class RunnerJobModel extends SequelizeModel { } setToErrorOrCancel ( - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len state: | typeof RunnerJobState.PARENT_ERRORED | typeof RunnerJobState.ERRORED diff --git a/server/core/models/server/plugin.ts b/server/core/models/server/plugin.ts index 1844f6a6e0..08d5d07a25 100644 --- a/server/core/models/server/plugin.ts +++ b/server/core/models/server/plugin.ts @@ -132,7 +132,7 @@ export class PluginModel extends SequelizeModel { .then(p => { if (p?.settings?.[settingName] === undefined) { const registered = registeredSettings.find(s => s.name === settingName) - if (!registered || registered.default === undefined) return undefined + if (registered?.default === undefined) return undefined return registered.default } diff --git a/server/core/models/stat/local-video-viewer.ts b/server/core/models/stat/local-video-viewer.ts index 6f8a751455..1b8a57f038 100644 --- a/server/core/models/stat/local-video-viewer.ts +++ b/server/core/models/stat/local-video-viewer.ts @@ -188,7 +188,7 @@ export class LocalVideoViewerModel extends SequelizeModel // Add viewers that were already here, before our start date const beforeWatchersQuery = startDate - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len ? `SELECT COUNT(*) AS "total" FROM "localVideoViewer" WHERE "localVideoViewer"."startDate" < :startDate AND "localVideoViewer"."endDate" >= :startDate` : `SELECT 0 AS "total"` diff --git a/server/core/models/user/sql/user-notification/user-notification-list-query-builder.ts b/server/core/models/user/sql/user-notification/user-notification-list-query-builder.ts index b0a169f7a5..6c78578a7b 100644 --- a/server/core/models/user/sql/user-notification/user-notification-list-query-builder.ts +++ b/server/core/models/user/sql/user-notification/user-notification-list-query-builder.ts @@ -247,7 +247,7 @@ export class UserNotificationListQueryBuilder extends AbstractListQuery { } private getChannelJoin (tableName: string, columnJoin: string, aliasTableName = 'VideoChannel') { - // eslint-disable-next-line max-len + // oxlint-disable-next-line max-len return `INNER JOIN "videoChannel" AS "${tableName}->${aliasTableName}" ON "${tableName}"."${columnJoin}" = "${tableName}->${aliasTableName}".id ` + this.getActorJoin(`${tableName}->${aliasTableName}`, 'videoChannelId') } diff --git a/server/core/models/video/sql/video/videos-id-list-query-builder.ts b/server/core/models/video/sql/video/videos-id-list-query-builder.ts index a30f9ca669..67aba70724 100644 --- a/server/core/models/video/sql/video/videos-id-list-query-builder.ts +++ b/server/core/models/video/sql/video/videos-id-list-query-builder.ts @@ -11,7 +11,7 @@ import { exists } from '@server/helpers/custom-validators/misc.js' import { WEBSERVER } from '@server/initializers/constants.js' import { buildSortDirectionAndField } from '@server/models/shared/index.js' import { MUserAccountId, MUserId } from '@server/types/models/index.js' -import { Sequelize, Transaction } from 'sequelize' +import { Transaction } from 'sequelize' import validator from 'validator' import { AbstractRunQuery } from '../../../shared/abstract-run-query.js' import { createSafeIn, parseRowCountResult } from '../../../shared/index.js' @@ -125,10 +125,6 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery { private builtChannelJoin = false - constructor (protected readonly sequelize: Sequelize) { - super(sequelize) - } - queryVideoIds (options: BuildVideosListQueryOptions) { this.buildIdsListQuery(options) diff --git a/server/core/models/video/video-channel-activity.ts b/server/core/models/video/video-channel-activity.ts index e4a5793d59..0d3308288c 100644 --- a/server/core/models/video/video-channel-activity.ts +++ b/server/core/models/video/video-channel-activity.ts @@ -509,7 +509,7 @@ export class VideoChannelActivityModel extends SequelizeModel { }, onDelete: 'cascade', hooks: true, + // oxlint-disable-next-line no-useless-computed-key ['separate' as any]: true }) declare VideoCaptions: Awaited[] diff --git a/server/core/types/lib.d.ts b/server/core/types/lib.d.ts index 9f1a111205..e4bff6a689 100644 --- a/server/core/types/lib.d.ts +++ b/server/core/types/lib.d.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ +/* oxlint-disable @typescript-eslint/no-redundant-type-constituents */ type ObjectKeys = T extends object ? `${Exclude}`[] : T extends number ? [] : diff --git a/server/core/types/models/user/user-notification.ts b/server/core/types/models/user/user-notification.ts index 926e543884..cdf19af260 100644 --- a/server/core/types/models/user/user-notification.ts +++ b/server/core/types/models/user/user-notification.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/prefer-namespace-keyword */ +/* oxlint-disable @typescript-eslint/prefer-namespace-keyword */ import { PickWith, PickWithOpt } from '@peertube/peertube-typescript-utils' import { VideoAbuseModel } from '@server/models/abuse/video-abuse.js' diff --git a/server/core/types/models/video/index.ts b/server/core/types/models/video/index.ts index bd44af21b7..53fc3199a3 100644 --- a/server/core/types/models/video/index.ts +++ b/server/core/types/models/video/index.ts @@ -1,5 +1,4 @@ export * from './local-video-viewer-watch-section.js' -export * from './local-video-viewer-watch-section.js' export * from './local-video-viewer.js' export * from './storyboard.js' export * from './schedule-video-update.js' diff --git a/server/scripts/migrations/peertube-4.0.ts b/server/scripts/migrations/peertube-4.0.ts index 34b5449f69..515ae94f02 100644 --- a/server/scripts/migrations/peertube-4.0.ts +++ b/server/scripts/migrations/peertube-4.0.ts @@ -45,7 +45,7 @@ async function processVideo (videoId: number) { const video = await VideoModel.loadWithFiles(videoId) const hls = video.getHLSPlaylist() - if (video.isLive || !hls || hls.playlistFilename !== 'master.m3u8' || hls.VideoFiles.length === 0) { + if (video.isLive || hls?.playlistFilename !== 'master.m3u8' || hls.VideoFiles.length === 0) { return }