Fix empty Prettier config file create command (#15367)
This commit is contained in:
1 parent
bf7d90ae84
commit
f7959cccbf
2 files changed
+14
-4
No files matched your search
+7
-2
@@ -28,10 +28,15 @@ pnpm add --save-dev --save-exact prettier
|
||||
|
||||
Then, create an empty config file to let editors and other tools know you are using Prettier:
|
||||
|
||||
<!-- Note: `echo "{}" > .prettierrc.json` would result in `"{}"<SPACE>` on Windows. The below version works in cmd.exe, bash, zsh, fish. -->
|
||||
<!--
|
||||
Note:
|
||||
- `echo "{}" > .prettierrc` would result in `"{}"<SPACE>` on Windows.
|
||||
- `echo {}> .prettierrc` would result the file in UTF-16LE encoding in PowerShell.
|
||||
The below version works in cmd.exe, bash, zsh, fish, PowerShell.
|
||||
-->
|
||||
|
||||
```bash
|
||||
echo {}> .prettierrc.json
|
||||
node --eval "fs.writeFileSync('.prettierrc','{}\n')"
|
||||
```
|
||||
|
||||
Next, create a [.prettierignore](ignore.md) file to let the Prettier CLI and editors know which files to _not_ format. Here’s an example:
|
||||
|
||||
Reference in new issue
Block a user