diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 13efb2da5..bf48b2b56 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,4 +1,13 @@ { $schema: "https://docs.renovatebot.com/renovate-schema.json", extends: ["github>eslint/workflows//.github/renovate/eslint-base.json5"], + packageRules: [ + { + description: "Update `eslint` in dependencies", + matchDepTypes: ["dependencies"], + matchPackageNames: ["eslint"], + minimumReleaseAge: null, // Don't wait for these packages + rangeStrategy: "bump", + }, + ], } diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml deleted file mode 100644 index 61e86f367..000000000 --- a/.github/workflows/bun-test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Bun CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest, macOS-14, ubuntu-latest] - bun: [latest] - - steps: - - uses: actions/checkout@v5 - - name: Use Bun ${{ matrix.bun }} ${{ matrix.os }} - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ matrix.bun }} - - name: bun install, build, and test - run: | - bun install - bun run --bun build - bun run --bun test - env: - CI: true diff --git a/.github/workflows/ci-bun.yml b/.github/workflows/ci-bun.yml new file mode 100644 index 000000000..9806f0555 --- /dev/null +++ b/.github/workflows/ci-bun.yml @@ -0,0 +1,14 @@ +name: ci-bun + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + ci-bun: + uses: eslint/workflows/.github/workflows/ci-bun.yml@main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca8a11f33..1a206121b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: "lts/*" @@ -36,13 +36,13 @@ jobs: strategy: matrix: os: [windows-latest, macOS-latest, ubuntu-latest] - node-version: [18.x, 20.x, 22.x, 24.x, 25.x] + node-version: [25.x, 24.x, 22.x, 20.x, "20.19.0"] steps: - uses: actions/checkout@v5 - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: "lts/*" @@ -70,6 +70,9 @@ jobs: npm install npm run build + - name: Run TypeScript Compiler + run: npx tsc + - name: Test types (core) working-directory: packages/core run: | @@ -101,7 +104,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: "lts/*" @@ -123,7 +126,7 @@ jobs: with: version: latest - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: "lts/*" diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 3a3bd2ec1..d20b470cd 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: lts/* registry-url: "https://registry.npmjs.org" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index d8a8a3d40..730ec7479 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -35,7 +35,7 @@ jobs: if: ${{ steps.release.outputs.releases_created == 'true' }} # Node.js release - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 if: ${{ steps.release.outputs.releases_created == 'true' }} with: node-version: lts/* diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d4295bda4..fe232e62b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,6 +4,10 @@ on: schedule: - cron: "31 22 * * *" # Runs every day at 10:31 PM UTC +permissions: + issues: write + pull-requests: write + jobs: stale: uses: eslint/workflows/.github/workflows/stale.yml@main diff --git a/.gitignore b/.gitignore index aad18c2d2..a0ed0cff0 100644 --- a/.gitignore +++ b/.gitignore @@ -141,7 +141,7 @@ yarn.lock bun.lockb # Automatically generated files by GitHub Actions workflow -tools/update-readme.js +/.shared-workflows # pnpm pnpm-lock.yaml diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dca608e84..d488d19c4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,10 +1,10 @@ { - "packages/compat": "1.4.0", - "packages/config-array": "0.21.1", - "packages/config-helpers": "0.4.1", - "packages/core": "0.16.0", - "packages/mcp": "0.1.1", - "packages/migrate-config": "1.6.0", - "packages/object-schema": "2.1.7", - "packages/plugin-kit": "0.4.0" + "packages/compat": "2.0.0", + "packages/config-array": "0.22.0", + "packages/config-helpers": "0.5.0", + "packages/core": "1.0.0", + "packages/mcp": "0.2.0", + "packages/migrate-config": "2.0.0", + "packages/object-schema": "3.0.0", + "packages/plugin-kit": "0.5.0" } diff --git a/README.md b/README.md index e46c27118..b96ce6202 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/package.json b/package.json index 3f3922244..c8b66d7fb 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "fmt": "prettier --write .", "fmt:check": "prettier --check .", "test:jsr": "npm run test:jsr --workspaces --if-present", - "test:types": "tsc" + "test:types": "tsc && npm run test:types --workspaces --if-present" }, "workspaces": [ "packages/*" @@ -29,7 +29,7 @@ "!(*.{js,ts})": "prettier --write --ignore-unknown" }, "engines": { - "node": ">= 22.3.0" + "node": "^22.13.0 || >=24" }, "devDependencies": { "@eslint/config-helpers": "file:packages/config-helpers", @@ -44,5 +44,10 @@ "typescript": "^5.8.3", "typescript-eslint": "^8.0.0", "yorkie": "^2.0.0" + }, + "overrides": { + "eslint": { + "@eslint/core": "file:packages/core" + } } } diff --git a/packages/compat/CHANGELOG.md b/packages/compat/CHANGELOG.md index 9dde8ad62..488adf4aa 100644 --- a/packages/compat/CHANGELOG.md +++ b/packages/compat/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.0.0](https://github.com/eslint/rewrite/compare/compat-v1.4.1...compat-v2.0.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* patch missing context and SourceCode methods for v10 ([#311](https://github.com/eslint/rewrite/issues/311)) ([a40d8c6](https://github.com/eslint/rewrite/commit/a40d8c60af5bc09ea5e1c778655312a34ddc9f83)) +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.17.0 to ^1.0.0 + +## [1.4.1](https://github.com/eslint/rewrite/compare/compat-v1.4.0...compat-v1.4.1) (2025-10-27) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.16.0 to ^0.17.0 + ## [1.4.0](https://github.com/eslint/rewrite/compare/compat-v1.3.2...compat-v1.4.0) (2025-09-16) diff --git a/packages/compat/README.md b/packages/compat/README.md index afa46b44a..c493dfe10 100644 --- a/packages/compat/README.md +++ b/packages/compat/README.md @@ -2,9 +2,9 @@ ## Overview -This packages contains functions that allow you to wrap existing ESLint rules, plugins, and configurations that were intended for use with ESLint v8.x to allow them to work as-is in ESLint v9.x. +This package contains functions that allow you to wrap existing ESLint rules, plugins, and configurations that were intended for use with ESLint v8.x or v9.x to allow them to work as-is in ESLint v9.x and v10.x. -**Note:** All plugins are not guaranteed to work in ESLint v9.x. This package fixes the most common issues but can't fix everything. +**Note:** All plugins are not guaranteed to work in ESLint v9.x or v10.x. This package fixes the most common issues but can't fix everything. ## Installation @@ -37,7 +37,7 @@ This package exports the following functions in both ESM and CommonJS format: ### Fixing Rules -If you have a rule that you'd like to make compatible with ESLint v9.x, you can do so using the `fixupRule()` function: +If you have a rule that you'd like to make compatible with ESLint v9.x or v10.x, you can do so using the `fixupRule()` function: ```js // ESM example @@ -71,7 +71,7 @@ module.exports = compatRule; ### Fixing Plugins -If you are using a plugin in your `eslint.config.js` that is not yet compatible with ESLint 9.x, you can wrap it using the `fixupPluginRules()` function: +If you are using a plugin in your `eslint.config.js` that is not yet compatible with ESLint v9.x or v10.x, you can wrap it using the `fixupPluginRules()` function: ```js // eslint.config.js - ESM example @@ -115,7 +115,7 @@ module.exports = defineConfig([ ### Fixing Configs -If you are importing other configs into your `eslint.config.js` that use plugins that are not yet compatible with ESLint 9.x, you can wrap the entire array or a single object using the `fixupConfigRules()` function: +If you are importing other configs into your `eslint.config.js` that use plugins that are not yet compatible with ESLint v9.x or v10.x, you can wrap the entire array or a single object using the `fixupConfigRules()` function: ```js // eslint.config.js - ESM example @@ -205,9 +205,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/compat/jsr.json b/packages/compat/jsr.json index 64decf0fd..fd8dea790 100644 --- a/packages/compat/jsr.json +++ b/packages/compat/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/compat", - "version": "1.4.0", + "version": "2.0.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/compat/package.json b/packages/compat/package.json index ba9cb283d..9a81d961f 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/compat", - "version": "1.4.0", + "version": "2.0.0", "description": "Compatibility utilities for ESLint", "type": "module", "main": "dist/esm/index.js", @@ -49,7 +49,7 @@ }, "homepage": "https://github.com/eslint/rewrite/tree/main/packages/compat#readme", "dependencies": { - "@eslint/core": "^0.16.0" + "@eslint/core": "^1.0.0" }, "devDependencies": { "@types/node": "^24.7.2", @@ -64,6 +64,6 @@ } }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/packages/compat/src/fixup-rules.js b/packages/compat/src/fixup-rules.js index aedd1a759..e893f52e7 100644 --- a/packages/compat/src/fixup-rules.js +++ b/packages/compat/src/fixup-rules.js @@ -1,5 +1,5 @@ /** - * @filedescription Functions to fix up rules to provide missing methods on the `context` object. + * @fileoverview Functions to fix up rules to provide missing methods on the `context` and `sourceCode` objects. * @author Nicholas C. Zakas */ @@ -70,13 +70,67 @@ const fixedUpPluginReplacements = new WeakMap(); */ const fixedUpPlugins = new WeakSet(); +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Determines if two nodes or tokens overlap. + * @param {object} first The first node or token to check. + * @param {object} second The second node or token to check. + * @returns {boolean} True if the two nodes or tokens overlap. + */ +function nodesOrTokensOverlap(first, second) { + return ( + (first.range[0] <= second.range[0] && + first.range[1] >= second.range[0]) || + (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]) + ); +} + +/** + * Checks whether a node is an export declaration. + * @param {object} node An AST node. + * @returns {boolean} True if the node is an export declaration. + */ +function looksLikeExport(node) { + return ( + node.type === "ExportDefaultDeclaration" || + node.type === "ExportNamedDeclaration" + ); +} + +/** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * @param {object} node The AST node to get the comment for. + * @param {object} sourceCode A SourceCode instance to get comments. + * @returns {object|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + */ +function findJSDocComment(node, sourceCode) { + const tokenBefore = sourceCode.getTokenBefore(node, { + includeComments: true, + }); + + if ( + tokenBefore && + tokenBefore.type === "Block" && + tokenBefore.value.charAt(0) === "*" && + node.loc.start.line - tokenBefore.loc.end.line <= 1 + ) { + return tokenBefore; + } + + return null; +} + //----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- /** * Takes the given rule and creates a new rule with the `create()` method wrapped - * to provide the missing methods on the `context` object. + * to provide missing methods on the `context` and `sourceCode` objects. * @param {FixupRuleDefinition|FixupLegacyRuleDefinition} ruleDefinition The rule to fix up. * @returns {FixupRuleDefinition} The fixed-up rule. */ @@ -98,52 +152,193 @@ export function fixupRule(ruleDefinition) { : ruleDefinition.create.bind(ruleDefinition); function ruleCreate(context) { - // if getScope is already there then no need to create old methods + const sourceCode = context.sourceCode; + + // No need to create old methods for ESLint < 9 if ("getScope" in context) { return originalCreate(context); } - const sourceCode = context.sourceCode; - let currentNode = sourceCode.ast; + let eslintVersion = 9; + if (!("getCwd" in context)) { + eslintVersion = 10; + } + + let compatSourceCode = sourceCode; + if (eslintVersion >= 10) { + compatSourceCode = Object.assign(Object.create(sourceCode), { + getTokenOrCommentBefore(node, skip) { + return sourceCode.getTokenBefore(node, { + includeComments: true, + skip, + }); + }, + getTokenOrCommentAfter(node, skip) { + return sourceCode.getTokenAfter(node, { + includeComments: true, + skip, + }); + }, + isSpaceBetweenTokens(first, second) { + if (nodesOrTokensOverlap(first, second)) { + return false; + } + + const [startingNodeOrToken, endingNodeOrToken] = + first.range[1] <= second.range[0] + ? [first, second] + : [second, first]; + const firstToken = + sourceCode.getLastToken(startingNodeOrToken) || + startingNodeOrToken; + const finalToken = + sourceCode.getFirstToken(endingNodeOrToken) || + endingNodeOrToken; + let currentToken = firstToken; + + while (currentToken !== finalToken) { + const nextToken = sourceCode.getTokenAfter( + currentToken, + { + includeComments: true, + }, + ); + + if ( + currentToken.range[1] !== nextToken.range[0] || + (nextToken !== finalToken && + nextToken.type === "JSXText" && + /\s/u.test(nextToken.value)) + ) { + return true; + } + + currentToken = nextToken; + } + + return false; + }, + getJSDocComment(node) { + let parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + return findJSDocComment( + looksLikeExport(parent) ? parent : node, + sourceCode, + ); + + case "ClassExpression": + return findJSDocComment(parent.parent, sourceCode); + + case "ArrowFunctionExpression": + case "FunctionExpression": + if ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" + ) { + while ( + !sourceCode.getCommentsBefore(parent) + .length && + !/Function/u.test(parent.type) && + parent.type !== "MethodDefinition" && + parent.type !== "Property" + ) { + parent = parent.parent; + + if (!parent) { + break; + } + } + + if ( + parent && + parent.type !== "FunctionDeclaration" && + parent.type !== "Program" + ) { + return findJSDocComment(parent, sourceCode); + } + } + + return findJSDocComment(node, sourceCode); + + default: + return null; + } + }, + }); + + Object.freeze(compatSourceCode); + } - const newContext = Object.assign(Object.create(context), { - parserServices: sourceCode.parserServices, + let currentNode = compatSourceCode.ast; + + const compatContext = Object.assign(Object.create(context), { + parserServices: compatSourceCode.parserServices, /* * The following methods rely on the current node in the traversal, * so we need to add them manually. */ getScope() { - return sourceCode.getScope(currentNode); + return compatSourceCode.getScope(currentNode); }, getAncestors() { - return sourceCode.getAncestors(currentNode); + return compatSourceCode.getAncestors(currentNode); }, markVariableAsUsed(variable) { - sourceCode.markVariableAsUsed(variable, currentNode); + compatSourceCode.markVariableAsUsed(variable, currentNode); }, }); + if (eslintVersion >= 10) { + Object.assign(compatContext, { + parserOptions: compatContext.languageOptions.parserOptions, + + getCwd() { + return compatContext.cwd; + }, + + getFilename() { + return compatContext.filename; + }, + + getPhysicalFilename() { + return compatContext.physicalFilename; + }, + + getSourceCode() { + return compatSourceCode; + }, + }); + + Object.defineProperty(compatContext, "sourceCode", { + enumerable: true, + value: compatSourceCode, + }); + } + // add passthrough methods for (const [ contextMethodName, sourceCodeMethodName, ] of removedMethodNames) { - newContext[contextMethodName] = - sourceCode[sourceCodeMethodName].bind(sourceCode); + compatContext[contextMethodName] = + compatSourceCode[sourceCodeMethodName].bind(compatSourceCode); } // freeze just like the original context - Object.freeze(newContext); + Object.freeze(compatContext); /* * Create the visitor object using the original create() method. * This is necessary to ensure that the visitor object is created * with the correct context. */ - const visitor = originalCreate(newContext); + const visitor = originalCreate(compatContext); /* * Wrap each method in the visitor object to update the currentNode @@ -184,7 +379,7 @@ export function fixupRule(ruleDefinition) { }; // copy `schema` property of function-style rule or top-level `schema` property of object-style rule into `meta` object - // @ts-ignore -- top-level `schema` property was not offically supported for object-style rules so it doesn't exist in types + // @ts-ignore -- top-level `schema` property was not officially supported for object-style rules so it doesn't exist in types const { schema } = ruleDefinition; if (schema) { if (!newRuleDefinition.meta) { @@ -207,7 +402,7 @@ export function fixupRule(ruleDefinition) { /** * Takes the given plugin and creates a new plugin with all of the rules wrapped - * to provide the missing methods on the `context` object. + * to provide missing methods on the `context` and `sourceCode` objects. * @param {FixupPluginDefinition} plugin The plugin to fix up. * @returns {FixupPluginDefinition} The fixed-up plugin. */ @@ -244,7 +439,7 @@ export function fixupPluginRules(plugin) { /** * Takes the given configuration and creates a new configuration with all of the - * rules wrapped to provide the missing methods on the `context` object. + * rules wrapped to provide missing methods on the `context` and `sourceCode` objects. * @param {FixupConfigArray|FixupConfig} config The configuration to fix up. * @returns {FixupConfigArray} The fixed-up configuration. */ diff --git a/packages/compat/tests/fixup-rules.test.js b/packages/compat/tests/fixup-rules.test.js index 8f4b92bad..23260cd7d 100644 --- a/packages/compat/tests/fixup-rules.test.js +++ b/packages/compat/tests/fixup-rules.test.js @@ -24,7 +24,7 @@ const REPLACEMENT_METHODS = ["getScope", "getAncestors"]; // Tests //----------------------------------------------------------------------------- -describe("@eslint/backcompat", () => { +describe("@eslint/compat", () => { describe("fixupRule()", () => { it("should return a new rule object with the same own properties", () => { const rule = { @@ -493,6 +493,319 @@ describe("@eslint/backcompat", () => { ); }); }); + + it("should restore context.parserOptions", () => { + const rule = { + create(context) { + assert.deepStrictEqual( + context.parserOptions, + context.languageOptions.parserOptions, + ); + + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore context.getCwd()", () => { + const rule = { + create(context) { + assert.strictEqual(context.getCwd(), context.cwd); + + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore context.getFilename()", () => { + const rule = { + create(context) { + assert.strictEqual(context.getFilename(), context.filename); + + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore context.getPhysicalFilename()", () => { + const rule = { + create(context) { + assert.strictEqual( + context.getPhysicalFilename(), + context.physicalFilename, + ); + + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore context.getSourceCode()", () => { + const rule = { + create(context) { + assert.strictEqual( + context.getSourceCode(), + context.sourceCode, + ); + + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore sourceCode.getTokenOrCommentBefore()", () => { + const rule = { + create(context) { + return { + Identifier(node) { + assert.strictEqual( + context.sourceCode.getTokenOrCommentBefore(node) + .value, + "let", + ); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + linter.verify(code, config); + }); + + it("should restore sourceCode.getTokenOrCommentAfter()", () => { + const rule = { + create(context) { + return { + Identifier(node) { + assert.strictEqual( + context.sourceCode.getTokenOrCommentAfter(node) + .value, + "=", + ); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo = 0;"; + linter.verify(code, config); + }); + + it("should restore sourceCode.isSpaceBetweenTokens()", () => { + const rule = { + create(context) { + return { + Identifier(node) { + assert.strictEqual( + context.sourceCode.isSpaceBetweenTokens( + node, + context.sourceCode.getTokenBefore(node), + ), + true, + ); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = "let foo"; + linter.verify(code, config); + }); + + it("should restore sourceCode.getJSDocComment()", () => { + const rule = { + create(context) { + return { + FunctionDeclaration(node) { + const jsdoc = + context.sourceCode.getJSDocComment(node); + + assert.strictEqual(jsdoc.type, "Block"); + assert.strictEqual(jsdoc.value, "* Desc"); + }, + }; + }, + }; + + const config = { + plugins: { + test: { + rules: { + "test-rule": fixupRule(rule), + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }; + + const linter = new Linter(); + const code = ["/** Desc*/", "function foo(){}"].join("\n"); + linter.verify(code, config); + }); }); describe("fixupPluginRules()", () => { @@ -701,6 +1014,80 @@ describe("@eslint/backcompat", () => { ); }); }); + + it("should restore context.getFilename()", () => { + const plugin = { + configs: { + recommended: { + rules: { + "test-rule": "error", + }, + }, + }, + rules: { + "test-rule": { + create(context) { + assert.strictEqual( + context.getFilename(), + context.filename, + ); + return { + Identifier(node) { + context.report(node, "Identifier"); + }, + }; + }, + }, + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const config = { + plugins: { test: fixupPluginRules(plugin) }, + rules: { "test/test-rule": "error" }, + }; + const messages = linter.verify(code, config); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore sourceCode.getTokenOrCommentBefore()", () => { + const plugin = { + configs: { + recommended: { + rules: { + "test-rule": "error", + }, + }, + }, + rules: { + "test-rule": { + create(context) { + return { + Identifier(node) { + assert.strictEqual( + context.sourceCode.getTokenOrCommentBefore( + node, + ).value, + "let", + ); + }, + }; + }, + }, + }, + }; + + const linter = new Linter(); + const code = "let foo;"; + const config = { + plugins: { test: fixupPluginRules(plugin) }, + rules: { "test/test-rule": "error" }, + }; + linter.verify(code, config); + }); }); describe("fixupConfigRules()", () => { @@ -834,5 +1221,78 @@ describe("@eslint/backcompat", () => { ); }); }); + + it("should restore context.getFilename()", () => { + const config = [ + { + plugins: { + test: { + rules: { + "test-rule": { + create(context) { + assert.strictEqual( + context.getFilename(), + context.filename, + ); + return { + Identifier(node) { + context.report( + node, + "Identifier", + ); + }, + }; + }, + }, + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }, + ]; + + const linter = new Linter(); + const code = "let foo;"; + const messages = linter.verify(code, fixupConfigRules(config)); + + assert.strictEqual(messages.length, 1); + assert.strictEqual(messages[0].message, "Identifier"); + }); + + it("should restore sourceCode.getTokenOrCommentBefore()", () => { + const config = [ + { + plugins: { + test: { + rules: { + "test-rule": { + create(context) { + return { + Identifier(node) { + assert.strictEqual( + context.sourceCode.getTokenOrCommentBefore( + node, + ).value, + "let", + ); + }, + }; + }, + }, + }, + }, + }, + rules: { + "test/test-rule": "error", + }, + }, + ]; + + const linter = new Linter(); + const code = "let foo;"; + linter.verify(code, fixupConfigRules(config)); + }); }); }); diff --git a/packages/config-array/CHANGELOG.md b/packages/config-array/CHANGELOG.md index aeb44bede..019c1db54 100644 --- a/packages/config-array/CHANGELOG.md +++ b/packages/config-array/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [0.22.0](https://github.com/eslint/rewrite/compare/config-array-v0.21.1...config-array-v0.22.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/object-schema bumped from ^2.1.7 to ^3.0.0 + ## [0.21.1](https://github.com/eslint/rewrite/compare/config-array-v0.21.0...config-array-v0.21.1) (2025-10-17) diff --git a/packages/config-array/README.md b/packages/config-array/README.md index 1d12bbdb4..19af407e3 100644 --- a/packages/config-array/README.md +++ b/packages/config-array/README.md @@ -359,9 +359,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/config-array/jsr.json b/packages/config-array/jsr.json index fc1ab3bb0..ad5bc4619 100644 --- a/packages/config-array/jsr.json +++ b/packages/config-array/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-array", - "version": "0.21.1", + "version": "0.22.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/config-array/package.json b/packages/config-array/package.json index af492d890..9d16ddbe9 100644 --- a/packages/config-array/package.json +++ b/packages/config-array/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-array", - "version": "0.21.1", + "version": "0.22.0", "description": "General purpose glob-based configuration matching.", "author": "Nicholas C. Zakas", "type": "module", @@ -49,7 +49,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.7", + "@eslint/object-schema": "^3.0.0", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -59,6 +59,6 @@ "rollup-plugin-copy": "^3.5.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/packages/config-helpers/CHANGELOG.md b/packages/config-helpers/CHANGELOG.md index f1bf55e80..055d31b81 100644 --- a/packages/config-helpers/CHANGELOG.md +++ b/packages/config-helpers/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [0.5.0](https://github.com/eslint/rewrite/compare/config-helpers-v0.4.2...config-helpers-v0.5.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.17.0 to ^1.0.0 + +## [0.4.2](https://github.com/eslint/rewrite/compare/config-helpers-v0.4.1...config-helpers-v0.4.2) (2025-10-27) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.16.0 to ^0.17.0 + ## [0.4.1](https://github.com/eslint/rewrite/compare/config-helpers-v0.4.0...config-helpers-v0.4.1) (2025-10-17) diff --git a/packages/config-helpers/README.md b/packages/config-helpers/README.md index e7b1a22b1..a06051357 100644 --- a/packages/config-helpers/README.md +++ b/packages/config-helpers/README.md @@ -88,9 +88,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/config-helpers/jsr.json b/packages/config-helpers/jsr.json index 7ed686df6..da784f3a7 100644 --- a/packages/config-helpers/jsr.json +++ b/packages/config-helpers/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-helpers", - "version": "0.4.1", + "version": "0.5.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/config-helpers/package.json b/packages/config-helpers/package.json index ece520cd8..504ef34fe 100644 --- a/packages/config-helpers/package.json +++ b/packages/config-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-helpers", - "version": "0.4.1", + "version": "0.5.0", "description": "Helper utilities for creating ESLint configuration", "type": "module", "main": "dist/esm/index.js", @@ -48,13 +48,13 @@ }, "homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-helpers#readme", "dependencies": { - "@eslint/core": "^0.16.0" + "@eslint/core": "^1.0.0" }, "devDependencies": { "eslint": "^9.27.0", "rollup-plugin-copy": "^3.5.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c377ae2a7..92e17caf7 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## [1.0.0](https://github.com/eslint/rewrite/compare/core-v0.17.0...core-v1.0.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Remove deprecated RuleContext methods ([#263](https://github.com/eslint/rewrite/issues/263)) +* remove deprecated `nodeType` property ([#265](https://github.com/eslint/rewrite/issues/265)) +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Bug Fixes + +* remove deprecated `nodeType` property ([#265](https://github.com/eslint/rewrite/issues/265)) ([7d6a2a8](https://github.com/eslint/rewrite/commit/7d6a2a8dfb73203790403dea240669b6ab543340)) +* Remove deprecated RuleContext methods ([#263](https://github.com/eslint/rewrite/issues/263)) ([0455323](https://github.com/eslint/rewrite/commit/0455323682227ba2e219645a49c20085ab76cbf0)) + +## [0.17.0](https://github.com/eslint/rewrite/compare/core-v0.16.0...core-v0.17.0) (2025-10-27) + + +### Features + +* export additional core types ([#304](https://github.com/eslint/rewrite/issues/304)) ([5ccde5b](https://github.com/eslint/rewrite/commit/5ccde5bc9442c572d740c063fcb50392bf13c3db)) + + +### Bug Fixes + +* require `fix` in suggestion objects ([#298](https://github.com/eslint/rewrite/issues/298)) ([02bac50](https://github.com/eslint/rewrite/commit/02bac50b8a053f12a97afbe65b126ccd2c469d9e)) + ## [0.16.0](https://github.com/eslint/rewrite/compare/core-v0.15.2...core-v0.16.0) (2025-09-16) diff --git a/packages/core/README.md b/packages/core/README.md index 28f216df3..700abb165 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -20,9 +20,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/core/jsr.json b/packages/core/jsr.json index ea9532062..57e3d3bea 100644 --- a/packages/core/jsr.json +++ b/packages/core/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/core", - "version": "0.16.0", + "version": "1.0.0", "exports": "./dist/esm/types.d.ts", "publish": { "include": [ diff --git a/packages/core/package.json b/packages/core/package.json index 999513124..0220d6cbe 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/core", - "version": "0.16.0", + "version": "1.0.0", "description": "Runtime-agnostic core of ESLint", "type": "module", "types": "./dist/esm/types.d.ts", @@ -44,6 +44,6 @@ "json-schema": "^0.4.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 8a042fffb..95604e70d 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -303,67 +303,31 @@ export interface RuleContext< */ cwd: string; - /** - * Returns the current working directory for the session. - * @deprecated Use `cwd` instead. - */ - getCwd(): string; - /** * The filename of the file being linted. */ filename: string; - /** - * Returns the filename of the file being linted. - * @deprecated Use `filename` instead. - */ - getFilename(): string; - /** * The physical filename of the file being linted. */ physicalFilename: string; - /** - * Returns the physical filename of the file being linted. - * @deprecated Use `physicalFilename` instead. - */ - getPhysicalFilename(): string; - /** * The source code object that the rule is running on. */ sourceCode: Options["Code"]; - /** - * Returns the source code object that the rule is running on. - * @deprecated Use `sourceCode` instead. - */ - getSourceCode(): Options["Code"]; - /** * Shared settings for the configuration. */ settings: SettingsConfig; - /** - * Parser-specific options for the configuration. - * @deprecated Use `languageOptions.parserOptions` instead. - */ - parserOptions: Record; - /** * The language options for the configuration. */ languageOptions: Options["LangOptions"]; - /** - * The CommonJS path to the parser used while parsing this file. - * @deprecated No longer used. - */ - parserPath: string | undefined; - /** * The rule ID. */ @@ -479,15 +443,15 @@ export interface RuleTextEdit { * @param fixer The text editor to apply the fix. * @returns The fix(es) for the violation. */ -type RuleFixer = ( +export type RuleFixer = ( fixer: RuleTextEditor, ) => RuleTextEdit | Iterable | null; -interface ViolationReportBase { +export interface ViolationReportBase { /** * The data to insert into the message. */ - data?: Record | undefined; + data?: Record | undefined; /** * The fix to be applied for the violation. @@ -501,10 +465,10 @@ interface ViolationReportBase { suggest?: SuggestedEdit[] | null | undefined; } -type ViolationMessage = +export type ViolationMessage = | { message: string } | { messageId: MessageIds }; -type ViolationLocation = +export type ViolationLocation = | { loc: SourceLocation | Position } | { node: Node }; @@ -517,19 +481,19 @@ export type ViolationReport< // #region Suggestions -interface SuggestedEditBase { +export interface SuggestedEditBase { /** * The data to insert into the message. */ - data?: Record | undefined; + data?: Record | undefined; /** * The fix to be applied for the suggestion. */ - fix?: RuleFixer | null | undefined; + fix: RuleFixer; } -type SuggestionMessage = { desc: string } | { messageId: string }; +export type SuggestionMessage = { desc: string } | { messageId: string }; /** * A suggested edit for a rule violation. @@ -539,7 +503,7 @@ export type SuggestedEdit = SuggestedEditBase & SuggestionMessage; /** * The normalized version of a lint suggestion. */ -interface LintSuggestion { +export interface LintSuggestion { /** A short description. */ desc: string; @@ -575,12 +539,6 @@ export interface LintMessage { /** The ID of the message in the rule's meta. */ messageId?: string | undefined; - /** - * Type of node. - * @deprecated `nodeType` is deprecated and will be removed in the next major version. - */ - nodeType?: string | undefined; - /** If `true` then this is a fatal error. */ fatal?: true | undefined; @@ -904,7 +862,7 @@ export type EcmaVersion = * The type of JavaScript source code. * @deprecated Only supported in legacy eslintrc config format. */ -type JavaScriptSourceType = "script" | "module" | "commonjs"; +export type JavaScriptSourceType = "script" | "module" | "commonjs"; /** * Parser options. @@ -974,7 +932,7 @@ export interface EnvironmentConfig { /** * A configuration object that may have a `rules` block. */ -interface HasRules { +export interface HasRules { rules?: Partial | undefined; } @@ -983,7 +941,7 @@ interface HasRules { * * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/) */ -interface BaseConfig< +export interface BaseConfig< Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules, > extends HasRules { diff --git a/packages/core/tests/types/types.test.ts b/packages/core/tests/types/types.test.ts index eb1122ace..14935c2fe 100644 --- a/packages/core/tests/types/types.test.ts +++ b/packages/core/tests/types/types.test.ts @@ -298,6 +298,7 @@ const testRule: RuleDefinition<{ start: { line: node.start, column: 1 }, end: { line: node.start + 1, column: Infinity }, }, + data: undefined, fix(fixer: RuleTextEditor): RuleTextEdit { return fixer.replaceText( node, @@ -318,6 +319,12 @@ const testRule: RuleDefinition<{ suggest: [ { messageId: "Bar", + data: { + foo: "foo", + bar: 1, + baz: true, + }, + // @ts-expect-error -- 'fix' is required in suggestion objects fix: null, }, ], @@ -328,6 +335,11 @@ const testRule: RuleDefinition<{ context.report({ message: "This baz is foobar", loc: { line: node.start, column: 1 }, + data: { + foo: "foo", + bar: 1, + baz: true, + }, fix: null, suggest: null, }); diff --git a/packages/mcp/CHANGELOG.md b/packages/mcp/CHANGELOG.md index ed1ddf274..5de7eb399 100644 --- a/packages/mcp/CHANGELOG.md +++ b/packages/mcp/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [0.2.0](https://github.com/eslint/rewrite/compare/mcp-v0.1.1...mcp-v0.2.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + ## [0.1.1](https://github.com/eslint/rewrite/compare/mcp-v0.1.0...mcp-v0.1.1) (2025-07-30) diff --git a/packages/mcp/README.md b/packages/mcp/README.md index 7de744b74..aa68dcd3d 100644 --- a/packages/mcp/README.md +++ b/packages/mcp/README.md @@ -34,9 +34,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/mcp/package.json b/packages/mcp/package.json index 1aef84829..7227000f6 100644 --- a/packages/mcp/package.json +++ b/packages/mcp/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/mcp", - "version": "0.1.1", + "version": "0.2.0", "description": "MCP server for ESLint", "type": "module", "bin": "./src/mcp-cli.js", @@ -33,14 +33,15 @@ }, "homepage": "https://github.com/eslint/rewrite/tree/main/packages/mcp#readme", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.11.0", - "eslint": "^9.26.0", + "@modelcontextprotocol/sdk": "^1.22.0", + "eslint": "^9.39.1", "zod": "^3.24.4" }, "devDependencies": { + "@cfworker/json-schema": "^4.1.1", "@types/node": "^24.7.2" } } diff --git a/packages/mcp/src/mcp-server.js b/packages/mcp/src/mcp-server.js index af3604cf6..554b85adc 100644 --- a/packages/mcp/src/mcp-server.js +++ b/packages/mcp/src/mcp-server.js @@ -17,7 +17,7 @@ import { ESLint } from "eslint"; const mcpServer = new McpServer({ name: "ESLint", - version: "0.1.1", // x-release-please-version + version: "0.2.0", // x-release-please-version }); // Important: Cursor throws an error when `describe()` is used in the schema. diff --git a/packages/mcp/tests/mcp-server.test.js b/packages/mcp/tests/mcp-server.test.js index d7be975a2..fdc6088fb 100644 --- a/packages/mcp/tests/mcp-server.test.js +++ b/packages/mcp/tests/mcp-server.test.js @@ -23,8 +23,6 @@ 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: { diff --git a/packages/migrate-config/CHANGELOG.md b/packages/migrate-config/CHANGELOG.md index ef579b46e..ff216a1d1 100644 --- a/packages/migrate-config/CHANGELOG.md +++ b/packages/migrate-config/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## [2.0.0](https://github.com/eslint/rewrite/compare/migrate-config-v1.6.1...migrate-config-v2.0.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/compat bumped from ^1.4.1 to ^2.0.0 + * devDependencies + * @eslint/core bumped from ^0.17.0 to ^1.0.0 + +## [1.6.1](https://github.com/eslint/rewrite/compare/migrate-config-v1.6.0...migrate-config-v1.6.1) (2025-10-27) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/compat bumped from ^1.4.0 to ^1.4.1 + * devDependencies + * @eslint/core bumped from ^0.16.0 to ^0.17.0 + ## [1.6.0](https://github.com/eslint/rewrite/compare/migrate-config-v1.5.3...migrate-config-v1.6.0) (2025-09-16) diff --git a/packages/migrate-config/README.md b/packages/migrate-config/README.md index 6bb9f4b90..69601014c 100644 --- a/packages/migrate-config/README.md +++ b/packages/migrate-config/README.md @@ -101,9 +101,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/migrate-config/package.json b/packages/migrate-config/package.json index d988add22..171746973 100644 --- a/packages/migrate-config/package.json +++ b/packages/migrate-config/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/migrate-config", - "version": "1.6.0", + "version": "2.0.0", "description": "Configuration migration for ESLint", "type": "module", "bin": { @@ -39,17 +39,17 @@ }, "homepage": "https://github.com/eslint/rewrite/tree/main/packages/migrate-config#readme", "devDependencies": { - "@eslint/core": "^0.16.0", + "@eslint/core": "^1.0.0", "eslint": "^9.27.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "dependencies": { - "@eslint/compat": "^1.4.0", - "@eslint/eslintrc": "^3.1.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.1", "camelcase": "^8.0.0", - "espree": "^10.3.0", + "espree": "^10.4.0", "recast": "^0.23.7" } } diff --git a/packages/migrate-config/src/migrate-config-cli.js b/packages/migrate-config/src/migrate-config-cli.js index b2802ab91..c881de639 100755 --- a/packages/migrate-config/src/migrate-config-cli.js +++ b/packages/migrate-config/src/migrate-config-cli.js @@ -23,6 +23,7 @@ import fsp from "node:fs/promises"; import path from "node:path"; import { migrateConfig, migrateJSConfig } from "./migrate-config.js"; +// @ts-ignore: No types available import { Legacy } from "@eslint/eslintrc"; //----------------------------------------------------------------------------- diff --git a/packages/migrate-config/src/migrate-config.js b/packages/migrate-config/src/migrate-config.js index 901bdcf42..b1c33fd7b 100644 --- a/packages/migrate-config/src/migrate-config.js +++ b/packages/migrate-config/src/migrate-config.js @@ -8,6 +8,7 @@ //----------------------------------------------------------------------------- import * as recast from "recast"; +// @ts-ignore: No types available import { Legacy } from "@eslint/eslintrc"; import camelCase from "camelcase"; import pluginsNeedingCompat from "./compat-plugins.js"; diff --git a/packages/object-schema/CHANGELOG.md b/packages/object-schema/CHANGELOG.md index 7644858b9..736a27e8d 100644 --- a/packages/object-schema/CHANGELOG.md +++ b/packages/object-schema/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [3.0.0](https://github.com/eslint/rewrite/compare/object-schema-v2.1.7...object-schema-v3.0.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + ## [2.1.7](https://github.com/eslint/rewrite/compare/object-schema-v2.1.6...object-schema-v2.1.7) (2025-10-17) diff --git a/packages/object-schema/README.md b/packages/object-schema/README.md index edf6eb867..ecd0835c8 100644 --- a/packages/object-schema/README.md +++ b/packages/object-schema/README.md @@ -233,9 +233,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/object-schema/jsr.json b/packages/object-schema/jsr.json index c770880af..7d958927c 100644 --- a/packages/object-schema/jsr.json +++ b/packages/object-schema/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/object-schema", - "version": "2.1.7", + "version": "3.0.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/object-schema/package.json b/packages/object-schema/package.json index f5981d2f0..9944a0c2e 100644 --- a/packages/object-schema/package.json +++ b/packages/object-schema/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/object-schema", - "version": "2.1.7", + "version": "3.0.0", "description": "An object schema merger/validator", "type": "module", "main": "dist/esm/index.js", @@ -54,6 +54,6 @@ "rollup-plugin-copy": "^3.5.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/packages/plugin-kit/CHANGELOG.md b/packages/plugin-kit/CHANGELOG.md index 7156e3344..30969659a 100644 --- a/packages/plugin-kit/CHANGELOG.md +++ b/packages/plugin-kit/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [0.5.0](https://github.com/eslint/rewrite/compare/plugin-kit-v0.4.1...plugin-kit-v0.5.0) (2025-11-14) + + +### ⚠ BREAKING CHANGES + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) + +### Features + +* Require Node.js ^20.19.0 || ^22.13.0 || >=24 ([#297](https://github.com/eslint/rewrite/issues/297)) ([acc623c](https://github.com/eslint/rewrite/commit/acc623c807bf8237a26b18291f04dd99e4e4981a)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.17.0 to ^1.0.0 + +## [0.4.1](https://github.com/eslint/rewrite/compare/plugin-kit-v0.4.0...plugin-kit-v0.4.1) (2025-10-27) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @eslint/core bumped from ^0.16.0 to ^0.17.0 + ## [0.4.0](https://github.com/eslint/rewrite/compare/plugin-kit-v0.3.5...plugin-kit-v0.4.0) (2025-09-16) diff --git a/packages/plugin-kit/README.md b/packages/plugin-kit/README.md index a550f34ac..52da7a968 100644 --- a/packages/plugin-kit/README.md +++ b/packages/plugin-kit/README.md @@ -264,9 +264,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Qlty Software Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Cybozu Syntax Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/plugin-kit/jsr.json b/packages/plugin-kit/jsr.json index 58464962e..8a3a66e36 100644 --- a/packages/plugin-kit/jsr.json +++ b/packages/plugin-kit/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/plugin-kit", - "version": "0.4.0", + "version": "0.5.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/plugin-kit/package.json b/packages/plugin-kit/package.json index 03dc6f23c..fd1017a4a 100644 --- a/packages/plugin-kit/package.json +++ b/packages/plugin-kit/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/plugin-kit", - "version": "0.4.0", + "version": "0.5.0", "description": "Utilities for building ESLint plugins.", "author": "Nicholas C. Zakas", "type": "module", @@ -48,7 +48,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.16.0", + "@eslint/core": "^1.0.0", "levn": "^0.4.1" }, "devDependencies": { @@ -56,6 +56,6 @@ "rollup-plugin-copy": "^3.5.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } } diff --git a/release-please-config.json b/release-please-config.json index 51eb9b1b3..a3f48e976 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -37,6 +37,7 @@ }, "packages/core": { "release-type": "node", + "release-as": "1.0.0", "extra-files": [ { "type": "json", diff --git a/templates/package/package.json b/templates/package/package.json index 4bee178ec..0fc4d9760 100644 --- a/templates/package/package.json +++ b/templates/package/package.json @@ -47,11 +47,11 @@ }, "homepage": "https://github.com/eslint/rewrite/tree/main/packages/<%= name %>#readme", "devDependencies": { - "@eslint/core": "^0.16.0", + "@eslint/core": "^0.17.0", "eslint": "^9.27.0", "rollup-plugin-copy": "^3.5.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }