ilearnio / module-alias

Register aliases of directories and custom module paths in Node
MIT License
1.76k stars 69 forks source link

Suggestion to use $ instead of @ #27

Closed navaru closed 1 year ago

navaru commented 6 years ago

I come across a larger node project that uses module-alias and currently has 14 aliases. When fast reading through source is not easy to digest what module import is an alias and what's an npm import.

We switched from @ to $ in prefixing modules and it's more clear, especially for new people joining the project.

var module = require('$deep/module')
// Or ES6
import module from '$deep/module'

Maybe providing $deep in examples will encourage people not to use the @org format to make it more clear.

ilearnio commented 6 years ago

I see what you mean. This makes sense, since there are some npm packages like @babel/plugin-proposal-object-rest-spread. Will get to it soon 👍