question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI: add a `recursive` option

See original GitHub issue

Environments:

  • Prettier Version: 1.19.1
  • Running Prettier via: CLI
  • Runtime: Node.js v12.5.0
  • Operating System: macOS Cataline 10.15.1

Steps to reproduce:

My request is about a recursive option.

$ prettier --write * only fixes the first-level files and does not read any other files that are in sub-directories.

Expected behavior:

# Reads all sub-directories and first-level files and fixes them.
$ prettier --write --recursive *

Actual behavior:

$ prettier --write *
index.js 84ms

$ tree
.
├── index.js
├── app
│   ├── controllers
│   │   ├── authentication.js
│   │   ├── healthcheck.js
│   │   ├── index.js

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
thorn0commented, Dec 7, 2019

@sregg I guess your shell expands the glob, not Prettier. Try adding quotes around the glob.

1reaction
fberrezcommented, Nov 27, 2019

Your command only works for top- and second- level files (files located in a sub directory).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Recursive option in command line interface - Blueprints
This option improve the command line interface with file's selection in directories recursively. -r, --recursive. Select subdirectories ...
Read more >
recursive or --all parameter to get files in nested folders · Issue ...
Complete the table below with the options used on this command. A short (single character) and long version of the option should be...
Read more >
Why do we need to use the recursive option to remove or copy ...
rm -r : recursively remove subdirectories. The way the rm -r option was implemented at that time, when rm encountered a directory among...
Read more >
Using high-level (s3) commands with the AWS CLI
Use the high-level Amazon S3 commands in the aws s3 namespace to manage buckets and objects using the AWS Command Line Interface (AWS...
Read more >
Add files - Helix Core Command-Line (P4) Guide - Perforce
To add files recursively, use the Helix Server ... wildcard. A similar approach is to use the p4 reconcile -a * command. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found