diff --git a/.eslintrc.js b/.eslintrc.js index 460ffbc54..3e3731362 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -37,6 +37,7 @@ module.exports = { 'no-useless-escape': ['off'], 'no-multi-spaces': ['warn'], 'no-control-regex': ['warn'], + 'no-empty': ['warn'], '@typescript-eslint/no-var-requires': ['warn'], '@typescript-eslint/no-inferrable-types': ['warn'], '@typescript-eslint/no-empty-function': ['off'], diff --git a/src/mfm/from-html.ts b/src/mfm/from-html.ts index 4c8e2dbec..17a10588d 100644 --- a/src/mfm/from-html.ts +++ b/src/mfm/from-html.ts @@ -37,11 +37,12 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { if (!treeAdapter.isElementNode(node)) return; switch (node.nodeName) { - case 'br': + case 'br': { text += '\n'; break; + } - case 'a': + case 'a': { const txt = getText(node); const rel = node.attrs.find(x => x.name === 'rel'); const href = node.attrs.find(x => x.name === 'href'); @@ -87,8 +88,9 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { text += generateLink(); } break; + } - case 'p': + case 'p': { text += '\n\n'; if (node.childNodes) { for (const n of node.childNodes) { @@ -96,14 +98,16 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { } } break; + } - default: + default: { if (node.childNodes) { for (const n of node.childNodes) { analyze(n); } } break; + } } } } diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 4823def7c..2e9b05b1a 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -278,7 +278,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise { +export async function updatePerson(uri: string, resolver?: Resolver | null, hint?: Record): Promise { if (typeof uri !== 'string') throw new Error('uri is not string'); // URIがこのサーバーを指しているならスキップ diff --git a/src/remote/activitypub/renderer/ordered-collection.ts b/src/remote/activitypub/renderer/ordered-collection.ts index 68870a0ec..c4b4337af 100644 --- a/src/remote/activitypub/renderer/ordered-collection.ts +++ b/src/remote/activitypub/renderer/ordered-collection.ts @@ -6,7 +6,7 @@ * @param last URL of last page (optional) * @param orderedItems attached objects (optional) */ -export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: object) { +export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: Record) { const page: any = { id, type: 'OrderedCollection',