prettier/prettier

Passing in an ignored file should emit a warning

Open

#15.700 aberto em 21 de nov. de 2023

Ver no GitHub
 (2 comments) (3 reactions) (0 assignees)JavaScript (51.868 stars) (4.716 forks)batch import
area:clihelp wanted

Description

Environments:

  • Prettier Version: 3.1.0
  • Running Prettier via: CLI
  • Runtime: All
  • Operating System: All
  • Prettier plugins (if any):

Steps to reproduce:

StackBlitz: https://stackblitz.com/edit/stackblitz-starters-gw5hhu?file=package.json

  1. Run npm run node_modules to demonstrate that prettier does not warn that the file in node_modules is ignored. It actually doesn't understand the file path.

[error] No matching files. Patterns: ./node_modules/vue/dist/vue.global.prod.js

  1. Run npm run dist to demonstrate that prettier will ignore the file in the .gitignored directory, but still output the original code without warning that an ignored file was passed in

Expected behavior:

For prettier to inform the user that the code was not prettified because the file path matched the ignore list

It should also warn if the path is in node_modules, that the user should set --with-node-modules.

Actual behavior: No warnings

Guia do colaborador