Skip to content

Replacements and scopes #80

Description

@LarsDenBakker

I notice some of the codemods are naive in their replacements when it comes to scopes / variable shadowing.

For example let's say the module foo could be replaced with SomeStandard.foo(), we may end up doing:

From:

import foo from 'foo';

foo();

class x {
  someMethod(foo) {
    return foo();
  }
}

To:

SomeStandard.foo(); // that's correct

class x {
  someMethod(foo) {
    return SomeStandard.foo(); // that's not correct
  }
}

Do we think this is a problem, or for the few cases when this can occur we can leave it up to the developer to correct this?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions