Search code examples
globprettier

How to ignore files with a specific extension with fast-glob?


Prettier is using fast-glob to resolve glob patterns to match the files to format. I would like to include all the files in the current directory but the ones ending with either .php or .html.

I've tried several patterns but none of them is working:

**/*.[^php,html]
**/*.!{php,html}

How can I achieve this behavior?


Solution

  • You can use this pattern:

    **/!(*.php|*.html)