Skip to content

no-restricted-paths no longer supports regular expressions #2123

Closed

Description

On version 2.22.1 I was able to use regular expressions in the paths for a zone, but this no longer works in 2.23.4:

    "import/no-restricted-paths": [
      "error",
      {
        "zones": [
          {
            "target": "*",
            "from": "src/generated/schema.ts",
            "except": ["src/.*/resolvers.ts"]
          }
        ]
      }
    ]

I suspect it's because of #2090, where the contains-paths dependency was replaced by a custom function.
The way I set up this zone might not really be the intended use case of this rule, but it might break more valid configurations too. Is this something that could be brought back?

Edit: Regex in the except field actually was not supported before, but that would be a nice addition too!

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions