Commit 74a6632
committed
chore: infer prettier parser from file extension
Issue
=====
The prettier parser was set to `typescript` in the `.prettierrc.json` file. Because prettier was
used for multiple files types, it caused errors when formatting files that were not TypeScript.
Here is an example:
```sh
README.md
[error] README.md: SyntaxError: Invalid character. (1:1)
[error] > 1 | # Neovim node.js client
[error] | ^
[error] 2 |
[error] 3 | | CI (node >= 14, Linux/macOS/Windows) | Coverage | npm |
[error] 4 | |----------------------------|----------|-----|
```
This seems to cause the build to fail as of the most recent commit
7488014
Solution
========
Automatically infer the parser based on the file extension.
References:
- https://prettier.io/docs/en/configuration.html#setting-the-parserdocsenoptionshtmlparser-option
To make the build pass, run `npx prettier --write .` to format all files. I think it's best that
someone else does this, as it will change the formatting of many files (currently 43), and reviewing
them is very difficult.1 parent 8702dcd commit 74a6632
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
0 commit comments