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

183
Vistas
ESLint RC rule not working, while rule comment works and other rules do

When I use this comment with the following code, it reformats the code:

/*eslint object-property-newline: "error"*/
const obj1 = { foo: 'foo', bar: 'bar', baz: 'baz' };

However, when I add this line to my ESLint RC file instead, it doesn't reformat, while other rules seems to apply.

rules: {
    'object-property-newline': 'error', 
    'other rules': 'warn',
    // ...
}

Does anyone have an idea?

Edit - For example, this rule does apply:

'object-curly-newline': ["error", "always"],

If I add this code:

var x = { xs: 1, xy: 2, greg: 3 };

And save the file, it changes to:

const x = {
  xs: 1, xy: 2, greg: 3,
};

But I want every object property on a new line, which I hope to achieve with 'object-property-newline': 'error',.

https://eslint.org/docs/rules/object-property-newline

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

0

I found out that adding allowAllPropertiesOnSameLine and setting it to false is necessary, even though I thought that would be the default option.

'object-property-newline': ["error", { "allowAllPropertiesOnSameLine": false }],
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