Skip to content

Commit 785573c

Browse files
authored
refactor: fix CI, use zod v4, and latest method in mcp (#332)
1 parent 7444f36 commit 785573c

7 files changed

Lines changed: 25 additions & 20 deletions

File tree

knip.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"packages/core": { "project": ["src/**/*.{cts,js,ts}"] },
2020
"packages/mcp": {
21+
"ignoreDependencies": ["@types/express"],
2122
"entry": ["tests/**/*.{cts,js,ts}"],
2223
"project": ["src/**/*.{cts,js,ts}", "tests/**/*.{cts,js,ts}"]
2324
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"knip": "^5.62.0",
4343
"lint-staged": "^16.0.0",
4444
"mocha": "^11.5.0",
45-
"prettier": "^3.4.1",
45+
"prettier": "^3.7.3",
4646
"rollup": "^4.52.3",
4747
"typescript": "^5.8.3",
4848
"typescript-eslint": "^8.0.0",

packages/core/src/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,8 +1030,9 @@ export interface BaseConfig<
10301030
/**
10311031
* The overwrites that apply more differing configuration to specific files or directories.
10321032
*/
1033-
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig>
1034-
extends BaseConfig<Rules> {
1033+
export interface ConfigOverride<
1034+
Rules extends RulesConfig = RulesConfig,
1035+
> extends BaseConfig<Rules> {
10351036
/**
10361037
* The glob patterns for excluded files.
10371038
*/

packages/core/tests/types/types.test.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,12 @@ interface TestLanguageOptions extends LanguageOptions {
9696
howMuch?: "yes" | "no" | boolean;
9797
}
9898

99-
class TestSourceCode
100-
implements
101-
TextSourceCode<{
102-
LangOptions: TestLanguageOptions;
103-
RootNode: TestRootNode;
104-
SyntaxElementWithLoc: unknown;
105-
ConfigNode: unknown;
106-
}>
107-
{
99+
class TestSourceCode implements TextSourceCode<{
100+
LangOptions: TestLanguageOptions;
101+
RootNode: TestRootNode;
102+
SyntaxElementWithLoc: unknown;
103+
ConfigNode: unknown;
104+
}> {
108105
text: string;
109106
ast: TestRootNode;
110107
notMuch: "no" | false;
@@ -394,8 +391,8 @@ const testRuleWithInvalidDefaultOptions: RuleDefinition<{
394391
testRuleWithInvalidDefaultOptions.meta satisfies RulesMeta | undefined;
395392

396393
type TestRuleDefinition<
397-
Options extends
398-
Partial<CustomRuleTypeDefinitions> = CustomRuleTypeDefinitions,
394+
Options extends Partial<CustomRuleTypeDefinitions> =
395+
CustomRuleTypeDefinitions,
399396
> = CustomRuleDefinitionType<
400397
{
401398
LangOptions: TestLanguageOptions;

packages/mcp/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
"node": "^20.19.0 || ^22.13.0 || >=24"
3737
},
3838
"dependencies": {
39-
"@modelcontextprotocol/sdk": "^1.22.0",
39+
"@modelcontextprotocol/sdk": "^1.24.1",
4040
"eslint": "^9.39.1",
41-
"zod": "^3.24.4"
41+
"zod": "^4.1.13"
4242
},
4343
"devDependencies": {
4444
"@cfworker/json-schema": "^4.1.1",
45+
"@types/express": "^5.0.6",
4546
"@types/node": "^24.7.2"
4647
}
4748
}

packages/mcp/src/mcp-server.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//-----------------------------------------------------------------------------
99

1010
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11-
import { z } from "zod";
11+
import { z } from "zod/v3";
1212
import { ESLint } from "eslint";
1313

1414
//-----------------------------------------------------------------------------
@@ -29,10 +29,13 @@ const filePathsSchema = {
2929
// Tools
3030
//-----------------------------------------------------------------------------
3131

32-
mcpServer.tool(
32+
mcpServer.registerTool(
3333
"lint-files",
34-
"Lint files using ESLint. You must provide a list of absolute file paths to the files you want to lint. The absolute file paths should be in the correct format for your operating system (e.g., forward slashes on Unix-like systems, backslashes on Windows).",
35-
filePathsSchema,
34+
{
35+
description:
36+
"Lint files using ESLint. You must provide a list of absolute file paths to the files you want to lint. The absolute file paths should be in the correct format for your operating system (e.g., forward slashes on Unix-like systems, backslashes on Windows).",
37+
inputSchema: filePathsSchema,
38+
},
3639
async ({ filePaths }) => {
3740
const eslint = new ESLint({
3841
// enable lookup from file rather than from cwd

packages/mcp/tests/mcp-server.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const passingFilePath = path.join(dirname, "fixtures", "passing.js");
2323
const syntaxErrorFilePath = path.join(dirname, "fixtures", "syntax-error.js");
2424

2525
const filePathsJsonSchema = {
26+
$schema: "http://json-schema.org/draft-07/schema#",
27+
additionalProperties: false,
2628
properties: {
2729
filePaths: {
2830
items: {

0 commit comments

Comments
 (0)