Skip to content

Tag: visual-studio-code

Prevent Prettier formating arrow functions to multiple lines

When I write arrow functions in Vue.js using vscode i get an unexpected formating. I wish to change the settings for Prettier when auto formating arrow functions in vscode. Expected: Acceptable: Actual: Answer I did some research and found this feature has already been requested: https://github.com/prettier/prettier/issues/4125 Changes to prettier were made (https://github.com/prettier/prettier/pull/6685) and released in prettier 2.0 back in 2020.

Weird Formatting for nextJs (vscode)

I am using prettier as my formater. When I read a simple JSX function it is written as however, when saved the autoformatter turns it into I have turned prettier off and turned most of my other extensions off yet this doesn’t change, I belive it is intrinsic to vscode somehow. Anyone have a fix? Answer On the lower right,

Vscode available properties intellisense using javascript or typescript in a function which’s parameter is a string

Look here. For the first parameter of the addEventListener function, vscode gives me several inbuilt suggestions How should I make this available in my javascript function? It could be using Jsdoc or typescript etc. Answer You can always see what vscode uses for intellisense by hovering on the addEventListener method or ctrl + click to go to the definition in