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

Doesn't rename references to index.js files when imported by directory #71

Open
spudly opened this issue Oct 4, 2016 · 1 comment
Open
Labels

Comments

@spudly
Copy link

spudly commented Oct 4, 2016

When you import a file by directory that contains an index.js file, and you rename the index.js file, references to it don't get updated.

Take the following example. Here's what the directory structure looks like before the refactor:

src/
  components/
    MyComponent.js (this file imports from "./propTypes")
    propTypes/
      index.js

If you rename /components/propTypes/index.js to /utils/propTypes.js, it will not update the MyComponent.js file to import from the new location.

Directory Structure after refactor:

src/
  components/
    MyComponent.js (this file imports from "./propTypes")
  utils/
    propTypes.js

Import String before refactor:

import * as propTypes from './propTypes';

Expected import string after refactor:

import * as propTypes from '../utils/propTypes';

Actual import string after refactor: (same as before refactor)

import * as propTypes from './propTypes';
@ahutchings ahutchings added the bug label Oct 4, 2016
@jurassix
Copy link
Owner

jurassix commented Oct 5, 2016

Thx for the bug report and write up @spudly! I'll see what I can do to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants