Closed saiichihashimoto closed 1 year ago
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...
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.
Currently, with this setting:
This code:
Is allowed if it's named:
But not:
Usually I have a
variableName.js
. Then I realize I need avariableName.web.js
. Then I want to extract common code into someutils.js
that are only related to them, so I make avariableName
folder and move them all in, renaming tovariableName/index.js
andvariableName/index.web.js
along the way. This is whenfilenames/match-exported
gets upset.I think whatever is detecting the "index" file is looking for "index.js", specifically.