nx-examples icon indicating copy to clipboard operation
nx-examples copied to clipboard

Clarify Naming Convention for classes/interfaces and their file names

Open demisx opened this issue 4 years ago • 0 comments

Can you please clarify what should be the naming convention for classes, service, interfaces in each lib? Shall they use "ScopeType..." prefix or not? I am seeing different variants being used, even in this example repo and can't produce a clear guideline for the team. For example, I'd expect the interface in https://github.com/nrwl/nx-examples/blob/master/libs/shared/product/types/src/lib/shared-product-types.ts to follow the file name and be called something like SharedProductType to match the file name, or if this is not the convention why the module in https://github.com/nrwl/nx-examples/blob/master/libs/shared/product/state/src/lib/shared-product-state.module.ts can't simply be named ProductStateModule? Why does it have scope as part of the name? And so forth.

Can someone please 🙏 explain two things:

  1. When the file names should have [scope]-[type]-... prefix?
  2. When the classes/interfaces/constants in files above should have the same scope/type in their names and when they should not? SharedUtilCreatePostResponseInterface in libs/shared/util-create-post-response-interface/... lib sounds silly, but at least Nx 8 generates it this way.

Thank you very much.

demisx avatar Nov 27 '19 01:11 demisx