Add no-plusplus rule autofixer
See original GitHub issueThere is a no-plusplus rule. Let’s add an autofixer for the rule.
http://eslint.org/docs/rules/no-plusplus
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:
- Created 7 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top 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 - 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please note
i++
andi+=1
has different return values. I think we cannot autofixi++
if the return values are used.It looks like we decided not to merge https://github.com/eslint/eslint/pull/7514, so I’m going to close this issue.