Questions tagged [jsprettier]

17 questions
6
votes
1 answer

JsPrettier on Sublime text [OSX]

I tried to install auto_format_on_save using JSPrettier on my Sublime text. But everytime i'm saving my file, i get : ------------------ JsPrettier ERROR ------------------ Prettier reported the following error(s): env: node: No such file or…
Louis Lecocq
  • 1,764
  • 3
  • 17
  • 38
5
votes
1 answer

Prettier + eslint line breaks

I am using eslint with VSCode 1.18.1 and the prettier/prettier extension 0.26.0 for VSCode. In my VSCode config I have "prettier.eslintIntegration": true,. My dependencies used to be: "eslint": "^3.19.0", "eslint-config-airbnb-base":…
DaveJ
  • 2,357
  • 6
  • 28
  • 35
4
votes
2 answers

JsPrettier in Sublime 3 does not single quote className

I´m using Sublime Text 3 with JSPrettier to format Javascript and JSX code. I have the following set in my JSPrettier configuration: // If true, will use single instead of double quotes "singleQuote": true Even with that, when formatting the code…
Mendes
  • 17,489
  • 35
  • 150
  • 263
3
votes
2 answers

How can I allow whitespace in JavaScript files?

I'm trying to overwrite Prettier plugin rules without success. I want to allow whitespace in JavaScript files like this: import React, { Component } from 'react'; import { View } from 'react-native'; import { Provider, connect } from…
3
votes
0 answers

VueCLI 3 - Eslint Prettier

I have issues with this Vue project configuration. I'm using prettier and eslint but files don't get the format the way they should. I'm using VS Code as code editor and I have prettier installed with formatting on save. Code Example: async…
Giacomo
  • 1,056
  • 4
  • 16
  • 24
2
votes
1 answer

How to make prettier break all union types?

I want this: type SomeType = Variant1 | Variant2 to always format into this: type SomeType = | Variant1 | Variant2 No matter whether it overflows the specified column width or not.
Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125
1
vote
1 answer

Prettier on VS Code unfolds my code blocks on save . How to prevetn sthis?

I'm using Prettier on VS Code with the editor.formatOnSave enabled. Every time I save my (js)|| (jsx) file and prettier runs it unfolds all my functions. Is there a way to prevent this from happening? I have a large React component and would like to…
1
vote
0 answers

Prettier Format On Save - Visual Studio 2022

Currently using Prettier to sort my imports for JS files. Everything is working as intended, Prettierrc file includes: "importOrder": [ "^components/(.*)$", "^[./]" ], "importOrderSeparation": true, "importOrderSortSpecifiers": true, …
1
vote
0 answers

sublime text - jsprettier: Unable to undestand this error why its showing

I am see this error from Jsprettier ------------------ JsPrettier ERROR ------------------ Prettier reported the following output: [error] src/views/...: SyntaxError: Unexpected token (46:9) [error] 44 | currentTimezone =…
Santhosh
  • 9,965
  • 20
  • 103
  • 243
1
vote
1 answer

Code formatter 'cannot format' JavaScript file

I am using Macbook and suddenly my Prettier in VSCode didn't work and show a message in the bottom bar like this: Here is my settings.json file: "editor.formatOnSave": true, "workbench.colorTheme": "Material Theme Darker", …
1
vote
0 answers

Prettier - Use wildcard

My current prettier script looks like { "prettier": "prettier \"**/*.{js,json,jsx,ts,tsx,md,css,scss,jql,graphql}\"" } and the list of extensions will eventually grow as the prettier support grows... If I try this: { "prettier": "prettier…
Hitmands
  • 13,491
  • 4
  • 34
  • 69
0
votes
0 answers

How do i disable prettierrc from giving a error for snake_case asking to convert it to camelCase?

I am working on a reactJS project and have added prettierrc file to maintain the coding standards. The issue i am facing right now is a few of the identifiers are in snake_case and i need to maintain them in the same way, but prettier is flagging it…
0
votes
1 answer

Prettier adds multiple empty lines after JavaScript blocks wrongely

My prettier is adding extra empty lines after blocks in JavaScript. It is OK after first save and empty line is just one, but after second save it add another line, and after third save it add one more. It not adds more with further saves. Example: …
Saeed Sepehr
  • 93
  • 1
  • 7
0
votes
0 answers

TypeScript / prettier: Fluent interfaces and union types with prettier (using "//")

When I am using fluent interfaces in TypeScript I normally want different method calls on different lines while by default prettier tries to format it in one single line (if not too long). A similar behavior for union types. It seems that prettier…
Natasha
  • 516
  • 7
  • 24
0
votes
1 answer

Sublime Text 3 - Prettier / jsPrettier error: parser.parse is not a function

In Sublime Text 3, I'm attempting to use jsPrettier (which worked fine previously) and getting this error in the console: TypeError: parser.parse is not a function. I've tried reinstalling prettier (globally) and jsPrettier (ST3 package) several…
dangerismycat
  • 824
  • 2
  • 11
  • 18
1
2