Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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 ...
Matt Strom's user avatar
0 votes
1 answer
317 views

How to add tslint-disable and prettier-ignore both for a single line

How can I disable tslint/eslint and ignore the prettier for a single line, both rules at the same line? I want to align all the properties of the object using vscode plugin but prettier reformats it ...
Suhail Akhtar's user avatar
0 votes
0 answers
53 views

Trying to migrate from tslint to eslint in angular@13. Getting lots of dependency errors

enter image description here I've tried to run "npm i" after cleaning the cache. but not working. Is there anything i'm missing? Do i need to update the version of the @angular/cdk or flex-...
Sachin Kumar's user avatar
3 votes
4 answers
3k views

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 ...
J4N's user avatar
  • 20.3k
6 votes
3 answers
12k views

Need help fixing or suppressing this TypeScript error: TS2742

I have this file in a react native project: import styled, { withTheme } from 'styled-components'; import { BaseText } from '../BaseText'; export interface BodyProps { textAlign?: string; ...
Kartik's user avatar
  • 7,817
0 votes
1 answer
1k views

tslint and prettier conflict use tslint rules

I have prettier and tslint configured. However it seems prettier overrides the tslint rules. I can disable some of the rules using .prettierrc. However I'm still having issues. I want the tslint.json /...
MonteCristo's user avatar
  • 1,520
0 votes
1 answer
1k views

Integration of prettier with Intellij Idea and NPM

What I wanna achieve Intellij - show error via red underline Validate formating via NPM Autoformating via save Override printWidth to 140 Integrate with stylelint and tslint and file watcher What I ...
Oskar Woźniak's user avatar
18 votes
3 answers
12k views

Prettier reformats if / else into single line

I am trying Prettier out in a project using React and Typescript. However I am having a problem configuring multi-line if / else statements. When I write: if (x >=0) { // Do something } else { ...
Felipe's user avatar
  • 7,151
0 votes
0 answers
1k views

Prettier is not repecting the tslint rules

Prettier vsCode extension is not respecting the tslint rules. tslint.json { "extends": ["tslint:recommended"], "defaultSeverity": "warn", "rulesDirectory": ["codelyzer"], "rules": { "...
Khaled Ramadan's user avatar
24 votes
2 answers
11k views

Preventing conflict between Prettier (code formatter) and ESLint/TSLint

I am working on an Angular project in VS Code, using the "Prettier" plugin for code formatting, and the ESLint/TSLint plugins for standards enforcement. I know this isn't an "error" but I strongly ...
Todd Davis's user avatar
  • 5,987
25 votes
2 answers
19k views

How to avoid VsCode Prettier to break chain functions in new lines.?

I'm working with VSCode, Prettier and TSLint. When I do have chained functions call with more than 2 calls like let m = moment().startOf("day").subtract(30, "days"); Prettier breaks into let m = ...
Daniel Santos's user avatar
9 votes
1 answer
8k views

TSLint not working with CRA and TypeScript

I'm banging my head for hours trying to enable linting for a TypeScript project created with create-react-app. The wmonk/create-react-app-typescript repo is now deprecated Therefore, I followed ...
Null isTrue's user avatar
  • 1,896
3 votes
1 answer
6k views

How to configure tslint or prettier to remove whitespace between if/while/for and ()?

I'm setting up react project and format my code with tslint, prettier and tslint-config-prettier. Also autoFormat with vscode. How can I remove space between if/while/for and parenthese like 'if()' ...
alex's user avatar
  • 63
3 votes
1 answer
5k views

VSCode, Prettier and TSLint: formatOnSafe messes up auto sort of imports

I'm building React apps with TypeScript. My editor is VSCode. I use prettier and TSLint to keep my code clean. Since a couple of projects when I hit safe prettier messes up the auto sort of imports: ...
J. Hesters's user avatar
  • 14.3k
1 vote
0 answers
63 views

TSlint and React: How to enforce styles at bottom before export default?

I'm building a React Native app with TypeScript. I'm currently configuring my TSLint file. Is there a way to enforce styles in the same document to be at the bottom of the file (before the exports)? ...
J. Hesters's user avatar
  • 14.3k

15 30 50 per page