I got back to VScode after few months, and now Prettier is not working for me. I have tried saving the setting manually as well, but it is not working.
Prettier ver - 5.8.0
VScode ver - 1.52.1
Please help.!
Thankyou.
In Cursor, “format on save” (auto prettier) isn’t working for me.
It was working fine until yesterday, but after updating the Cursor editor, it seems to have stopped.
What’s weird is that in VS Code, it works perfectly on the same project/settings.
Is anyone else experiencing this, or is it just me?
Videos
Hey everyone, for the life of me I can't figure out why prettier won't format css. I have gone over all of my setting, format on save, setting prettier as the default format, and checked the setting.json file. Still can't figure out what is going on. Any help would be appreciated!
Hello, I am banging my head against a wall.
For long I had no autoformatting enabled in Vscode, when eslint (or prettier - I use the eslint prettier package) complained about some styling formatting I hovered over the error and clicked "Fix all problems" in Vscode.
But then I thought I finally need to setup the fix/format on save thingy… I enabled format on save in vscode settings And added this in my settings json in my project:
"editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true },
And it works!
But it seems I have some conflicting rules or stuff. Because I have something like this: some function => {} and when I hit save it formats to add a whitespace inside the curly braces: some function => { }
And here begins my problem. With the space I get an eslint error to remove the whitespace but when saving it adds it again. I am basically stuck lol
I tried to revert the settings in vscode but it keeps happening and I have no idea where to look for to fix this issue?
I will really appreciate any help or hints.
- Select
File -> Preferences -> Settings(Ctrl+comma) and search formformatter - Set Prettiers as Default formatter.

If above does not work:
ctrl+shift+p > Format Document With... > Configure Default Formatter... > Prettier - Code formatter
This also work with ctrl+shift+I
If doing what @Simin Maleki mentioned does not solve it for you, there is a chance that your default formatter is not set:
File > Preferences > Settings > Search for "default formatter"
Make sure your Editor: Default Formatter field is not null but rather Prettier - Code formatter (esbenp.prettier-vscode) and that all the languages below are ticked. This fixed my issue.
STEP BY STEP WALKTHROUGH

Also make sure that your format on save is enabled:

Recently joined a agency as an Contract React developer. I was assigned a task to edit some inline Scss code.
Being a Prettier user I formatted the code, made the necessary changes and submitted a pull request.
Next day the senior developer reviewed my code and asked me to stop using Prettier and assigned me a task to change back the Scss code manually to inline Scss.
When I asked why should I not use prettier to format code. He said it's bad and time consuming and other team members started telling me a story how one time prettier wasn't working and started throwing errors.
That's why they never use it.
I wanted to say that It was showing error because you were doing something wrong.
Just because you once had an bad experience doesn't mean it's bad.
Plus they use one big single Scss file for the whole project.
When I question it too and asked them to use separate files and how it can effect the performance.
One team member answered it doesn't matter, how they don't care about the performance and I should be open minded and learn from them. The boss has 18 years of experience.
What should I learn why not to follow good practices!
I have configured neovim (nvchad) to format files on save with prettier. It does format them, but not the way I want. I'm not even sure if it uses prettier for the task because for example if I save a js file, it formats some things but doesn't add semicolons to the ends of lines. When using the :Prettier command, however, it does add the semicolons. Is this a problem with my configuration?
nvim/lua/plugins/init.lua
return {
{
"stevearc/conform.nvim",
event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
{
"prettier/vim-prettier",
lazy=false
},
{
'Exafunction/codeium.vim',
event = 'BufEnter',
config = function ()
vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
vim.keymap.set('i', '<c-;>', function () return vim.fn['codeium#CycleCompletions'](1) end, { expr = true, silent = true })
vim.keymap.set('i', '<c-,>', function () return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true, silent = true })
vim.keymap.set('i', '<c-x>', function () return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
end
},
{
"hrsh7th/nvim-cmp",
config = function(_, opts)
local cmp = require("cmp")
local mymappings = {
["<Up>"] = cmp.mapping.select_prev_item(),
["<Down>"] = cmp.mapping.select_next_item(),
["<Tab>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
}
opts.mapping = vim.tbl_deep_extend("force", opts.mapping, mymappings)
cmp.setup(opts)
end,
}
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}nvim/lua/configs/conform.lua
local options = {
formatters_by_ft = {
lua = { "stylua" },
css = { "prettierd" },
html = { "prettierd" },
js = { "prettierd" },
jsx = { "prettierd"},
ts = { "prettierd" },
tsx = { "prettierd" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
},
}
return options/nvim/lua/configs/lspconfig.lua
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
-- EXAMPLE
local servers = { "html", "cssls", "ts_ls", "eslint" }
local nvlsp = require "nvchad.configs.lspconfig"
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end
lspconfig.eslint.setup({
on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
command = "Prettier",
})
end,
})
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }I'm very new to the neovim scene. Any help will be much appreciated!
I have Prettier setup as the default formatter already and it's working fine for JSX and JS files.
The weird thing is that it works on save, so when I save it formats HTML correctly, but if I try to do it manually I get: "Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'HTML'-files".
Hey everyone, I've been struggling for hours trying to get Prettier to work in VS Code. It was working perfectly fine for weeks, but then it suddenly stopped. I have it set to format on save, but it doesn't work. However, when I manually select "Format Document With... Prettier," it works. I've set the default formatter to Prettier and enabled format on save, but it still doesn't work. I'm completely lost at this point. I've read numerous posts about this issue, but I can't seem to figure it out. Any advice would be greatly appreciated!
Every time I try to save my file it's not formatting it, It says it is but it is not. when I save the prettier icon on the bottom right looks like this but the console says it worked. everything has the right settings and my config file is fine, don't know what to do please help.
Just recently as my app has started to grow in NextJS I've noticed when doing format on save, which I've done for years using Prettier to format, the syntax coloring breaks and it takes forever to save the file...
This is specifically with NextJS ONLY, I've gone back to recent projects made with React Vite + Express backend, 10x bigger than my current project, and when I save and prettier does the automatic format, its literally instant...
I've tried to do a complete fresh reinstall of vscode but this issue still keeps happening, only on my NextJS project, why is this happening and has anyone had this issue? How do I fix it?
Example:
Then I save and this happens:
It literally breaks the syntax coloring and its extremely annoying, even linting breaks so it screws me up... This only happens on NextJS... I don't want to stop using prettier as its been very useful
I've been a Prettier user for a while and i'm trying to create the perfect ESLint config for my coding style. I'm new to this and I discovered you can add the setting to auto-fix your code on save according to your ESLint rules in your ESLint config file.
Should I just stop using prettier if I add auto-fix on save on my ESLint config to prevent them from conflicting each other?
Also what's your preferred ESLing config setup?
Follow these steps:
- CTRL + SHIFT + P
- Format Document (in pop-up bar)
- Select
Format Document - Select
Configure Default Formatter... - Select
Prettier - Code formatter
Done!
In VSCode settings, search for "Editor: Default Formatter", set it to esbenp.prettier-vscode and restart VSCode.
Hello,
Every once in a while, I read some comments of people hating on "prettier".
Sometimes it's a real pain in the ass, especially to integrate with other extensions rules.
If you're one of those who stopped using prettier , what are you using now ?
Was is worth ?
As for me I like to see my code get formatted on save (vscode) what do you use now instead ?
Thank you