Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 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
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
4 changes: 2 additions & 2 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"node": "^20.19.0 || ^22.13.0 || >=24"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.22.0",
"@modelcontextprotocol/sdk": "^1.23.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With @modelcontextprotocol/sdk 1.23.0, the build completes without issues. Anyway, with version 1.24.1 (latest at the time of writing), I'm getting a type error:

$ npm run build

> @eslint/mcp@0.2.0 build
> tsc

../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts:1:25 - error TS7016: Could not find a declaration file for module 'express'. '.../rewrite/node_modules/express/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/express` if it exists or add a new declaration (.d.ts) file containing `declare module 'express';`

1 import { Express } from 'express';
                          ~~~~~~~~~


Found 1 error in ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts:1

The error can be fixed by installing @types/express as the message suggests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've updated it in 8ad6bc6 👍

Also, I've added @types/express to the ignoreDependencies for knip in fb2b0dd, because knip reported an error indicating that the dependency was unused.

"eslint": "^9.39.1",
"zod": "^3.24.4"
"zod": "^4.1.13"
},
"devDependencies": {
"@cfworker/json-schema": "^4.1.1",
Expand Down
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
Copy Markdown
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
Copy Markdown
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