Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,9 @@ export interface BaseConfig<
/**
* The overwrites that apply more differing configuration to specific files or directories.
*/
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig>
extends BaseConfig<Rules> {
export interface ConfigOverride<
Rules extends RulesConfig = RulesConfig,
> extends BaseConfig<Rules> {
/**
* The glob patterns for excluded files.
*/
Expand Down
19 changes: 8 additions & 11 deletions packages/core/tests/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -394,8 +391,8 @@ const testRuleWithInvalidDefaultOptions: RuleDefinition<{
testRuleWithInvalidDefaultOptions.meta satisfies RulesMeta | undefined;

type TestRuleDefinition<
Options extends
Partial<CustomRuleTypeDefinitions> = CustomRuleTypeDefinitions,
Options extends Partial<CustomRuleTypeDefinitions> =
CustomRuleTypeDefinitions,
> = CustomRuleDefinitionType<
{
LangOptions: TestLanguageOptions;
Expand Down
5 changes: 3 additions & 2 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
11 changes: 7 additions & 4 deletions packages/mcp/src/mcp-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

//-----------------------------------------------------------------------------
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/mcp/tests/mcp-server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +26 to +27
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I don't add these two lines, the tests fail, so I've added them.

However, I'm not sure whether this is considered a user-facing change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to re-add these lines. These were removed in commit 45842c0 to fix compatibility with version 1.22.0 of @modelcontextprotocol/sdk.

properties: {
filePaths: {
items: {
Expand Down