Skip to content

Issue with ignoring files or folders #86

@ishmael

Description

@ishmael

Given the following configuration:

{
    "ignore": {
        "rules": ["react/no-danger"],
        "files": ["/resources/js/components/ui/**", "/resources/js/marketing/**"]
    },
    "verbose": true
}

those files aren't ignored.

Looking at the source code, I traced it to this line:

Since that adds a ^ it will try to match file path that begin with that but the problem is that here

const normalizedPath = diagnostic.filePath.replace(/\\/g, "/").replace(/^\.\//, "");
the file path includes the absolute path from the disk root, so nothing is ever matched.

I am not sure if adding the ^ to the regex should be removed or if we should replace the file path from the disk root so that it is filtering files from the root of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions