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.

Add no-plusplus rule autofixer

See original GitHub issue

There is a no-plusplus rule. Let’s add an autofixer for the rule.

What rule do you want to change? no-plusplus

Does this change cause the rule to produce more or fewer warnings? amount of warning won’t change

How will the change be implemented? (New option, new default behavior, etc.)? autofixer to no-plusplus will added

Please provide some example code that this change will affect:

var foo = 0; foo++;

will be fixed to

var foo = 0; foo += 1;

What does the rule currently do for this code? this rule does nothing, because there is no autofixer

What will the rule do after it’s changed? fix code as shown above

  • ESLint Version: 3.8.1

Issue Analytics

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

github_iconTop GitHub Comments

mysticateacommented, Nov 1, 2016

Please note i++ and i+=1 has different return values. I think we cannot autofix i++ if the return values are used.

not-an-aardvarkcommented, Jan 2, 2017

It looks like we decided not to merge, so I’m going to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-plusplus - 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 error Unary operator '++' used no-plusplus
The rule name you are looking for is no-plusplus. Disable it globally. In your eslint config file add the following: 'no-plusplus': 'off' ...
Read more >
no-plusplus for loop
The description for the no-plusplus rule begins with this rationale: The ++ and -- operators are subject to automatic semicolon insertion.
Read more >
eslint/eslint - Gitter
Hello all I have a question about no-plusplus . I allowed for loops, and used all fine. But now I try to follow...
Read more >
Eslint-plugin-autofix -
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 >

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 Post

No results found

github_iconTop Related Hashnode Post

No results found