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

CLI Ingore bugs #13135

Open
fisker opened this issue Jul 19, 2022 · 1 comment
Open

CLI Ingore bugs #13135

fisker opened this issue Jul 19, 2022 · 1 comment
Labels
area:cli Issues with Prettier's Command Line Interface area:ignore .prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug type:bug Issues identifying ugly output, or a defect in the program

Comments

@fisker
Copy link
Member

fisker commented Jul 19, 2022

Environments:

  • Prettier Version: 2.7.1
  • Running Prettier via:
  • Runtime:
  • Operating System:
  • Prettier plugins (if any):

Steps to reproduce:

During #12859, I found two possible issues.

Problem 1:

# .prettierignore
/tests/integration/plugins/
!/tests/integration/plugins/extensions/plugin.cjs
$ npx prettier --file-info tests/integration/plugins/extensions/plugin.cjs
{ "ignored": true, "inferredParser": null }
# .prettierignore
/tests/integration/plugins/**/*
!/tests/integration/plugins/extensions/plugin.cjs
$ npx prettier --file-info tests/integration/plugins/extensions/plugin.cjs
{ "ignored": false, "inferredParser": "babel" }

But maybe this is expected, for faster glob?

Problem 2:

I can't find a way to format files inside node_modules

$ npx prettier --file-info tests/integration/plugins/automatic/node_modules/@prettier/plugin-foo/index.js
{ "ignored": true, "inferredParser": null }

$ npx prettier --file-info tests/integration/plugins/automatic/node_modules/@prettier/plugin-foo/index.js --with-node-modules
{ "ignored": true, "inferredParser": null }

Expected behavior:

Maybe "Problem 1" should work the same with or without **/*

Problem 2: when running --with-node-modules should be able to format that file.

@fisker fisker added area:cli Issues with Prettier's Command Line Interface status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug area:ignore .prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on type:bug Issues identifying ugly output, or a defect in the program labels Jul 19, 2022
@doubleforte
Copy link

# .prettierignore
wp-content/**/*
!wp-content/themes/**/*

I also can't get this to work. I would expect that anything inside the wp-content to be ignored, but make an exception for themes. As is, themes is also ignored. Is this a bug or do I have the wrong syntax?

@fisker fisker changed the title Ingore bugs CLI Ingore bugs Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:cli Issues with Prettier's Command Line Interface area:ignore .prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

2 participants