Skip to content

Commit 74a6632

Browse files
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

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

.prettierrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"tabWidth": 2,
33
"trailingComma": "es5",
4-
"parser": "typescript",
54
"printWidth": 100,
65
"singleQuote": true,
76
"arrowParens": "avoid"

0 commit comments

Comments
 (0)