Prettier VSCode JSON Format Error
I'm trying to format a JSON file in VS Code using Prettier, however, I have yet to successfully format any JSON files. I searched for a solution using Google, but was unable to return any useful search results. What I would like to know how to do, is to be able to fix the error I am getting, so I can format a JSON file using the VSCode Prettier extension. If I cant figure that out, I would settle for knowing how to disable Prettier, and format JSON using the "VS-Code Language Features" that come with VS Code 'out-of-the-box'.
Below is my .prettierrc
Configuration
{
"parser": "typescript",
"useTabs": false,
"tabWidth": 2,
"printWidth": 120,
"trailingComma": "none",
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"endOfLine": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true
}
Here is the JSON File I am Attempting to Format
{
"Requester": {
"City": "USBOS",
"PostCode": "02143"
}
}
And this is the Prettier Error that's Printing in the Console
> "ERROR" -
> 7:14:26 AM] Error formatting document. ';' expected. (2:12) 1 | {
> 2 | "Requester": {
> | ^ 3 | "City": "USBOS", 4 | "PostCode": "02143" 5 | }, SyntaxError: ';' expected. (2:12) 1 | {
> 2 | "Requester": {
> | ^ 3 | "City": "USBOS", 4 | "PostCode": "02143" 5 | },
> at t (C:\JSONTest\node_modules\prettier\parser-typescript.js:1:285)
> at Object.parse (C:\JSONTest\node_modules\prettier\parser-typescript.js:14:180461)
> at Object.parse (C:\JSONTest\node_modules\prettier\index.js:9739:19)
> at coreFormat (C:\JSONTest\node_modules\prettier\index.js:13252:23)
> at format (C:\JSONTest\node_modules\prettier\index.js:13510:73)
> at formatWithCursor (C:\JSONTest\node_modules\prettier\index.js:13526:12)
> at C:\JSONTest\node_modules\prettier\index.js:44207:15
> at Object.format (C:\JSONTest\node_modules\prettier\index.js:44226:12)
> at c:\Users\mmartins.BROKER\.vscode\extensions\esbenp.prettier-vscode-3.18.0\src\PrettierEditService.ts:382:30
> at t.default.safeExecution (c:\Users\mmartins.BROKER\.vscode\extensions\esbenp.prettier-vscode-3.18.0\src\PrettierEditService.ts:414:27)
> at t.default.<anonymous> (c:\Users\mmartins.BROKER\.vscode\extensions\esbenp.prettier-vscode-3.18.0\src\PrettierEditService.ts:381:17)
> at Generator.next (<anonymous>)
> at s (c:\Users\mmartins.BROKER\.vscode\extensions\esbenp.?
> prettier-vscode-3.18.0\dist\extension.js:1:346242)