Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd rules for import checking #425
Comments
This comment has been minimized.
This comment has been minimized.
|
While I like the idea of this, Babel can be configured to dynamically resolve paths. If we did this, we would have to accommodate that as well and thus add more complexity. I'd vote to hold off on this for awhile. |
This comment has been minimized.
This comment has been minimized.
|
The loader spec isn't finalized, so module resolution is not set in stone. For example, how would a browser know it has to request e.g. With that said, I have no plans of giving up browserify / webpack, and will keep transpiling forever, so I don't think I'd be affected. |
This comment has been minimized.
This comment has been minimized.
|
As far as I understand it currently supports nodes resolve mechanisms, based on substacks work for browserify and webpack. That means it is capable of handling the current ways resolving is done. When the module resolution actually gets finalised and implemented I'm pretty sure it can be updated to reflect those changes. |
This comment has been minimized.
This comment has been minimized.
|
@jprichardson what dynamic resolution are you referring to exactly? |
This comment has been minimized.
This comment has been minimized.
|
If we support this, then folks will be asking for hooks to customize how module resolution works for their specific setup, since not everyone uses browserify. Then there will be pressure to add hooks for those folks, or to disable these checks. I'm -1 for now, until things shake out a bit more. |
feross
added
enhancement
question
labels
Feb 19, 2016
feross
closed this
Feb 23, 2016
This comment has been minimized.
This comment has been minimized.
|
This sounds like hell. |
This comment has been minimized.
This comment has been minimized.
benmosher
commented
Jun 13, 2016
•
|
Hello, I maintain that plugin. To support different loaders (browserify/node, Webpack, Babel plugins, etc.) the plugin itself has pluggable loaders (as @dignifiedquire noted). The vanilla Node one uses substack's node-resolve, Webpack one uses webpack/enhanced-resolve + loads your Webpack config to get aliases, etc. There are a handful of community ones as well that integrate with jspm and a few Babel import-rewriting plugins, IIRC. So while you would not need to implement the different loading strategies, there would need to be some way to configure them, or at least choose from one that is supported by a loader. And folks using a loader that is not yet supported would need some way to indicate that, to avoid spurious warnings. While I'm not super familiar with your project, this sounds like more configuration than you're looking for. "if you want import resolution, use ESLint directly" seems like a reasonable decision to me, considering your perspective. That said, if you are ever interested, I'd be up for working together on some sort of zero-conf loader inference or some such. Just throwing it out there. |
This comment has been minimized.
This comment has been minimized.
|
@benmosher Thanks for the explanation :) |
dignifiedquire commentedFeb 17, 2016
I feel this might be a great edition for everyone using es module syntax to get checks that all imports are actually resolvable: https://www.npmjs.com/package/eslint-plugin-import
what do you think?