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

178
Views
¿Es posible deshabilitar la regla ESLint/Prettier que agrega paréntesis?

Si escribo:

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

entonces alguna regla quiere cambiar a:

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

No quiero los paréntesis adicionales, pero no puedo averiguar si es ESLint o Prettier el que los agrega. Mi .eslintrc agregado a continuación:

 { "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 } }

Actualizar

Esto es lo que sucede cuando me muevo sin los paréntesis.

ingrese la descripción de la imagen aquí

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

0

Es más bonito que los agregue y no se puede deshabilitar. Consulte https://github.com/prettier/prettier/issues/12554

Prettier solía imprimir la menor cantidad de paréntesis posible, luego cambió para imprimir algunos extra para facilitar la lectura. Vea el muy largo #187 para la historia completa.

En el hilo se sugiere dprint como alternativa a Prettier. Bajar de categoría a Prettier a la versión 2017 también podría ser una opción. O tal vez hay una bifurcación activa de Prettier que no agrega paréntesis.

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!