Skip to content

Commit 8743370

Browse files
hakatashiclaude
andcommitted
fix: tsgo 型チェックエラーを解消(CI 修正)
- lib/slackMock.ts: MockInstance<Procedure> に call signature がなく TS2349 → unknown 経由でキャスト - shogi/index.ts: ShogiDbRow 型を定義して transitionResults に明示注釈、post() の reply_broadcast を if-else に分岐 - globals.d.ts: japanese / word2vec の declare module を追加 - npm: @types/node-emoji @types/download @types/byline を devDependencies に追加 - 多数のファイルから不要になった @ts-expect-error ディレクティブを除去 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnnBaVcma8bcEZRCtWZwsU
1 parent 88b26b5 commit 8743370

17 files changed

Lines changed: 137 additions & 25 deletions

File tree

achievements/index_production.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {WebClient} from '@slack/web-api';
66
import {Mutex} from 'async-mutex';
77
import {stripIndent} from 'common-tags';
88
import type {CollectionReference} from 'firebase-admin/firestore';
9-
// @ts-expect-error: Not typed
109
import japanese from 'japanese';
1110
import {countBy, throttle, groupBy, get as getter, chunk, uniq} from 'lodash';
1211
import moment from 'moment';

character-quiz/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {Mutex} from 'async-mutex';
88
import axios from 'axios';
99
import cloudinary from 'cloudinary';
1010
import type {CommonTransformationOptions} from 'cloudinary';
11-
// @ts-expect-error: Missing types
1211
import {hiraganize} from 'japanese';
1312
import {random, sample, range} from 'lodash';
1413
import {increment} from '../achievements';

globals.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,19 @@ declare module "mp3-duration" {
1212
function mp3Duration(buffer: Buffer): Promise<number>;
1313
export = mp3Duration;
1414
}
15+
16+
declare module "japanese" {
17+
export function hiraganize(str: string): string;
18+
export function romanize(str: string, config?: Record<string, string>): string;
19+
}
20+
21+
declare module "word2vec" {
22+
interface Model {
23+
getVector(word: string): {values: number[]} | null;
24+
similarity(word1: string, word2: string): number;
25+
mostSimilar(word: string, n?: number): Array<{word: string; similarity: number}>;
26+
}
27+
function loadModel(file: string, callback: (err: Error | null, model: Model) => void): void;
28+
export {loadModel};
29+
export default {loadModel};
30+
}

hayaoshi/util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {load as cheerioLoad} from 'cheerio';
44
import {google, sheets_v4} from 'googleapis';
55
import {decode as decodeHtmlEntities} from 'html-entities';
66
import iconv from 'iconv-lite';
7-
// @ts-expect-error
87
import {hiraganize} from 'japanese';
98
import {random, sample, range} from 'lodash';
109
import scrapeIt from 'scrape-it';

kirafan/quiz.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import axios from 'axios';
66
import { random, sample } from 'lodash';
77
import { ChatPostMessageArguments, GenericMessageEvent } from '@slack/web-api';
88
import cloudinary, { UploadApiResponse } from 'cloudinary';
9-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
10-
// @ts-expect-error
119
import { hiraganize } from 'japanese';
1210
import { increment } from '../achievements';
1311
import { ChannelLimitedBot } from '../lib/channelLimitedBot';

lib/candidateWords.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
33
import {promisify} from 'util';
4-
// @ts-expect-error: untyped
54
import download from 'download';
6-
// @ts-expect-error: untyped
75
import {hiraganize} from 'japanese';
86
import {shuffle} from 'lodash';
97

lib/loadFont.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as opentype from 'opentype.js';
2-
// @ts-expect-error
32
import download from 'download';
43
import path from 'path';
54
import fs from 'fs';

lib/slackMock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const createWebClient = (
4141
const path = stack.join('.');
4242
const methodName = last(stack);
4343
if (registeredMocks.has(path)) {
44-
return registeredMocks.get(path)(...args);
44+
return (registeredMocks.get(path) as unknown as (...args: any[]) => any)(...args);
4545
}
4646
if (isMockMethodCall(methodName)) {
4747
const mock = vi.fn();

package-lock.json

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
},
162162
"devDependencies": {
163163
"@hakatashi/eslint-config": "^1.19.0",
164+
"@types/byline": "^4.2.36",
165+
"@types/download": "^8.0.5",
166+
"@types/node-emoji": "^1.8.2",
164167
"@typescript-eslint/eslint-plugin": "^6.0.0",
165168
"@typescript-eslint/parser": "^6.0.0",
166169
"@typescript/native-preview": "^7.0.0-dev.20260612.1",

0 commit comments

Comments
 (0)