code cleanup (MisskeyIO#825)

This commit is contained in:
あわわわとーにゅ 2024-11-27 05:48:25 +09:00 committed by GitHub
parent 029d6da7c8
commit e7afbd140a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 24 additions and 25 deletions

View file

@ -273,7 +273,9 @@ export class FileInfoService {
watcher.close(); watcher.close();
}); });
command.run(); command.run();
for (let i = 1; true; i++) { // eslint-disable-line @typescript-eslint/no-unnecessary-condition let i = 0;
while (true) {
i++;
const current = `${i}.png`; const current = `${i}.png`;
const next = `${i + 1}.png`; const next = `${i + 1}.png`;
const framePath = join(cwd, current); const framePath = join(cwd, current);

View file

@ -20,8 +20,7 @@ export function bindThis(target: any, key: string, descriptor: any) {
return { return {
configurable: true, configurable: true,
get() { get() {
// eslint-disable-next-line no-prototype-builtins if (this === target.prototype || Object.hasOwn(this, key) ||
if (this === target.prototype || this.hasOwnProperty(key) ||
typeof fn !== 'function') { typeof fn !== 'function') {
return fn; return fn;
} }

View file

@ -195,7 +195,7 @@ function getQueryMode(issuerUrl: string): oauth2orize.grant.Options['modes'] {
parsed.searchParams.append(key, value as string); parsed.searchParams.append(key, value as string);
} }
return (res as OAuthHttpResponse).redirect(parsed.toString()); (res as OAuthHttpResponse).redirect(parsed.toString());
}, },
}; };
} }

View file

@ -5,7 +5,7 @@
*/ */
* { * {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; font-family: 'Fira code', 'Fira Mono', Consolas, Menlo, Courier, monospace;
} }
html { html {

View file

@ -33,7 +33,7 @@
} }
//#region Detect language & fetch translations //#region Detect language & fetch translations
if (!localStorage.hasOwnProperty('locale')) { if (!Object.hasOwn(localStorage, 'locale')) {
let lang = localStorage.getItem('lang'); let lang = localStorage.getItem('lang');
if (lang == null || lang.toString == null || lang.toString() === 'null') { if (lang == null || lang.toString == null || lang.toString() === 'null') {
lang = 'ja-JP'; lang = 'ja-JP';

View file

@ -5,7 +5,7 @@
*/ */
* { * {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; font-family: 'Fira code', 'Fira Mono', Consolas, Menlo, Courier, monospace;
} }
html { html {

View file

@ -39,7 +39,7 @@ message('Start flushing.');
console.error(e); console.error(e);
setTimeout(() => { setTimeout(() => {
location = '/'; window.location = '/';
}, 10000) }, 10000)
} }
})(); })();

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": true, "sourceMap": true,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": true, "sourceMap": true,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,

View file

@ -9,7 +9,7 @@ import httpSignature from '@peertube/http-signature';
import { genRsaKeyPair } from '@/misc/gen-key-pair.js'; import { genRsaKeyPair } from '@/misc/gen-key-pair.js';
import { ApRequestCreator } from '@/core/activitypub/ApRequestService.js'; import { ApRequestCreator } from '@/core/activitypub/ApRequestService.js';
export const buildParsedSignature = (signingString: string, signature: string, algorithm: string) => { const buildParsedSignature = (signingString: string, signature: string, algorithm: string) => {
return { return {
scheme: 'Signature', scheme: 'Signature',
params: { params: {

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": false, "sourceMap": false,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,

View file

@ -288,7 +288,7 @@ const keymap = {
'down|j|tab': focusAfter, 'down|j|tab': focusAfter,
'esc': blur, 'esc': blur,
'm|o': () => showMenu(true), 'm|o': () => showMenu(true),
's': () => showContent.value !== showContent.value, 's': () => { showContent.value = !showContent.value; focus(); },
}; };
provide('react', (reaction: string) => { provide('react', (reaction: string) => {

View file

@ -305,7 +305,7 @@ const keymap = {
'q': () => renote(true), 'q': () => renote(true),
'esc': blur, 'esc': blur,
'm|o': () => showMenu(true), 'm|o': () => showMenu(true),
's': () => showContent.value !== showContent.value, 's': () => { showContent.value = !showContent.value; focus(); },
}; };
provide('react', (reaction: string) => { provide('react', (reaction: string) => {

View file

@ -116,7 +116,7 @@ function get(): PollEditorModelValue {
}; };
const calcAfter = () => { const calcAfter = () => {
let base = parseInt(after.value.toString()); let base = Number.parseInt(after.value.toString());
switch (unit.value) { switch (unit.value) {
// @ts-expect-error fallthrough // @ts-expect-error fallthrough
case 'day': base *= 24; case 'day': base *= 24;

View file

@ -305,8 +305,6 @@
"👸": ["girl", "woman", "female", "blond", "crown", "royal", "queen"], "👸": ["girl", "woman", "female", "blond", "crown", "royal", "queen"],
"🤴": ["boy", "man", "male", "crown", "royal", "king"], "🤴": ["boy", "man", "male", "crown", "royal", "king"],
"👰": ["couple", "marriage", "wedding", "woman", "bride"], "👰": ["couple", "marriage", "wedding", "woman", "bride"],
"👰": ["couple", "marriage", "wedding", "woman", "bride"],
"🤵": ["couple", "marriage", "wedding", "groom"],
"🤵": ["couple", "marriage", "wedding", "groom"], "🤵": ["couple", "marriage", "wedding", "groom"],
"🏃‍♀️": ["woman", "walking", "exercise", "race", "running", "female"], "🏃‍♀️": ["woman", "walking", "exercise", "race", "running", "female"],
"🏃": ["man", "walking", "exercise", "race", "running"], "🏃": ["man", "walking", "exercise", "race", "running"],

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": true, "sourceMap": true,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": false, "sourceMap": false,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"removeComments": false, "removeComments": false,

View file

@ -204,10 +204,10 @@ export class DropAndFusionGame extends EventEmitter<{
} else if (mono.shape === 'rectangle') { } else if (mono.shape === 'rectangle') {
return Matter.Bodies.rectangle(x, y, mono.sizeX, mono.sizeY, options); return Matter.Bodies.rectangle(x, y, mono.sizeX, mono.sizeY, options);
} else if (mono.shape === 'custom') { } else if (mono.shape === 'custom') {
return Matter.Bodies.fromVertices(x, y, mono.vertices!.map(i => i.map(j => ({ return Matter.Bodies.fromVertices(x, y, mono.vertices?.map(i => i.map(j => ({
x: (j.x / mono.verticesSize!) * mono.sizeX, x: (j.x / mono.verticesSize!) * mono.sizeX,
y: (j.y / mono.verticesSize!) * mono.sizeY, y: (j.y / mono.verticesSize!) * mono.sizeY,
}))), options); }))) ?? [], options);
} else { } else {
throw new Error('unrecognized shape'); throw new Error('unrecognized shape');
} }

View file

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/tsconfig", "$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"declaration": true, "declaration": true,

View file

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/tsconfig", "$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"declaration": true, "declaration": true,

View file

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/tsconfig", "$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"declaration": true, "declaration": true,

View file

@ -9,7 +9,7 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": false, "sourceMap": false,
"target": "ES2022", "target": "es2022",
"module": "nodenext", "module": "nodenext",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"removeComments": false, "removeComments": false,