Is it bad form to have 2 files with the same name when doing ES2015 modules?

i have something like this:

/imports/api/foo/utils/fooUtils.js (utils for client + server)
/imports/api/foo/server/utils/fooUtils.js (utils for server)

in the past, i’ve avoided having duplicated file names in a project.

but with the module exports, i feel like i’m okay with the example above. especially because there is zero name collision in the exported symbols.

anyone have a strong opinion one way or the other?

Shouldn’t be a problem, I do the same thing:


( I still use the ‘both’ folder to make it more clear that it’s both for client and server, and split up per major ‘scene’ )

There are no possible file-collisions. The only thing that could happen is an object collision:

import { myObj } from '/imports/someScene/both/somefile'
import { myObj } from '/imports/someScene/server/somefile'

but that is easily solved:

import { myObj as bothObj } from '/imports/someScene/both/somefile'
import { myObj as serverObj } from '/imports/someScene/server/somefile'

cool, thanks!!! <------ posts have to be at least 20 characters. so i was overly-emphatic :slight_smile: