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

Excluding gitignored files #469

Open
callumlocke opened this issue Nov 26, 2017 · 2 comments
Open

Excluding gitignored files #469

callumlocke opened this issue Nov 26, 2017 · 2 comments

Comments

@callumlocke
Copy link

Thanks for this module, it's really useful.

When I run 'fix imports' in the file src/something.js, it asks me to choose between ./Foo.js and ../lib/Foo.js. The latter is the Babel output, which obviously wouldn't make sense to import into the source.

It would be nice if there was an option to automatically exclude anything in .gitignore, because if it's in .gitignore then it's probably something I never want to import (or at least rarely enough that I don't mind doing it manually in those cases).

(I'm using the Atom plugin.)

@trotzig
Copy link
Collaborator

trotzig commented Nov 27, 2017

That's a good idea, we could definitely read that file if it exists.

Right now you can add exclusions to the excludes config option. Something like:

// .importjs.js
module.exports = {
  excludes: ['./lib/**'],
};

@lencioni
Copy link
Collaborator

You could probably even add a little code to your config that reads your .gitignore file and populates the excludes array.

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

No branches or pull requests

3 participants