Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Possible to disable ESLint/Prettier rule that adds parentheses?

If I write:

const a = 1;
const b = 1;
const c = 1;
const d = 1;

const t = a * b * (c + d) / 100;

then some rule wants to change to:

const t = (a * b * (c + d)) / 100;
//        ^               ^ unwanted parentheses

I don't want the extra parentheses, but I can't figure out if it is ESLint or Prettier that adds them. My .eslintrc added below:

{
  "root": true,
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": ["./tsconfig.json"]
  },
  "plugins": ["@typescript-eslint", "prettier"],
  "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
  "rules": {
    "no-console": 1,
    "prettier/prettier": 2,
    "no-case-declarations": 0,
    "no-extra-parens": 2,
    "@typescript-eslint/no-extra-parens": 2
  },
  "env": {
    "browser": true,
    "node": true
  }
}

Update

Here is what happens when I hover without the parentheses.

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is Prettier that adds them and it can't be disabled. See https://github.com/prettier/prettier/issues/12554

Prettier used to print as few parentheses as possible, then it switched to print some extra ones for readability. See the very long #187 for the full story.

In the thread dprint is suggested as an alternative to Prettier. Downgrading Prettier to the 2017 version could also be an option. Or perhaps there is an active fork of Prettier that doesn't add the parentheses.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!