Skip to content

Negated/commented Minimatch expressions are not working #1024

@dokmic

Description

@dokmic

As from the Minimatch documentation, it should be possible to use ! at the beginning of the pattern to negate that. Same works for # which can deactivate the whole pattern.

The issue has been introduced in #742 here.

Expected Behavior

  • Exclude patterns starting with ! (e.g. !src/**/api.ts, !/home/user/src/**/api.ts) should exclude everything except the glob following after that.
  • Exclude patterns starting with # (e.g. #src/**/api.ts) should do nothing.

Actual Behavior

  • Exclude patterns starting with ! (e.g. !src/**/api.ts) are being treated as relative paths (/home/user/projects/!src/**/api.ts).
  • Exclude patterns starting with # (e.g. #src/**/api.ts) are being treated as relative paths (/home/user/projects/#src/**/api.ts).

Steps to reproduce the bug

Use patterns with the negation in your typedoc configuration:

  "typedocOptions": {
    "exclude": "!**/*.mock.ts",
    "externalPattern": "!src/**/*.ts",
    "excludeExternals": true
  }

Environment

  • Typedoc version: v0.14.0; v0.14.1; v0.14.2; v0.15.0-0
  • Node.js version: any
  • OS: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions