question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-fix support for object-property-newline

See original GitHub issue

What rule do you want to change?

object-property-newline

Does this change cause the rule to produce more or fewer warnings?

It will produce the same number of warnings.

How will the change be implemented? (New option, new default behavior, etc.)?

When the --fix flag is applied, code will be changed

Please provide some example code that this change will affect:

const w = {x,
  y, z
}

As well as code without object shorthand.

const w = {x: x,
  y: y, z: z
}

What does the rule currently do for this code?

Warns or fails depending on severity set.

What will the rule do after it’s changed?

Take the above

const w = {x,
  y, z
}

and transform it into

const w = {
  x,
  y,
  z
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
not-an-aardvarkcommented, Dec 12, 2016

I think it would be better if we just didn’t perform a fix in cases where there are comments between two properties.

1reaction
vitorbalcommented, Dec 21, 2016

@not-an-aardvark we got 3 thumbs up now, so marking this as accepted!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint-plugin-autofix - npm.io
Name 🛠 Description array‑bracket‑spacing 🛠 enforce consistent spacing inside array brackets array‑element‑newline 🛠 enforce line breaks after each array element arrow‑body‑style 🛠 require braces around arrow...
Read more >
object-property-newline - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint object-curly-newline conflicts prettier multi-line rationale
It allows configuring line breaks if there are line breaks inside properties, between properties and even least number of properties or even to ......
Read more >
ESLint v2.11.0 released - ESLint中文文档
... b4cff9d Fix: Incorrect object-property-newline behavior (fixes #6207) ... c10c07f Fix: lost code in autofixing (refs #6233) (#6234) (Toru Nagashima) ...
Read more >
eslint/eslint - Gitter
And in terms of prettier capabilities, ESLint doesn't accept autofixes that have potential of ... I expected something like: let is not supported...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found