Skip to content

[Windows] Error with file name containing square brackets and dots when running 'prettier --write' #15426

@saoudi-h

Description

@saoudi-h

Environments:

  • Prettier Version: 3.0.3
  • Running Prettier via: CLI
  • Runtime: Node.js v18.15
  • Operating System: Windows
  • Prettier plugins (if any): No

Steps to reproduce:

1- Create a file with the name [...nextauth].ts at the root of your project (mine is a nextjs project).
2- Run the command prettier --write with this file as an argument.

Expected behavior:
I expected that running the 'prettier --write' command with a file named '[...nextauth].ts' would execute without errors, formatting the file as intended.

Actual behavior:
Observe the following error: "Explicitly specified file was ignored due to negative glob patterns."

Metadata

Metadata

Assignees

Labels

area:cliIssues with Prettier's Command Line Interfacehelp wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions