AsaAyers / js-hyperclick

A hyperclick provider that lets you jump to where variables are defined.
MIT License
127 stars 42 forks source link

Adding config for root path into Atom config #94

Closed Vangor closed 6 years ago

Vangor commented 6 years ago

Seems like there are good reasons both, to have modules in some path, or to not have them. So I suppose it's good to have this setting, which users will be able to ignore and use default way, or set-up, and use in a way without the relative path. There is a bunch of legacy projects, that configured this way, and can't be changed.

AsaAyers commented 6 years ago

This is what moduleRoots in package.json is for.

There is a bunch of legacy projects, that configured this way, and can't be changed

Projects are configured that way. The configuration belongs in the project, not to Atom. For more explanation see this issue

Vangor commented 6 years ago

Hm, yes it belongs to the projects. But making changes in big projects isn't possible sometimes. F.e. adding custom params in package.json won't be easily explainable for most of the developers. Since most of the developers won't bother, to go to the code, and make forks, it's more useful to just have this setting. But, it's your project.

AsaAyers commented 6 years ago

Node, webpack, Babel, and FlowType are a few projects I've used that all implement this same feature allowing absolute imports to resolve relative to some directory in your project. Each one has a custom configuration that lives inside your project. I don't see what's so different about js-hyperclick also requiring the configuration to live in the project. If there were a standard way to configure this I would conform to that.

Node actually uses and environment variable, so it lives wherever you want. But is often in the project somehwere. Maybe a .env file, maybe in a script field in package.json.