Skip to content

unnecessaryRenames

Renames that don't change the identifier name are unnecessary.

✅ This rule is included in the ts stylistic presets.

Renaming an identifier to the same name is redundant and adds unnecessary verbosity. This rule reports locations that can be simplified to remove the renaming.

import { value as value } from "module";
import { first as first, second } from "module";
export { data as data };
export { default as default };
const { key: key } = object;
function example({ value: value }: { value: number }) {
return value;
}

This rule is not configurable.

If you intentionally prefer explicit renames to the same value for some stylistic or tooling reason, this rule might not be for you. For example, if your codebase uses tooling that relies on renames being present, you might not be able to apply this rule’s fixes. You might consider using Flint disable comments and/or configuration file disables for those specific situations instead of completely disabling this rule.

Made with ❤️‍🔥 around the world by the Flint team and contributors.