mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-19 14:46:36 +02:00
linting
This commit is contained in:
parent
cff9209a25
commit
21b52a99a0
|
@ -53,6 +53,7 @@ export default defineComponent({
|
|||
|
||||
const hover = () => {
|
||||
if (props.onHover) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return props.onHover(props.user as UserInMessage);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ import socket from "../socket";
|
|||
import {store} from "../store";
|
||||
|
||||
function input() {
|
||||
const messageIds = [];
|
||||
const messageIds: number[] = [];
|
||||
|
||||
for (const message of store.state.activeChannel?.channel.messages) {
|
||||
for (const message of store.state.activeChannel.channel.messages) {
|
||||
let toggled = false;
|
||||
|
||||
for (const preview of message.previews) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const matchFormatting =
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
|
||||
|
||||
export default (message: string) => message.replace(matchFormatting, "").trim();
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import LinkifyIt, {Match} from "linkify-it";
|
||||
import {Part} from "./merge";
|
||||
|
||||
export type LinkPart = Part & {
|
||||
link: string;
|
||||
};
|
||||
|
||||
type OurMatch = Match & {
|
||||
noschema?: boolean;
|
||||
};
|
||||
|
@ -78,8 +82,4 @@ function returnUrl(url: OurMatch): LinkPart {
|
|||
};
|
||||
}
|
||||
|
||||
export type LinkPart = Part & {
|
||||
link: string;
|
||||
};
|
||||
|
||||
export {findLinks, findLinksWithSchema};
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import socket from "../socket";
|
||||
import {store} from "../store";
|
||||
|
||||
socket.on("setting:new", function (data) {
|
||||
socket.on("setting:new", async function (data) {
|
||||
const name = data.name;
|
||||
const value = data.value;
|
||||
store.dispatch("settings/update", {name, value, sync: false});
|
||||
await store.dispatch("settings/update", {name, value, sync: false});
|
||||
});
|
||||
|
||||
socket.on("setting:all", function (settings) {
|
||||
socket.on("setting:all", async function (settings) {
|
||||
const serverHasSettings = Object.keys(settings).length > 0;
|
||||
|
||||
store.commit("serverHasSettings", serverHasSettings);
|
||||
|
||||
if (serverHasSettings) {
|
||||
for (const name in settings) {
|
||||
store.dispatch("settings/update", {name, value: settings[name], sync: false});
|
||||
await store.dispatch("settings/update", {name, value: settings[name], sync: false});
|
||||
}
|
||||
} else {
|
||||
store.dispatch("settings/syncAll");
|
||||
await store.dispatch("settings/syncAll");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -15,7 +15,9 @@ program
|
|||
.action(function (options) {
|
||||
initalizeConfig();
|
||||
|
||||
const server = require("../server");
|
||||
const newLocal = "../server";
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const server = require(newLocal);
|
||||
server.default(options);
|
||||
});
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ program
|
|||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const ClientManager = require("../../clientManager");
|
||||
const manager = new ClientManager();
|
||||
const users = manager.getUsers();
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import filenamify from "filenamify";
|
||||
|
@ -162,7 +163,7 @@ class TextFileMessageStorage implements MessageStorage {
|
|||
|
||||
export default TextFileMessageStorage;
|
||||
|
||||
function cleanFilename(name) {
|
||||
function cleanFilename(name: string) {
|
||||
name = filenamify(name, {replacement: "_"});
|
||||
name = name.toLowerCase();
|
||||
|
||||
|
|
2
src/types/modules/irc-framework.d.ts
vendored
2
src/types/modules/irc-framework.d.ts
vendored
|
@ -1,4 +1,6 @@
|
|||
// @ts-nocheck
|
||||
// @eslint-disable
|
||||
|
||||
// https://raw.githubusercontent.com/eternagame/HTML-Chat/vue-rewrite/src/app/types/modules/irc-framework/irc-framework.d.ts
|
||||
// TODO: Fix this
|
||||
declare module "irc-framework" {
|
||||
|
|
4
src/types/socket-events.d.ts
vendored
4
src/types/socket-events.d.ts
vendored
|
@ -36,6 +36,10 @@ interface ServerToClientEvents {
|
|||
|
||||
"mentions:list": (data: Mention[]) => void;
|
||||
|
||||
"setting:new": ({name: string, value: any}) => void;
|
||||
|
||||
"setting:all": (settings: {[key: string]: any}) => void;
|
||||
|
||||
more: ({
|
||||
chan,
|
||||
messages,
|
||||
|
|
2
test/fixtures/.thelounge/sts-policies.json
vendored
2
test/fixtures/.thelounge/sts-policies.json
vendored
|
@ -3,6 +3,6 @@
|
|||
"host": "irc.example.com",
|
||||
"port": 7000,
|
||||
"duration": 3600,
|
||||
"expires": 1654029411770
|
||||
"expires": 1654030206992
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue