DEV Community

Discussion on: Avoid deeply nested imports with path mapping in typescript

Collapse
 
thekashey profile image
Anton Korzunov

The main question is about the naming convention:

  • workers? Well sounds like a npm package name. How to distinguish?
  • @workers? Well, actually the same - like a package from an org.
  • self/workers or @self/workers? Scoped but verbose.

There is also one more case - use eslint/tslint to group imports and thus separate something from node_modules from your own stuff.

But in any case - this is a must-have feature.

Collapse
 
unorthodev profile image
Mayowa Ojo

The names you choose depends on the way your project is structured. You can also decide to entirely avoid such names that can cause conflicts. It's entirely up to you and that's why the "@" symbol can help distinguish.

Collapse
 
ca0v profile image
Corey Alix

Seems like node "imports" dictate the prefix to be "#".