Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore folder pattern does not work when folder has subfolders #51

Open
webpolis opened this issue Oct 15, 2024 · 1 comment
Open

Ignore folder pattern does not work when folder has subfolders #51

webpolis opened this issue Oct 15, 2024 · 1 comment

Comments

@webpolis
Copy link

webpolis commented Oct 15, 2024

Describe the bug

The exclamation mark in the glob pattern is used to exclude some path names from being validated, however it is not working as expected. The projects._index folder in my repo is not ignored, thus eslint gives an error, while the users._index folder is correctly ignored.

I guess this issue may be related with the projects._index folder containing sub folders.

  1:1  error  The folder "projects._index" does not match the "SNAKE_CASE" pattern  check-file/folder-naming-convention

Expected behavior
Ignore all folders matching the ignore pattern

Plugin configuration

      "check-file/folder-naming-convention": [
        "error",
        {
          "app/**/!(_index|[a-z_]+._index|[a-z_]+.$[a-z_]+)/": "SNAKE_CASE"
        }
      ],

I tried as well by adding a * at the end but that makes the others fail as well:

app/**/!(_index|[a-z_]+._index|[a-z_]+.$[a-z_]+)/*

Project structure

app/routes/
├── _index
│   └── route.tsx
├── projects._index
│   ├── new
│   │   └── route.tsx
│   └── route.tsx
└── users._index
    └── route.tsx
@webpolis webpolis changed the title Ignoring folder's pattern does not work when folder has subfolders Ignore folder pattern does not work when folder has subfolders Oct 15, 2024
@dukeluo
Copy link
Owner

dukeluo commented Oct 19, 2024

how about this one?

    "check-file/folder-naming-convention": [
      "error",
      {
        "app/**/!(*._index)": "SNAKE_CASE"
      }
    ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants