no-useless-rename
Configuration
Disallow renaming import, export, and destructured assignments to the same name.
Rule Details
ES2015 allows for the renaming of references in import statements, export statements, and destructuring assignments. This gives programmers a concise syntax for performing these operations while renaming these references:
With this syntax, it is possible to rename a reference to the same name. This is a completely redundant operation, as this is the same as not renaming at all.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has an object option:
"ignoreDestructuring": false(default) — disallow useless renaming in destructuring patterns."ignoreImport": false(default) — disallow useless renaming in import statements."ignoreExport": false(default) — disallow useless renaming in export statements.
ignoreDestructuring
Examples of correct code for this rule with { "ignoreDestructuring": true }:
ignoreImport
Examples of correct code for this rule with { "ignoreImport": true }:
ignoreExport
Examples of correct code for this rule with { "ignoreExport": true }: