1 Commits

Author SHA1 Message Date
Simon Ser 488e11eddc eslint: add extra rules 2024-11-16 12:59:42 +01:00
8 changed files with 1290 additions and 955 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
A simple IRC web client. A simple IRC web client.
<img src="https://codeberg.org/attachments/117ff232-7e73-46c7-a21d-2b59ffa3765a" alt="Screenshot" width="800"> ![screenshot](https://l.sr.ht/7Npm.png)
## Usage ## Usage
-2
View File
@@ -323,8 +323,6 @@ export default class App extends Component {
} }
if (queryParams.debug === "1") { if (queryParams.debug === "1") {
this.debug = true; this.debug = true;
} else if (queryParams.debug === "0") {
this.debug = false;
} }
if (window.location.hash) { if (window.location.hash) {
+1 -7
View File
@@ -43,7 +43,7 @@ function _Timestamp({ date, url, showSeconds }) {
if (showSeconds) { if (showSeconds) {
timestamp += ":--"; timestamp += ":--";
} }
return html`<span class="timestamp">${timestamp}</span>`; return html`<spam class="timestamp">${timestamp}</span>`;
} }
let hh = date.getHours().toString().padStart(2, "0"); let hh = date.getHours().toString().padStart(2, "0");
@@ -274,15 +274,9 @@ class LogLine extends Component {
break; break;
case "TOPIC": case "TOPIC":
let topic = msg.params[1]; let topic = msg.params[1];
if (topic) {
content = html` content = html`
${createNick(msg.prefix.name)} changed the topic to: ${linkify(stripANSI(topic), onChannelClick)} ${createNick(msg.prefix.name)} changed the topic to: ${linkify(stripANSI(topic), onChannelClick)}
`; `;
} else {
content = html`
${createNick(msg.prefix.name)} cleared the topic
`;
}
break; break;
case "INVITE": case "INVITE":
invitee = msg.params[0]; invitee = msg.params[0];
+1 -2
View File
@@ -63,8 +63,7 @@ if (remoteHost) {
ws.close(); ws.close();
}); });
client.on("error", (err) => { client.on("error", () => {
console.log(err);
ws.close(WS_BAD_GATEWAY); ws.close(WS_BAD_GATEWAY);
}); });
}); });
+1 -1
View File
@@ -7,7 +7,7 @@ gamja settings can be overridden using URL query parameters:
replaced with a randomly generated value) replaced with a randomly generated value)
- `channels`: comma-separated list of channels to join (`#` needs to be escaped) - `channels`: comma-separated list of channels to join (`#` needs to be escaped)
- `open`: [IRC URL] to open - `open`: [IRC URL] to open
- `debug`: enable debug logs if set to `1`, disable debug logs if set to `0` - `debug`: if set to 1, debug mode is enabled
Alternatively, the channels can be set with the URL fragment (ie, by just Alternatively, the channels can be set with the URL fragment (ie, by just
appending the channel name to the gamja URL). appending the channel name to the gamja URL).
+3 -10
View File
@@ -23,21 +23,14 @@ export default [
destructuredArrayIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_",
}], }],
"no-var": "error", "no-var": "error",
"no-eval": "error",
"no-implied-eval": "error",
"eqeqeq": "error", "eqeqeq": "error",
"no-invalid-this": "error", "no-invalid-this": "error",
"no-extend-native": "error",
"prefer-arrow-callback": "error", "prefer-arrow-callback": "error",
"no-implicit-globals": "error", "require-atomic-updates": "error",
"no-throw-literal": "error",
"no-implicit-coercion": "warn", "no-implicit-coercion": "warn",
"object-shorthand": "warn", "object-shorthand": "warn",
"curly": "warn", //"sort-imports": ["warn", { ignoreMemberSort: true, allowSeparatedGroups: true }],
"no-restricted-syntax": ["warn", { //"func-style": ["warn", "declaration"],
selector: "BlockStatement VariableDeclaration[kind='const']",
message: "NOPE",
}],
"@stylistic/js/indent": ["warn", "tab"], "@stylistic/js/indent": ["warn", "tab"],
"@stylistic/js/quotes": ["warn", "double"], "@stylistic/js/quotes": ["warn", "double"],
"@stylistic/js/semi": "warn", "@stylistic/js/semi": "warn",
+1279 -928
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"htm": "^3.0.4", "htm": "^3.0.4",
"linkifyjs": "^4.1.3", "linkifyjs": "^4.1.3",
"preact": "^10.17.1" "preact": "10.17.1"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.11.1", "@eslint/js": "^9.11.1",