New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-useless-rename triggered when there's no rename #6266

Closed
daltones opened this Issue May 27, 2016 · 8 comments

Comments

Projects
None yet
4 participants
@daltones
Copy link
Contributor

daltones commented May 27, 2016

What version of ESLint are you using?
v2.11.0

What parser (default, Babel-ESLint, etc.) are you using?
Default (babel-eslint shows the same issue)

Please show your full configuration:

{
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module"
  },
  "rules": {
    "no-useless-rename": 1
  }
}

What did you do? Please include the actual source code causing the issue.

import Foo from 'foo';
import {bar as otherBar} from 'bar';
import {fooBar} from 'foo-bar';
import {baz as baz} from 'baz';

What did you expect to happen?
Just one warning in line 4.

What actually happened? Please include the actual, raw output from ESLint.

/path-to-the-file/index.js
  3:9  warning  Import fooBar unnecessarily renamed  no-useless-rename
  4:9  warning  Import baz unnecessarily renamed     no-useless-rename

✖ 2 problems (0 errors, 2 warnings)

@eslintbot eslintbot added the triage label May 27, 2016

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented May 27, 2016

Thanks for the issue. Not sure what's going on, but I'll look into this when I'm back at my computer.

@kaicataldo kaicataldo added bug rule evaluating and removed triage labels May 27, 2016

@alberto

This comment has been minimized.

Copy link
Member

alberto commented May 27, 2016

Confirmed.

@alberto alberto added accepted and removed evaluating labels May 27, 2016

alberto added a commit that referenced this issue May 27, 2016

alberto added a commit that referenced this issue May 27, 2016

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented May 27, 2016

Figured this out. Oversight on my part when I wrote his rule - fix incoming.

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented May 27, 2016

Oh, just saw @alberto's got this covered. Am on mobile and missed it. Thanks - somehow completely missed this in my tests (sorry!).

@daltones

This comment has been minimized.

Copy link
Contributor

daltones commented May 28, 2016

Thanks for the fast replies! :)

@nzakas nzakas closed this in 03beb27 May 30, 2016

@daltones

This comment has been minimized.

Copy link
Contributor

daltones commented May 30, 2016

I've just upgraded to 2.11.1 and the problem was fixed for default parser.

But it is still there when using babel-eslint.

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented May 30, 2016

babel-eslint parses the code differently than the default parser and can cause some rules to not work. Consider creating an issue directly with babel-eslint to see if this can be resolved either in the parser itself or in a plugin like https://github.com/babel/eslint-plugin-babel.

@alberto

This comment has been minimized.

Copy link
Member

alberto commented May 30, 2016

Mmmm, while what @kaicataldo says is generally true, I think in this case I was relying on a parser internal (reference equality), so we should probably fix that. Sorry, my fault.

PR is coming.

@alberto alberto reopened this May 30, 2016

alberto added a commit that referenced this issue May 30, 2016

alberto added a commit that referenced this issue May 31, 2016

alberto added a commit that referenced this issue May 31, 2016

@nzakas nzakas closed this in 61dfe68 Jun 1, 2016

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.