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-useless-rename triggered when there's no rename

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
albertocommented, 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.

1reaction
albertocommented, May 27, 2016

Confirmed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-useless-rename - ESLint - Pluggable JavaScript Linter
Rule Details. This rule disallows the renaming of import, export, and destructured assignments to the same name.
Read more >
Folders and documents enter rename mode when left-clicked
Some setting in Windows is getting turned on/off by a key combination, though I have never heard of such a setting and it...
Read more >
25 Best Power Automate Tips and Tricks You Should Know
Always rename your action and always rename them right away after creating them. This is important as dependent actions you might add later...
Read more >
no-useless-rename - ESLint Config
This rule disallows the renaming of import, export, and destructured assignments to the same name. What ESLint should do when it catches the...
Read more >
Renaming Imports and Proper Variable Declaration | by John ...
No Renaming Import, Export, and Destructured Assignments to the Same ... them in useless ways by renaming them to the same name as...
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