eslint 8.57 WIP:

* tweaking rules
* fixing issues
This commit is contained in:
John Livingston
2024-09-09 18:47:21 +02:00
parent 7b3d93b290
commit c010758164
42 changed files with 361 additions and 178 deletions

View File

@ -13,7 +13,7 @@ let singleton: BotConfiguration | undefined
type RoomConfCache =
null // already loaded, but file does not exist
| RoomConf // loaded, and contains the room conf
| RoomConf // loaded, and contains the room conf
type ChannelCommonRoomConf = Omit<RoomConf, 'local' | 'domain'>

View File

@ -187,8 +187,8 @@ function _getForbiddenWordsHandler (
} else {
// Here we must add word-breaks and escape entries.
// We join all entries in one Regexp (for the same reason as above).
rule.regexp = '(?:' +
forbiddenWords.entries.map(s => {
rule.regexp = '(?:' + forbiddenWords.entries.map(
s => {
s = _stringToWordRegexp(s)
// Must add the \b...
// ... but... won't work if the first (or last) char is an emoji.
@ -201,7 +201,8 @@ function _getForbiddenWordsHandler (
}
// FIXME: this solution wont work for non-latin charsets.
return s
}).join(')|(?:') + ')'
}
).join(')|(?:') + ')'
}
if (forbiddenWords.reason) {

View File

@ -234,14 +234,14 @@ async function _connectionInfos (
params: GetConverseJSParamsParams,
roomInfos: RoomInfos
): Promise<{
prosodyDomain: string
localAnonymousJID: string
localBoshUri: string
localWsUri: string | null
remoteConnectionInfos: WCRemoteConnectionInfos | undefined
roomJID: string
customEmojisUrl?: string
} | InitConverseJSParamsError> {
prosodyDomain: string
localAnonymousJID: string
localBoshUri: string
localWsUri: string | null
remoteConnectionInfos: WCRemoteConnectionInfos | undefined
roomJID: string
customEmojisUrl?: string
} | InitConverseJSParamsError> {
const { video, remoteChatInfos, channelId, roomKey } = roomInfos
const prosodyDomain = await getProsodyDomain(options)

View File

@ -27,11 +27,11 @@ interface DebugContent {
}
type DebugNumericValue = 'renewCertCheckInterval'
| 'renewSelfSignedCertInterval'
| 'logRotateEvery'
| 'logRotateCheckInterval'
| 'remoteServerInfosMaxAge'
| 'externalAccountPruneInterval'
| 'renewSelfSignedCertInterval'
| 'logRotateEvery'
| 'logRotateCheckInterval'
| 'remoteServerInfosMaxAge'
| 'externalAccountPruneInterval'
type DebugBooleanValue = 'alwaysPublishXMPPRoom' | 'enablePodcastChatTagForNonLive' | 'useOpenSSL'

View File

@ -48,7 +48,8 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
if (process.arch !== 'x64' && process.arch !== 'x86_64' && process.arch !== 'arm64') {
result.messages.push({
level: 'error',
message: 'Error: your CPU is a ' +
message:
'Error: your CPU is a ' +
process.arch + ', ' +
'which is not compatible with the plugin. ' +
'Please read the plugin installation documentation for a workaround.'

View File

@ -3,8 +3,8 @@
// SPDX-License-Identifier: AGPL-3.0-only
type NextValue = 'backend' | 'debug' | 'webchat-video' | 'prosody'
| 'external-auth-custom-oidc' | 'external-auth-google-oidc' | 'external-auth-facebook-oidc'
| 'everything-ok'
| 'external-auth-custom-oidc' | 'external-auth-google-oidc' | 'external-auth-facebook-oidc'
| 'everything-ok'
interface MessageWithLevel {
level: 'info' | 'warning' | 'error'

View File

@ -78,12 +78,13 @@ export class Emojis {
if (!await this.channelHasCustomEmojis(channelId)) {
return undefined
}
const route = getBaseRouterRoute(this.options) +
'emojis/channel/' +
encodeURIComponent(channelId) +
'/definition'
return canonicalizePluginUri(
this.options,
getBaseRouterRoute(this.options) +
'emojis/channel/' +
encodeURIComponent(channelId) +
'/definition',
route,
{
removePluginVersion: true
}

View File

@ -289,7 +289,7 @@ function _sanitizePeertubeLiveChatInfosV0 (
logger.debug('We are have to migrate data from the old JSONLD format')
if (chatInfos === false) { return false }
if (!_assertObjectType(chatInfos)) { return false}
if (!_assertObjectType(chatInfos)) { return false }
if (chatInfos.type !== 'xmpp') { return false }
if (typeof chatInfos.jid !== 'string') { return false }

View File

@ -529,7 +529,7 @@ function initThemingSettings ({ registerSetting }: RegisterServerOptions): void
{ value: 'peertube', label: loc('converse_theme_option_peertube') },
{ value: 'default', label: loc('converse_theme_option_default') },
{ value: 'cyberpunk', label: loc('converse_theme_option_cyberpunk') }
] as Array<{value: ConverseJSTheme, label: string}>,
] as Array<{ value: ConverseJSTheme, label: string }>,
descriptionHTML: loc('converse_theme_description')
})