Skip to content

Conversation

Pixel998
Copy link
Contributor

@Pixel998 Pixel998 commented Sep 20, 2025

Prerequisites checklist

What is the purpose of this pull request?

This PR updates the minimatch package to the latest version

What changes did you make? (Give an overview)

  • Updated minimatch to v10.0.3
  • Switched to named imports for minimatch, in line with the updated API.
  • Removed the deprecated @types/minimatch package since minimatch now includes its own built-in TypeScript type definitions.

minimatch v10 requires Node.js v20 or higher, so marking this PR as draft until we drop Node.js v18.

Related Issues

Fixes #230
Fixes #66

Is there anything you'd like reviewers to focus on?

@mdjermanovic
Copy link
Member

Can we now remove allowWindowsEscape: true, option, since that behavior should be on by default in minimatch v10?

allowWindowsEscape: true,

@mdjermanovic
Copy link
Member

We should also update minimatch dependency in the eslint package:

https://github.com/eslint/eslint/blob/e1ac05e2fae779e738f85bd47dda1cc2b7099346/package.json#L139

"@eslint/object-schema": "^2.1.6",
"debug": "^4.3.1",
"minimatch": "^3.1.2"
"minimatch": "^10.0.3"
Copy link
Member

Choose a reason for hiding this comment

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

Are there any other breaking changes we should be concerned about in these 7 major versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there are two main breaking changes we need to be aware of beyond the obvious Node.js version bumps and export changes:

1- POSIX character class support (added in v7.3)

Example test that will fail in 3.x but pass in 10.x:

describe("POSIX character classes", () => {
  it("[[:alpha:]] matches alphabetic characters", () => {
    const configs = new ConfigArray(
      [
        {
          files: ["**/[[:alpha:]].js"],
        },
      ],
      { basePath },
    );

    configs.normalizeSync();

    assert.strictEqual(configs.getConfigStatus("a.js"), "matched");
  });
});

2- Pattern simplification with .. segments

Minimatch added an optimizationLevel option that controls how patterns are normalized before matching:

  • 0 → No changes. . and .. must appear literally in both the pattern and the test string.
    Example: a/*/../c matches a/b/../c, but not a/c.
  • 1 (default) → Simplify .. segments when possible.
    Example: ./a/b/../* is simplified to ./a/*, so it matches ./a/c, but not ./a/b/../c.

Example test that will fail in 3.x but pass in 10.x:

describe("Pattern simplification with '..' segments", () => {
  it("'a/b/../*.js' behaves like 'a/*.js'", () => {
    const configs = new ConfigArray(
      [
        {
          files: ["a/b/../*.js"],
        },
      ],
      { basePath },
    );

    configs.normalizeSync();

    assert.strictEqual(configs.getConfigStatus("a/x.js"), "matched");
    assert.strictEqual(configs.getConfigStatus("a/b/x.js"), "unconfigured");
  });

  it("'a/b/../**/*.js' behaves like 'a/**/*.js'", () => {
    const configs = new ConfigArray(
      [
        {
          files: ["a/b/../**/*.js"],
        },
      ],
      { basePath },
    );

    configs.normalizeSync();

    assert.strictEqual(configs.getConfigStatus("a/x/y.js"), "matched");
  });
});

@Pixel998
Copy link
Contributor Author

We should also update minimatch dependency in the eslint package

Yeah, it’s on my todo list — I’ll get to it today or tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

Upgrade minimatch in @eslint/config-array Update minimatch

2 participants