Skip to content

Commit 2bcee11

Browse files
sjsyrekclaude
andauthored
chore(lint): apply no-unnecessary-type-assertion fixes from typescript-eslint 8.59 (#50)
The typescript-eslint 8.59 release tightened the no-unnecessary-type-assertion rule, surfacing 197 stale type assertions across src/ and tests/. Auto-fixed via `npm run lint:fix`, plus 3 unused-import cleanups in test files that became TS6133 errors after the assertions were removed: - tests/unit/glossary-command.test.ts: drop unused Language import - tests/unit/cli-translate-workflow.test.ts: drop unused Language import - tests/unit/sync/sync-command.test.ts: drop unused CliSyncOptions import Verified: lint clean, type-check clean, full test suite passes (5490/5490), build succeeds, all 5 example workflows exit 0. Unblocks dependabot PR #38 (typescript-eslint 8.58 → 8.59). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0bf6b5a commit 2bcee11

47 files changed

Lines changed: 199 additions & 200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/api/style-rules-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class StyleRulesClient extends HttpClient {
163163
const wire = await this.makeJsonRequest<StyleRuleWireShape>(
164164
'PUT',
165165
`/v3/style_rules/${encodeURIComponent(styleId)}/configured_rules`,
166-
rules as unknown as Record<string, unknown>,
166+
rules,
167167
);
168168
return mapStyleRuleDetailed(wire);
169169
}

src/cli/commands/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ConfigCommand {
3838
}
3939
return value;
4040
}
41-
return this.maskSensitiveValues(this.config.get() as unknown as Record<string, unknown>);
41+
return this.maskSensitiveValues(this.config.get());
4242
}
4343

4444
/**
@@ -57,7 +57,7 @@ export class ConfigCommand {
5757
const config = this.config.get();
5858

5959
// Mask sensitive values
60-
return this.maskSensitiveValues(config as unknown as Record<string, unknown>);
60+
return this.maskSensitiveValues(config);
6161
}
6262

6363
/**

src/cli/commands/sync/register-sync-audit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ async function handleSyncAudit(
122122
if (options.format === 'json') {
123123
emitJsonErrorAndExit(error);
124124
}
125-
deps.handleError(error as Error);
125+
deps.handleError(error);
126126
}
127127
}

src/cli/commands/sync/register-sync-export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ async function handleSyncExport(
7272
if (options.format === 'json') {
7373
emitJsonErrorAndExit(error);
7474
}
75-
deps.handleError(error as Error);
75+
deps.handleError(error);
7676
}
7777
}

src/cli/commands/sync/register-sync-init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,6 @@ async function handleSyncInit(
214214
if (options.format === 'json') {
215215
emitJsonErrorAndExit(error);
216216
}
217-
handleError(error as Error);
217+
handleError(error);
218218
}
219219
}

src/cli/commands/sync/register-sync-push.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ async function handleSyncPush(
7575
if (options.format === 'json') {
7676
emitJsonErrorAndExit(error);
7777
}
78-
deps.handleError(error as Error);
78+
deps.handleError(error);
7979
}
8080
}

src/cli/commands/sync/register-sync-resolve.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ async function handleSyncResolve(
103103
if (options.format === 'json') {
104104
emitJsonErrorAndExit(error);
105105
}
106-
deps.handleError(error as Error);
106+
deps.handleError(error);
107107
}
108108
}

src/cli/commands/sync/register-sync-root.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async function handleSyncRoot(
142142
}
143143
}
144144
const syncCommand = await createSyncCommand(deps);
145-
const result = await syncCommand.run(options as Parameters<typeof syncCommand.run>[0]);
145+
const result = await syncCommand.run(options);
146146
if (result.driftDetected) {
147147
// Soft exit — set exitCode and return so in-flight writes / auto-commit
148148
// steps / the --watch event loop drain cleanly instead of being killed
@@ -154,6 +154,6 @@ async function handleSyncRoot(
154154
if (options['format'] === 'json') {
155155
emitJsonErrorAndExit(error);
156156
}
157-
handleError(error as Error);
157+
handleError(error);
158158
}
159159
}

src/cli/commands/sync/register-sync-status.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ async function handleSyncStatus(
7272
if (options.format === 'json') {
7373
emitJsonErrorAndExit(error);
7474
}
75-
deps.handleError(error as Error);
75+
deps.handleError(error);
7676
}
7777
}

src/cli/commands/sync/register-sync-validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ async function handleSyncValidate(
7979
if (options.format === 'json') {
8080
emitJsonErrorAndExit(error);
8181
}
82-
deps.handleError(error as Error);
82+
deps.handleError(error);
8383
}
8484
}

0 commit comments

Comments
 (0)