Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
Prettier supports for Optional chaining (?.)

In my JavaScript React App I am using prettier for code formatting.

My current rules are working as expected. I saw that Prettier supports also Optional chaining, but when I run prettier --write that does not change for example user.info.name into user?.info?.name

Does someone have an idea what is the problem here?

Here is my .prettierrc:

module.exports = {
  trailingComma: "none",
  tabWidth: 2,
  semi: true,
  printWidth: 120,
  arrowParens: "avoid"
};

Version - "prettier": "2.1.2"

I am using Webstorm IDE

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Prettier doesn't make make changes that would alter the behavior of your code. Adding in optional chaining everywhere you access object properties would change the behavior, and isn't even desirable, so they don't do that. When prettier says they support optional chaining, they just mean that prettier can parse code that uses optional chaining, instead of throwing exceptions that the syntax isn't recognized.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda