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.

'no-unless-return' rule's fix is not fix but destroying.

See original GitHub issue

Tell 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
IanVScommented, Jan 30, 2017

FWIW, Atom’s linter-eslint now supports specifying rules not to auto-fix in version 8.1.0.

1reaction
nzakascommented, Jan 22, 2017

@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.

Read more comments on GitHub >

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

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