oxlint migration for server

This commit is contained in:
Chocobozzz
2026-03-26 15:15:36 +01:00
parent 8059eec02e
commit 9e562b9437
342 changed files with 1727 additions and 868 deletions
-3
View File
@@ -59,8 +59,5 @@ node_modules
# TypeScript
*.tsbuildinfo
# EsLint
.eslintcache
# Compiled output
dist
+807
View File
@@ -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"
]
}
]
}
+7 -8
View File
@@ -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
-1
View File
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo"
-1
View File
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"rootDir": "src",
"tsBuildInfoFile": "./dist/.tsbuildinfo"
-178
View File
@@ -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'
}
}
])
+4 -3
View File
@@ -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",
+14 -10
View File
@@ -1,4 +1,4 @@
export function isPromise <T = unknown> (value: T | Promise<T>): value is Promise<T> {
export function isPromise<T = unknown> (value: T | Promise<T>): value is Promise<T> {
return value && typeof (value as Promise<T>).then === 'function'
}
@@ -6,7 +6,7 @@ export function isCatchable (value: any) {
return value && typeof value.catch === 'function'
}
export function timeoutPromise <T> (promise: Promise<T>, timeoutMs: number) {
export function timeoutPromise<T> (promise: Promise<T>, timeoutMs: number) {
let timer: ReturnType<typeof setTimeout>
return Promise.race([
@@ -21,7 +21,7 @@ export function timeoutPromise <T> (promise: Promise<T>, timeoutMs: number) {
export function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {
return function promisified (): Promise<A> {
return new Promise<A>((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<A> (func: (cb: (err: any, result: A) => void) => void
export function promisify1<T, A> (func: (arg: T, cb: (err: any, result: A) => void) => void): (arg: T) => Promise<A> {
return function promisified (arg: T): Promise<A> {
return new Promise<A>((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<T, U, A> (func: (arg1: T, arg2: U, cb: (err: any, result: A) => void) => void): (arg1: T, arg2: U) => Promise<A> {
// oxlint-disable-next-line max-len
export function promisify2<T, U, A> (
func: (arg1: T, arg2: U, cb: (err: any, result: A) => void) => void
): (arg1: T, arg2: U) => Promise<A> {
return function promisified (arg1: T, arg2: U): Promise<A> {
return new Promise<A>((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<T, U, V, A> (func: (arg1: T, arg2: U, arg3: V, cb: (err: any, result: A) => void) => void): (arg1: T, arg2: U, arg3: V) => Promise<A> {
// oxlint-disable-next-line max-len
export function promisify3<T, U, V, A> (
func: (arg1: T, arg2: U, arg3: V, cb: (err: any, result: A) => void) => void
): (arg1: T, arg2: U, arg3: V) => Promise<A> {
return function promisified (arg1: T, arg2: U, arg3: V): Promise<A> {
return new Promise<A>((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) ])
})
}
@@ -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
}
@@ -39,7 +39,7 @@ export interface RunnerJob<T extends RunnerJobPayload = RunnerJobPayload> {
}
}
// eslint-disable-next-line max-len
// oxlint-disable-next-line max-len
export interface RunnerJobAdmin<T extends RunnerJobPayload = RunnerJobPayload, U extends RunnerJobPrivatePayload = RunnerJobPrivatePayload>
extends RunnerJob<T>
{
+3 -3
View File
@@ -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()
}
@@ -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'
@@ -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<PeerTubePlugin>({
@@ -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<RegisteredServerSettings>({
@@ -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
@@ -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())
}
@@ -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))
@@ -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 <T> (options: ListBlocklistOptions, path: string) {
private listBlocklist<T> (options: ListBlocklistOptions, path: string) {
const { start, count, search, sort = '-createdAt' } = options
return this.getRequestBody<ResultList<T>>({
@@ -161,5 +170,4 @@ export class BlocklistCommand extends AbstractCommand {
defaultExpectedStatus: HttpStatusCode.OK_200
})
}
}
@@ -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'
@@ -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'
@@ -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
@@ -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 {
@@ -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'
@@ -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,
@@ -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'
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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'
@@ -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'
@@ -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)
@@ -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'
@@ -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'
@@ -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'
@@ -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 })
})
@@ -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'
+1 -1
View File
@@ -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 {
@@ -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 {
@@ -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'
@@ -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'
@@ -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'
@@ -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 {
@@ -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,
+1 -2
View File
@@ -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,
@@ -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'
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -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 {
+1 -2
View File
@@ -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,
@@ -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'
@@ -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 {
@@ -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'
@@ -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'
@@ -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,
@@ -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'
@@ -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,
@@ -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'
@@ -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 {
@@ -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 {
@@ -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,
@@ -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'
@@ -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 })
@@ -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 () {
@@ -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'
@@ -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'
@@ -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,
@@ -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'
@@ -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,
@@ -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 {
@@ -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'
@@ -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'
@@ -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 {
@@ -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 {
@@ -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'
@@ -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'
@@ -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,
@@ -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'
@@ -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 {
@@ -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'
@@ -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 {
@@ -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'
@@ -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 })
@@ -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 })
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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,
@@ -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'
@@ -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'
@@ -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'
@@ -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 {
+1 -1
View File
@@ -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'
@@ -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 {
@@ -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<LiveVideoCreate> = {}) {
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)
}
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -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'
@@ -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 () {
@@ -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)
@@ -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'
@@ -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,
@@ -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'
@@ -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,
@@ -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'
@@ -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'
@@ -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'

Some files were not shown because too many files have changed in this diff Show More