'no-unless-return' rule's fix is not fix but destroying.
See original GitHub issueTell us about your environment
- ESLint Version: 3.13.1
- Node Version: 7.4.0
- npm Version: 4.1.1
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
module.exports = {
extends: 'airbnb',
rules: {
'no-unused-vars': ['error', { vars: "all", args: 'none' }],
}
}
What did you do? Please include the actual source code causing the issue.
function foo(key) {
var value = map[key];
if(!value){
return;
}
// do something....
}
=>
function foo(key) {
var value = map[key];
if(!value){
}
// do something....everytime???
}
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
I do not want you to change the logic by ‘–fix’ option.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:17 (13 by maintainers)
Top Results From Across the Web
Fixing the Solid Regeneration Error that will DESTROY your file!
Some Solids are in need of regeneration. You may not be able to retrieve this file again. Continue anyways?A very ominous error.
Read more >10 things kids destroy and how to fix them - My Silly Squirts
Kids destroy everything. Okay, maybe not everything, but MOST everything. But before you give up all hope, lot of these things can be...
Read more >The iPhone 13 Screen Is a Repair Nightmare That ... - VICE
The iPhone 13 Screen Is a Repair Nightmare That Could Destroy Repair Shops Forever. Replacing an iPhone screen is a common and simple...
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 FreeTop 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
Top GitHub Comments
FWIW, Atom’s
linter-eslint
now supports specifying rules not to auto-fix in version8.1.0
.@not-an-aardvark while I understand your rationale, we do have to be sensitive to how ESLint is being used in all cases. We really can’t just say, “oh well, editors should know better.” While it’s true ESLint will be a little weird in certain cases, I stand by my statement that I think we need to be more conservative with the auto fixes we do, especially in cases like this where we can unintentionally change logic.