Skip to content

Bug: not all override patterns containing ".." should be rejected #16038

@fasttime

Description

@fasttime

Environment

Node version: 18.4.0
npm version: 8.12.1
Local ESLint version: 8.18.0

What parser are you using?

Default (Espree)

What did you do?

Configuration:

{
    "overrides": [
        {
            "files": [
                "A...Z.js"
            ]
        }
    ]
}

What did you expect to happen?

I was expecting the config to be accepted.

What actually happened?

The configuration above results in an error:

Error: Invalid override pattern (expected relative path not containing '..'): A...Z.js

There is no reason to forbid override patterns containing two or more dots, unless when they refer to a parent directory, i.e. when they constitute a path segment, either found at the start or at the end of the pattern or surrounded by a path separator (/ or \).

Not sure if this classifies as a bug or an improvement. If it's too late to change the current behavior, it would be great to have this fixed in the new config system.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

archived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyrepro:neededThis issue should include a reproducible example

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions