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

Files starting with dot #8045

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

gabrielrumiranda
Copy link
Contributor

@gabrielrumiranda gabrielrumiranda commented Aug 26, 2019

This PR solve the problem of this issue. Lets you import files that start with dots

Copy link
Contributor

@goodmind goodmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with .ext as import? Like if you specify custom extension and just import nameless file?

import something from './.ext'

https://flow.org/en/docs/config/options/#toc-module-file-ext-string

Or just nameless files in general like .js?

@goodmind goodmind requested a review from gabelevi August 29, 2019 13:13
@gabelevi
Copy link
Contributor

I'm not sure I'm comfortable with deleting this behavior. Like there's a lot of JS for me in .hg/. Someone could add that to their [ignores], but I'd rather that the default behavior does the right thing.

I suppose I'm fine making it an option? Like if someone wants to set ignore_dotfiles=false in their .flowconfig then they're welcome to do so? You would need to modify flowConfig.ml to add the option and then also add it to type options in files.ml. Then the compilation errors should direct you to all the other places you need to fix.

@gabrielrumiranda
Copy link
Contributor Author

@gabelevi I think this the better way, I go make this changes

@goodmind
Copy link
Contributor

goodmind commented Sep 4, 2019

@gabrielrumiranda can you add tests with nameless files?

@gabrielrumiranda
Copy link
Contributor Author

@goodmind I separate the test in another folders, when you tell nameless file you tell a file with name . ?

@goodmind
Copy link
Contributor

goodmind commented Sep 6, 2019

@gabrielrumiranda yeah, like .flowconfig, .js, not sure if this would work and if there even need to support it

@gabrielrumiranda
Copy link
Contributor Author

gabrielrumiranda commented Sep 6, 2019

I try but don't work

@gabrielrumiranda
Copy link
Contributor Author

gabrielrumiranda commented Sep 6, 2019

Other thing, files begin with dot inside a node_module cannot be import using relative path. I tested this in a simple node.js project and don't work too

@goodmind
Copy link
Contributor

Hmm

@goodmind
Copy link
Contributor

@gabrielrumiranda it should work now

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

Successfully merging this pull request may close these issues.

None yet

4 participants