Questions tagged [prettier]
Prettier is an opinionated code formatter for JavaScript, CSS, HTML, Markdown, and other languages. If possible, please use Prettier's Playground to illustrate your question (use the "Copy link" and "Copy markdown" buttons at the bottom right corner of the Playground).
prettier
1,696
questions
0
votes
0
answers
19
views
Vscode does not format the content of nextjs into multiple lines
vscode does not format the content of nextjs into multiple lines
I expected
<Image
alt=""
src="/img/logo.svg"
width="30"
height="30"
className="d-...
0
votes
1
answer
110
views
Why do I get an "Incorrect type" error when setting codeActionsOnSave?
I am following this doc by Wes Bos to set up both ESLint. I also wanted to make it such that the set up automatically helps me reformat my code on save. However, this part of the set up is not working....
0
votes
1
answer
30
views
Prettier included in package.json but not available in default formatter selection list
In an Angular project that I'm developing in Visual Studio Code, I have the following in package.json:
"devDependencies": {
"@angular-builders/custom-webpack": "^17.0.0&...
0
votes
1
answer
23
views
Prettier formatting remove the space after comma in SQL
I have this query:
SELECT
column1,column2,column3
FROM
table_stage
Then I set prettier to put the comma before the value but I get this result:
SELECT
column1
, column2
, column3
...
0
votes
1
answer
90
views
Trying to create a Github action that auto lints and formats the changed code in a PR
I have two Github actions one for auto formating and another for linting:
Auto lint
name: Lint changed files
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
auto_lint:
...
0
votes
0
answers
49
views
Prettier Ignoring .prettierignore for Nx Cache Directory After Upgrade to latest
I'm encountering an issue with Prettier after upgrading from version 3.2.5 to 3.3.0 in my Nx monorepo. Despite having a .prettierignore file configured to ignore certain directories, Prettier is now ...
0
votes
0
answers
26
views
gap within the brackets in css in VScode
It seems that Prettier is not removing gaps in my Brackets {} in CSS in VSCode latest Version.
I thought in the past it use to do it, not sure though. It formats in all other respects except removing ...
0
votes
1
answer
215
views
How to configure ESLint with Prettier and TypeScript on Node 20?
I tried to configure Prettier with ESLint and create a configuration in settings.json to fix errors when saving, but the errors appear in .js files and not in .ts files. How to configure this?
...
0
votes
1
answer
57
views
Prettier rule to break all html elements inside a block the same way
I am using default NextJS eslint rules and have prettier activated in VS Code.
I am pretty sure this is a prettier configuration but basically when I am templating, I want all HTML elements inside a ...
0
votes
0
answers
15
views
Enforcing Consistent Code Formatting for HTML and Typescript (VS Code & WebStorm)
I'm in a team working on Angular projects and using Prettier for code formatting (HTML, TypeScript, SCSS). We're encountering merge conflicts due to inconsistent Prettier formatting across team ...
0
votes
1
answer
149
views
VS Code: The Svelte server crashed 5 times. Cannot find module @rollup/rollup-win32-x64-msvc
Happens when saving and Prettier tries to format the code. Can anyone help me with this error? It's driving me insane.
Here's the error log:
Error: Cannot find module @rollup/rollup-win32-x64-msvc. ...
0
votes
0
answers
22
views
Prettier and eslint / tslint plugins turn off randomly
I have Intellij IDEA 2023.2.3, and I usually use prettier, eslint/tslint on automatic mode, and we have .eslintrc, .prettierrc.json, and tsconfig.json files in our root directory that intellij should ...
0
votes
1
answer
104
views
Prettier failing with "Request textDocument/rangeFormatting failed with message: js_source_text is not defined"
I'm using Prettier, along with the plugin prettier-plugin-apex in VS Code, to format Salesforce classes and Visual Force pages etc.
It works (formats my docs on Save) most of the time, but now some, ...
1
vote
1
answer
250
views
error message 'Delete `␍`eslintprettier/prettier' in nest js project
code prettier code
prettierrc
{
"singleQuote": true,
"trailingComma": "all"
}
eslintc.js
module.exports = {
parser: '@typescript-eslint/parser',
...
0
votes
1
answer
84
views
Visual Studio Code bad formatting in vuejs
I've reinstalled my Windows again and installed Visual Studio Code along with Prettier, but it's formatting the syntax and everything else very poorly. Below is an example of how it looks and how it ...