Skip to content
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
Closed

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

daltones opened this issue May 27, 2016 · 8 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@daltones
Copy link
Contributor

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 An ESLint team member will look at this issue soon label May 27, 2016
@kaicataldo
Copy link
Member

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 ESLint is working incorrectly rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels May 27, 2016
@alberto
Copy link
Member

alberto commented May 27, 2016

Confirmed.

@alberto alberto added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 27, 2016
@kaicataldo
Copy link
Member

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

@kaicataldo
Copy link
Member

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

@daltones
Copy link
Contributor Author

Thanks for the fast replies! :)

@nzakas nzakas closed this as completed in 03beb27 May 30, 2016
@daltones
Copy link
Contributor Author

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
Copy link
Member

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
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
@nzakas nzakas closed this as completed in 61dfe68 Jun 1, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

4 participants