Questions tagged prettier

Explore the latest questions and answers asked by our top developers.

How to have prettier working with single quote in my angular files

I just installed Prettier on my project as recommended by some fellow developers, but I’ve some issues configuring it. When I installed it, on the first format, VS Code asked me which formater I wanted to use(between tslint and prettier), so I choose prettier. But now, when I an .ts file, I get warning by […]

By J4N
Published
Categorized as angular, prettier, tslint, visual-studio-code Tagged , , ,

Formatting error should fail bundling in NodeJS + ExpressJS + TSLint + Prettier

I would like to implement a feature like, if any of the file code is not formatted or not followed the standard then build has to show the errors with the line numbers, eg. Semistandard in JS. Likewise for TS. Because, team members are not formatting the code, and other developers are feeling hard to […]

Error after converting Angular 11 project to eslint

I updated our codebase to Eslint following the steps from Angular Except now all my TS files have this error in VSCode: Parsing error: Cannot read {file ‘/users/steve/github/myproject/tsconfig.json’. On the line with the main imports The project structure is like so (simplified): – package.json – .eslintrc.json – client – tsconfig.json – package.json – .eslintrc.json – […]

By Steve
Published
Categorized as angular, eslint, json, prettier, tslint Tagged , , , ,

Why prettier started splitting short lines?

I used prettier for Angular project in VSCode for a few months. It worked ok-ish. Today I upgraded Angular to v11 and the moment I’ve started changing my ts file (in this case I was changing file with unit tests, extension .spec.ts) and one line which has 85 characters is being split from: const tblRows […]

By Budda
Published
Categorized as angular, prettier, visual-studio-code Tagged , ,

What is the ideal formatter for Angular typescript code including the angular html?

I just wanted to ask here if What is the ideal formatter for Angular typescript code including the angular HTML? in VSCode , what settings do you prefer? I tried using Prettier – Code formatter esbenp.prettier-vscode and below is the result. Please don’t downvote this one , I am just asking for help and suggestions. […]

By Patel Pii
Published
Categorized as angular, prettier, typescript Tagged , ,

VSCode Prettier Keeps separating Condition statements into separate lines

How do I Stop Prettier VSCode Formatter from breaking up equal statements? The following condition statement is broken into two lines, when coding Angular. if ( productId === productTest ){ It makes it difficult to read simple code. Source: Angular Questions

Why does Prettier claim the `;` before destructuring assignment?

I have if block in my Angular component: if (desc.length > 0) { [this.errorMsg] = desc } However, Prettier doesn’t like it and recommends to put ; at the beginning of the destructuring assignment: if (desc.length > 0) { ;[this.errorMsg] = desc } I just want to get why? Is there a bug in my […]

prettier – how to not make each angular attribute on a single line?

I am in the process of adding prettier to my angular project. I am writing the settings into the .prettiercc file. When I run it, it changes my HTML, sometimes doubling the lines though unnecessary. For instance, it changed <p-fileUpload #upload class="p-d-inline" name="name" mode="basic" [auto]="true" customUpload="true" accept=".json" chooseLable="upload thing" chooseIcon="pi pi-folder-open" (uploadHandler)="load($event.files, upload)" > to […]

By PMO1948
Published
Categorized as angular, prettier Tagged ,

ESLint Lint Indent Config for dropped lines

So, with Angular 11 deprecating TSLint, I made the switch to ESLint (not too happy with it so far). Right now I have this annoying spacing issue I’m trying to work out in the .eslintrc.js config. Take these lines of code (this is what I have and what I want to keep): readonly DELETE_DIALOG_MESSAGE = […]

By ineedtoknow
Published
Categorized as angular, angular11, eslint, eslintrc, prettier Tagged , , , ,

Cannot disable VSCode to remove ending whitespace on save?

I have realized a behaviour of VSCode that causing conflict on committing files in an Angular project. When saving a file (*.ts), VSCode removes the ending whitespaces automatically and I have not managed to disable it by using lots of settings changes etc. as shown below. So, how can I disable it? And I do […]

By Fredrick
Published
Categorized as angular, prettier, visual-studio-code Tagged , ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq