Skip to content

Commit 93d9ea0

Browse files
2214962083claude
andauthored
chore: fix eslint warnings and format changelog (#14)
* chore: remove obsolete VibeSync configuration files and update changelog links * chore: update package references to @nicepkg/vsync and release version 1.0.9 * chore: update package.json with repository details, author information, and keywords * chore: update package.json description to clarify functionality of the CLI tool * chore: remove obsolete changeset for version 10 * feat: add isMainModule function to determine if the current module is the main entry point * fix: resolve CLI functionality issue * docs: add full documentation link to README files * chore: add changeset for release v1.0.9 with patch for @nicepkg/vsync * chore: update documentation links to absolute paths and remove obsolete changeset * build: migrate from changesets to semantic-release Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update release command in GitHub Actions workflow * docs: format changelog with consistent version headers and commit links Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore(cli): fix eslint warnings and improve type annotations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore(website): fix eslint warnings and formatting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3735a18 commit 93d9ea0

File tree

15 files changed

+273
-271
lines changed

15 files changed

+273
-271
lines changed

CHANGELOG.md

Lines changed: 239 additions & 241 deletions
Large diffs are not rendered by default.

cli/eslint.config.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,7 @@ export default defineConfig(
120120
// TypeScript rules
121121
"@typescript-eslint/no-unused-vars": "off", // Use unused-imports instead
122122
"@typescript-eslint/no-explicit-any": "warn",
123-
"@typescript-eslint/consistent-type-imports": [
124-
"warn",
125-
{
126-
prefer: "type-imports",
127-
fixStyle: "inline-type-imports",
128-
},
129-
],
123+
"@typescript-eslint/consistent-type-imports": "off",
130124

131125
// Unused imports plugin
132126
"unused-imports/no-unused-imports": "error",

cli/src/utils/i18n.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export function getCurrentLanguage(): Language {
105105
* @param path - Dot-separated path (e.g., "common.yes")
106106
* @returns Value at path or undefined
107107
*/
108-
function getNestedValue(obj: any, path: string): string | undefined {
108+
function getNestedValue(obj: Translations, path: string): string | undefined {
109109
const keys = path.split(".");
110-
let current = obj;
110+
let current: Translations | Record<string, string> | string | undefined = obj;
111111

112112
for (const key of keys) {
113113
if (current === undefined || current === null) {
114114
return undefined;
115115
}
116-
current = current[key];
116+
current = current[key as keyof Translations] as Record<string, string>;
117117
}
118118

119119
return typeof current === "string" ? current : undefined;

cli/test/adapters/registry.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CodexAdapter } from "@src/adapters/codex.js";
44
import { CursorAdapter } from "@src/adapters/cursor.js";
55
import { OpenCodeAdapter } from "@src/adapters/opencode.js";
66
import { getAdapter, getAvailableTools } from "@src/adapters/registry.js";
7+
import type { ToolName } from "@src/types/config.js";
78
import { isSamePath } from "../utils/path.js";
89

910
describe("Adapter Registry", () => {
@@ -69,7 +70,7 @@ describe("Adapter Registry", () => {
6970
it("should throw error for unsupported tool", () => {
7071
expect(() =>
7172
getAdapter({
72-
tool: "invalid-tool" as any, // Testing invalid tool name
73+
tool: "invalid-tool" as ToolName, // Testing invalid tool name
7374
baseDir: "/test",
7475
level: "project",
7576
}),

cli/test/commands/sync.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
22
import { readFile } from "node:fs/promises";
33
import { join, resolve } from "node:path";
44
import mockFs from "mock-fs";
5+
import type FileSystem from "mock-fs/lib/filesystem.js";
56
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
67
import {
78
readSourceConfig,
@@ -62,7 +63,7 @@ describe("Sync Command", () => {
6263
};
6364

6465
beforeEach(() => {
65-
const mockFsConfig: any = {
66+
const mockFsConfig: FileSystem.DirectoryItems = {
6667
[TEST_HOME]: {
6768
// Add user-level config with language to avoid prompts
6869
".vsync.json": JSON.stringify({
@@ -121,7 +122,7 @@ describe("Sync Command", () => {
121122

122123
it("should throw error if config not found", async () => {
123124
const TEST_EMPTY = process.platform === "win32" ? "C:\\empty" : "/empty";
124-
const mockFsConfig: any = {
125+
const mockFsConfig: FileSystem.DirectoryItems = {
125126
[TEST_EMPTY]: {},
126127
};
127128
mockFs(mockFsConfig);
@@ -341,7 +342,7 @@ describe("Sync Command", () => {
341342
});
342343

343344
it("should handle manifest load errors gracefully", async () => {
344-
const mockFsConfig: any = {
345+
const mockFsConfig: FileSystem.DirectoryItems = {
345346
[TEST_HOME]: {
346347
// Add user-level config with language to avoid prompts
347348
".vsync.json": JSON.stringify({

cli/test/core/config-manager.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ describe("Config Manager", () => {
280280
target_tools: ["cursor"],
281281
sync_config: { skills: true, mcp: true },
282282
use_symlinks_for_skills: "yes", // Should be boolean
283-
} as any;
283+
} as Omit<VSyncConfig, "use_symlinks_for_skills">;
284284

285285
const result = validateConfig(config);
286286
expect(result.valid).toBe(false);
@@ -324,7 +324,7 @@ describe("Config Manager", () => {
324324
target_tools: ["cursor"],
325325
sync_config: { skills: true, mcp: true },
326326
language: "fr", // Should be 'en' or 'zh'
327-
} as any;
327+
} as Omit<VSyncConfig, "language">;
328328

329329
const result = validateConfig(config);
330330
expect(result.valid).toBe(false);
@@ -339,7 +339,7 @@ describe("Config Manager", () => {
339339
target_tools: ["cursor"],
340340
sync_config: { skills: true, mcp: true },
341341
language: 123, // Should be string
342-
} as any;
342+
} as Omit<VSyncConfig, "language">;
343343

344344
const result = validateConfig(config);
345345
expect(result.valid).toBe(false);

cli/test/core/manifest-manager.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
22
import { readFile } from "node:fs/promises";
33
import { join, resolve } from "node:path";
44
import mockFs from "mock-fs";
5+
import type FileSystem from "mock-fs/lib/filesystem.js";
56
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
67
import {
78
loadManifest,
@@ -65,7 +66,7 @@ describe("Manifest Manager", () => {
6566
};
6667

6768
beforeEach(() => {
68-
const mockFsConfig: any = {
69+
const mockFsConfig: FileSystem.DirectoryItems = {
6970
[TEST_HOME]: {
7071
".vsync": {
7172
cache: {

cli/test/core/parallel-sync.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
type TargetSyncConfig,
1010
} from "@src/core/parallel-sync.js";
1111
import { SourceData } from "@src/core/sync-executor.js";
12+
import type { ToolName } from "@src/types/config.js";
1213
import type { DiffResult } from "@src/types/plan.js";
1314

1415
describe("ParallelSyncOrchestrator", () => {
@@ -18,17 +19,17 @@ describe("ParallelSyncOrchestrator", () => {
1819

1920
beforeEach(() => {
2021
sourceData = new SourceData(
21-
[{ name: "skill1", content: "content1", hash: "hash1" }] as any,
22-
[{ name: "mcp1", type: "stdio", command: "cmd1", hash: "hash2" }] as any,
22+
[{ name: "skill1", content: "content1", hash: "hash1" }],
23+
[{ name: "mcp1", type: "stdio", command: "cmd1", hash: "hash2" }],
2324
[],
2425
[],
2526
);
2627

2728
// Create mock adapters
28-
const createMockAdapter = (toolName: string): ToolAdapter => ({
29+
const createMockAdapter = (toolName: ToolName): ToolAdapter => ({
2930
toolName,
3031
displayName: toolName,
31-
config: { tool: toolName as any, baseDir: "/test", level: "project" },
32+
config: { tool: toolName, baseDir: "/test", level: "project" },
3233
getConfigDir: vi.fn(() => `.${toolName}`),
3334
getConfigPaths: vi.fn(() => []),
3435
getMCPConfigPaths: vi.fn(() => []),

cli/test/core/sync-executor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("SyncExecutor", () => {
1717
mockAdapter = {
1818
toolName: "test-tool",
1919
displayName: "Test Tool",
20-
config: { tool: "cursor" as any, baseDir: "/test", level: "project" },
20+
config: { tool: "cursor", baseDir: "/test", level: "project" },
2121
getConfigDir: vi.fn(() => ".test"),
2222
getConfigPaths: vi.fn(() => []),
2323
getMCPConfigPaths: vi.fn(() => []),

cli/test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { describe, it, expect } from "vitest";
21
import { mkdtemp, rm, symlink, writeFile } from "node:fs/promises";
32
import { tmpdir } from "node:os";
43
import { join, relative } from "node:path";
54
import { pathToFileURL } from "node:url";
5+
import { describe, it, expect } from "vitest";
66
import { isMainModule, main } from "@src/index.js";
77

88
describe("CLI Entry Point", () => {

0 commit comments

Comments
 (0)