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

match-exported & index clash #26

Closed
saiichihashimoto opened this issue Jan 19, 2018 · 2 comments
Closed

match-exported & index clash #26

saiichihashimoto opened this issue Jan 19, 2018 · 2 comments

Comments

@saiichihashimoto
Copy link

Currently, with this setting:

"filenames/match-exported": [ 2, null, "\\.web$" ]

This code:

export default function variableName;

Is allowed if it's named:

variableName.js
variableName.web.js
variableName/index.js

But not:

variableName/index.web.js

Usually I have a variableName.js.
Then I realize I need a variableName.web.js.
Then I want to extract common code into some utils.js that are only related to them, so I make a variableName folder and move them all in, renaming to variableName/index.js and variableName/index.web.js along the way.
This is when filenames/match-exported gets upset.

I think whatever is detecting the "index" file is looking for "index.js", specifically.

@selaux
Copy link
Owner

selaux commented Jan 20, 2018

Yes. We are looking specifically for the index.js file. Rationale behind this is that only if the file is actually called index.js, we can require the directory, thus the export in the file should be named like the directory. I understand your usecase: different index files for node/browser. But I'm not sure how to handle this case...

@saiichihashimoto
Copy link
Author

Can you not use the same regex in match-exported in your index.js check? I can't imagine there'd be a case where there would be the index<regex>.js and that wouldn't be the intention.

@saiichihashimoto saiichihashimoto closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2023
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

2 participants