diff --git a/knip.json b/knip.json index cad406275..8b84e6971 100644 --- a/knip.json +++ b/knip.json @@ -18,6 +18,7 @@ }, "packages/core": { "project": ["src/**/*.{cts,js,ts}"] }, "packages/mcp": { + "ignoreDependencies": ["@types/express"], "entry": ["tests/**/*.{cts,js,ts}"], "project": ["src/**/*.{cts,js,ts}", "tests/**/*.{cts,js,ts}"] }, diff --git a/package.json b/package.json index 7870ba402..092101953 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "knip": "^5.62.0", "lint-staged": "^16.0.0", "mocha": "^11.5.0", - "prettier": "^3.4.1", + "prettier": "^3.7.3", "rollup": "^4.52.3", "typescript": "^5.8.3", "typescript-eslint": "^8.0.0", diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 95604e70d..971df45ba 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1030,8 +1030,9 @@ export interface BaseConfig< /** * The overwrites that apply more differing configuration to specific files or directories. */ -export interface ConfigOverride - extends BaseConfig { +export interface ConfigOverride< + Rules extends RulesConfig = RulesConfig, +> extends BaseConfig { /** * The glob patterns for excluded files. */ diff --git a/packages/core/tests/types/types.test.ts b/packages/core/tests/types/types.test.ts index 14935c2fe..3719a2f64 100644 --- a/packages/core/tests/types/types.test.ts +++ b/packages/core/tests/types/types.test.ts @@ -96,15 +96,12 @@ interface TestLanguageOptions extends LanguageOptions { howMuch?: "yes" | "no" | boolean; } -class TestSourceCode - implements - TextSourceCode<{ - LangOptions: TestLanguageOptions; - RootNode: TestRootNode; - SyntaxElementWithLoc: unknown; - ConfigNode: unknown; - }> -{ +class TestSourceCode implements TextSourceCode<{ + LangOptions: TestLanguageOptions; + RootNode: TestRootNode; + SyntaxElementWithLoc: unknown; + ConfigNode: unknown; +}> { text: string; ast: TestRootNode; notMuch: "no" | false; @@ -394,8 +391,8 @@ const testRuleWithInvalidDefaultOptions: RuleDefinition<{ testRuleWithInvalidDefaultOptions.meta satisfies RulesMeta | undefined; type TestRuleDefinition< - Options extends - Partial = CustomRuleTypeDefinitions, + Options extends Partial = + CustomRuleTypeDefinitions, > = CustomRuleDefinitionType< { LangOptions: TestLanguageOptions; diff --git a/packages/mcp/package.json b/packages/mcp/package.json index 7227000f6..abf904d60 100644 --- a/packages/mcp/package.json +++ b/packages/mcp/package.json @@ -36,12 +36,13 @@ "node": "^20.19.0 || ^22.13.0 || >=24" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.22.0", + "@modelcontextprotocol/sdk": "^1.24.1", "eslint": "^9.39.1", - "zod": "^3.24.4" + "zod": "^4.1.13" }, "devDependencies": { "@cfworker/json-schema": "^4.1.1", + "@types/express": "^5.0.6", "@types/node": "^24.7.2" } } diff --git a/packages/mcp/src/mcp-server.js b/packages/mcp/src/mcp-server.js index 554b85adc..3feff2d23 100644 --- a/packages/mcp/src/mcp-server.js +++ b/packages/mcp/src/mcp-server.js @@ -8,7 +8,7 @@ //----------------------------------------------------------------------------- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { z } from "zod"; +import { z } from "zod/v3"; import { ESLint } from "eslint"; //----------------------------------------------------------------------------- @@ -29,10 +29,13 @@ const filePathsSchema = { // Tools //----------------------------------------------------------------------------- -mcpServer.tool( +mcpServer.registerTool( "lint-files", - "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).", - filePathsSchema, + { + description: + "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).", + inputSchema: filePathsSchema, + }, async ({ filePaths }) => { const eslint = new ESLint({ // enable lookup from file rather than from cwd diff --git a/packages/mcp/tests/mcp-server.test.js b/packages/mcp/tests/mcp-server.test.js index fdc6088fb..d7be975a2 100644 --- a/packages/mcp/tests/mcp-server.test.js +++ b/packages/mcp/tests/mcp-server.test.js @@ -23,6 +23,8 @@ const passingFilePath = path.join(dirname, "fixtures", "passing.js"); const syntaxErrorFilePath = path.join(dirname, "fixtures", "syntax-error.js"); const filePathsJsonSchema = { + $schema: "http://json-schema.org/draft-07/schema#", + additionalProperties: false, properties: { filePaths: { items: {