From 75ff4cbfa1e7a61ba6ca9fb07b13e7fffc9afc92 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Sat, 15 Nov 2025 14:20:48 +0100 Subject: [PATCH 1/3] chore: remove `release-as` setting from Release Please config (#323) --- release-please-config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index a3f48e976..51eb9b1b3 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -37,7 +37,6 @@ }, "packages/core": { "release-type": "node", - "release-as": "1.0.0", "extra-files": [ { "type": "json", From 8b9247004d76aef90da7c211902a0ca118d4b47f Mon Sep 17 00:00:00 2001 From: Pixel998 Date: Mon, 17 Nov 2025 11:18:45 +0300 Subject: [PATCH 2/3] feat!: update minimatch (#273) --- packages/config-array/package.json | 3 +- packages/config-array/src/config-array.js | 13 +- .../config-array/tests/config-array.test.js | 195 ++++++++++++++++++ 3 files changed, 201 insertions(+), 10 deletions(-) diff --git a/packages/config-array/package.json b/packages/config-array/package.json index 9d16ddbe9..3f2614ec3 100644 --- a/packages/config-array/package.json +++ b/packages/config-array/package.json @@ -51,11 +51,10 @@ "dependencies": { "@eslint/object-schema": "^3.0.0", "debug": "^4.3.1", - "minimatch": "^3.1.2" + "minimatch": "^10.1.1" }, "devDependencies": { "@jsr/std__path": "^1.0.4", - "@types/minimatch": "^3.0.5", "rollup-plugin-copy": "^3.5.0" }, "engines": { diff --git a/packages/config-array/src/config-array.js b/packages/config-array/src/config-array.js index cbd373ba8..6163ee976 100644 --- a/packages/config-array/src/config-array.js +++ b/packages/config-array/src/config-array.js @@ -9,7 +9,7 @@ import * as posixPath from "@jsr/std__path/posix"; import * as windowsPath from "@jsr/std__path/windows"; -import minimatch from "minimatch"; +import { Minimatch } from "minimatch"; import createDebug from "debug"; import { ObjectSchema } from "@eslint/object-schema"; @@ -21,8 +21,7 @@ import { filesAndIgnoresSchema } from "./files-and-ignores-schema.js"; //------------------------------------------------------------------------------ /** @typedef {import("./types.ts").ConfigObject} ConfigObject */ -/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */ -/** @typedef {import("minimatch").IMinimatch} IMinimatch */ +/** @typedef {import("minimatch").MinimatchOptions} MinimatchOptions */ /** @import * as PathImpl from "@jsr/std__path" */ /* @@ -38,29 +37,27 @@ import { filesAndIgnoresSchema } from "./files-and-ignores-schema.js"; // Helpers //------------------------------------------------------------------------------ -const Minimatch = minimatch.Minimatch; const debug = createDebug("@eslint/config-array"); /** * A cache for minimatch instances. - * @type {Map} + * @type {Map} */ const minimatchCache = new Map(); /** * A cache for negated minimatch instances. - * @type {Map} + * @type {Map} */ const negatedMinimatchCache = new Map(); /** * Options to use with minimatch. - * @type {Object} + * @type {MinimatchOptions} */ const MINIMATCH_OPTIONS = { // matchBase: true, dot: true, - allowWindowsEscape: true, }; /** diff --git a/packages/config-array/tests/config-array.test.js b/packages/config-array/tests/config-array.test.js index 11fab3d51..707dc8e13 100644 --- a/packages/config-array/tests/config-array.test.js +++ b/packages/config-array/tests/config-array.test.js @@ -1807,6 +1807,136 @@ describe("ConfigArray", () => { }); }); + describe("POSIX character classes", () => { + it("should match `files` patterns using [[:digit:]]", () => { + configs = new ConfigArray( + [ + { + files: ["src/file[[:digit:]].js"], + defs: { severity: "error" }, + }, + ], + { basePath, schema }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfig("src/file1.js").defs.severity, + "error", + ); + assert.strictEqual( + configs.getConfig("src/file9.js").defs.severity, + "error", + ); + assert.strictEqual( + configs.getConfig("src/filea.js"), + undefined, + ); + assert.strictEqual( + configs.getConfig("src/file10.js"), + undefined, + ); + }); + + it("should match `files` patterns using [[:alpha:]], [[:lower:]], and [[:upper:]]", () => { + configs = new ConfigArray( + [ + { + files: ["alpha_[[:alpha:]].js"], + defs: { kind: "alpha" }, + }, + { + files: ["lower_[[:lower:]].js"], + defs: { kind: "lower" }, + }, + { + files: ["upper_[[:upper:]].js"], + defs: { kind: "upper" }, + }, + ], + { basePath, schema }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfig("alpha_a.js").defs.kind, + "alpha", + ); + assert.strictEqual( + configs.getConfig("alpha_Z.js").defs.kind, + "alpha", + ); + assert.strictEqual( + configs.getConfig("lower_a.js").defs.kind, + "lower", + ); + assert.strictEqual( + configs.getConfig("lower_Z.js"), + undefined, + ); + assert.strictEqual( + configs.getConfig("upper_Z.js").defs.kind, + "upper", + ); + assert.strictEqual( + configs.getConfig("upper_a.js"), + undefined, + ); + }); + + it("should honor POSIX classes inside `ignores` patterns", () => { + configs = new ConfigArray( + [ + { + files: ["**/*.js"], + ignores: ["src/[[:digit:]]/**"], + defs: { severity: "error" }, + }, + ], + { basePath, schema }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfig("src/3/file.js"), + undefined, + ); + assert.strictEqual( + configs.getConfig("src/a/file.js").defs.severity, + "error", + ); + }); + + it("should honor POSIX classes in global `ignores` patterns", () => { + configs = new ConfigArray( + [ + { + ignores: ["[[:upper:]]"], + }, + { + files: ["**/*.js"], + defs: { severity: "error" }, + }, + ], + { basePath, schema }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfig("A/file.js"), + undefined, + ); + assert.strictEqual( + configs.getConfig("a/file.js").defs.severity, + "error", + ); + }); + }); + describe("config objects with `basePath` property", () => { it("should apply config object without `files` or `ignores` to the `basePath` directory and its subdirectories only (relative paths)", () => { configs = new ConfigArray( @@ -3010,6 +3140,71 @@ describe("ConfigArray", () => { }); }); + describe("POSIX character classes", () => { + it("should return statuses for [[:digit:]] in `files` patterns", () => { + configs = new ConfigArray( + [{ files: ["src/file[[:digit:]].js"] }], + { basePath }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfigStatus("src/file1.js"), + "matched", + ); + assert.strictEqual( + configs.getConfigStatus("src/filea.js"), + "unconfigured", + ); + assert.strictEqual( + configs.getConfigStatus("src/file10.js"), + "unconfigured", + ); + }); + + it("should return 'unconfigured' for `ignores` using POSIX classes", () => { + configs = new ConfigArray( + [ + { + files: ["**/*.js"], + ignores: ["src/[[:digit:]]/**"], + }, + ], + { basePath }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfigStatus("src/3/file.js"), + "unconfigured", + ); + assert.strictEqual( + configs.getConfigStatus("src/a/file.js"), + "matched", + ); + }); + + it("should return 'ignored' for global `ignores` using POSIX classes", () => { + configs = new ConfigArray( + [{ ignores: ["[[:upper:]]"] }, { files: ["**/*.js"] }], + { basePath }, + ); + + configs.normalizeSync(); + + assert.strictEqual( + configs.getConfigStatus("A/file.js"), + "ignored", + ); + assert.strictEqual( + configs.getConfigStatus("a/file.js"), + "matched", + ); + }); + }); + describe("Windows paths", () => { it('should return "matched" for a file in the base directory with different capitalization', () => { configs = new ConfigArray([{ files: ["**/*.js"] }], { From f2a3700498b14e994d1f8ee830aa219416b9e5e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 09:59:30 +0100 Subject: [PATCH 3/3] chore: release main (#325) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- packages/config-array/CHANGELOG.md | 11 +++++++++++ packages/config-array/jsr.json | 2 +- packages/config-array/package.json | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d488d19c4..d278ad940 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { "packages/compat": "2.0.0", - "packages/config-array": "0.22.0", + "packages/config-array": "0.23.0", "packages/config-helpers": "0.5.0", "packages/core": "1.0.0", "packages/mcp": "0.2.0", diff --git a/packages/config-array/CHANGELOG.md b/packages/config-array/CHANGELOG.md index 019c1db54..0df8b3f09 100644 --- a/packages/config-array/CHANGELOG.md +++ b/packages/config-array/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [0.23.0](https://github.com/eslint/rewrite/compare/config-array-v0.22.0...config-array-v0.23.0) (2025-11-17) + + +### ⚠ BREAKING CHANGES + +* update minimatch ([#273](https://github.com/eslint/rewrite/issues/273)) + +### Features + +* update minimatch ([#273](https://github.com/eslint/rewrite/issues/273)) ([8b92470](https://github.com/eslint/rewrite/commit/8b9247004d76aef90da7c211902a0ca118d4b47f)) + ## [0.22.0](https://github.com/eslint/rewrite/compare/config-array-v0.21.1...config-array-v0.22.0) (2025-11-14) diff --git a/packages/config-array/jsr.json b/packages/config-array/jsr.json index ad5bc4619..a1e10cff4 100644 --- a/packages/config-array/jsr.json +++ b/packages/config-array/jsr.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-array", - "version": "0.22.0", + "version": "0.23.0", "exports": "./dist/esm/index.js", "publish": { "include": [ diff --git a/packages/config-array/package.json b/packages/config-array/package.json index 3f2614ec3..edc080d21 100644 --- a/packages/config-array/package.json +++ b/packages/config-array/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/config-array", - "version": "0.22.0", + "version": "0.23.0", "description": "General purpose glob-based configuration matching.", "author": "Nicholas C. Zakas", "type": "module",