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

181
Views
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 answers
Answer question

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 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!