Final eslint 8.57 adjustements.

There are still some FIXME, but should be enought for now.
This commit is contained in:
John Livingston 2024-09-09 20:37:45 +02:00
parent fd27105c2c
commit edca1be70a
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
10 changed files with 14 additions and 154 deletions

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
SPDX-License-Identifier: AGPL-3.0-only

View File

@ -1,41 +0,0 @@
{
"root": true,
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint-config-love",
"plugin:lit/recommended"
],
"globals": {},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"project": [
"./client/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": [],
"rules": {
"@typescript-eslint/no-unused-vars": [2, {"argsIgnorePattern": "^_"}],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/return-await": [2, "in-try-catch"], // FIXME: correct?
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/triple-slash-reference": "off",
"max-len": [
"error",
{
"code": 120,
"comments": 120
}
],
"no-unused-vars": "off"
}
}

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
SPDX-License-Identifier: AGPL-3.0-only

View File

@ -1,40 +0,0 @@
{
"root": true,
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint-config-love"
],
"globals": {},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"project": [
"./conversejs/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": [],
"rules": {
"@typescript-eslint/no-unused-vars": [2, {"argsIgnorePattern": "^_"}],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/return-await": [2, "in-try-catch"], // FIXME: correct?
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/triple-slash-reference": "off",
"max-len": [
"error",
{
"code": 120,
"comments": 120
}
],
"no-unused-vars": "off"
}
}

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
SPDX-License-Identifier: AGPL-3.0-only

View File

@ -2,12 +2,6 @@
//
// SPDX-License-Identifier: AGPL-3.0-only
// FIXME:
// * lint shared
// * lint conversejs
// * use eslint-plugin-lit
// * delete old .eslintrc.json files
import love from 'eslint-config-love'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
@ -23,9 +17,7 @@ export default tseslint.config(
'build/',
'vendor/',
'support/documentation', 'support',
'build-*js',
'shared' // FIXME
'build-*js'
]
},
eslint.configs.recommended,
@ -132,7 +124,10 @@ export default tseslint.config(
}
},
{
files: ['server/**/*.js', 'server/**/*.ts'], // only ts?
files: [
'server/**/*.js', 'server/**/*.ts'
// 'shared/**/*.js', 'shared/**/*.ts' // we also inlcude shared files here.
],
languageOptions: {
ecmaVersion: 6,
globals: {
@ -157,13 +152,15 @@ export default tseslint.config(
parserOptions: {
ecmaVersion: 2018,
project: [
'./server/tsconfig.json',
'./client/tsconfig.json'
'./server/tsconfig.json'
// './client/tsconfig.json' // FIXME: dont really know what is necessary here.
],
projectService: {
allowDefaultProject: 'shared/**/*.ts',
defaultProject: './server/tsconfig.json'
}
// FIXME: how to make projectService work?
projectService: false
// projectService: {
// allowDefaultProject: ['shared/lib/*.js', 'shared/lib/*.ts'],
// defaultProject: './server/tsconfig.json'
// }
}
}
},

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
SPDX-License-Identifier: AGPL-3.0-only

View File

@ -1,41 +0,0 @@
{
"root": true,
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint-config-love"
],
"globals": {},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"project": [
"./server/tsconfig.json",
"./client/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": [],
"rules": {
"@typescript-eslint/no-unused-vars": [2, {"argsIgnorePattern": "^_"}],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/return-await": [2, "in-try-catch"], // FIXME: correct?
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/triple-slash-reference": "off",
"max-len": [
"error",
{
"code": 120,
"comments": 120
}
],
"no-unused-vars": "off"
}
}

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
SPDX-License-Identifier: AGPL-3.0-only

View File

@ -44,7 +44,7 @@ function videoHasWebchat (settings: VideoHasWebchatSettings, video: SharedVideo)
if (video.remote) return false
}
if (settings['chat-per-live-video'] && video.isLive && video.pluginData && video.pluginData['livechat-active']) {
if (settings['chat-per-live-video'] && video.isLive && video.pluginData?.['livechat-active']) {
return true
}