Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'm explicitly specifying extensions so it won't report when using for example `require('lodash.template')` and the dependency is not resolvable (read not installed). Also people might use Webpack and require files like `.css` and `.png` and those extensions should definitely be included. Read more: import-js/eslint-plugin-import#378
- Loading branch information
ae7451c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using
rollup
withrollup-plugin-json
(an awesome setup, btw) and this bit me. Without.json
, it can't resolve the dependency.I'm not asking for anything necessarily. I'll probably open an issue on rollup. Just pointing out that this might be painful. How are you going to handle things like cat-names.json (when this rule eventually applies there)? Which tools besides Node itself lookup
.json
?ae7451c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browserify at least, but all of them should. If it works in Node.js it should work with the packer. Otherwise the tool is fragmenting the community and annoys maintainers by users opening issues about it not working with their tool. You have no idea how many dumb webpack issues I've gotten on my repos because webpack v1 wasn't fully compatible with the Node.js resolution algorithm. IMHO, but rollup should bundle the
rollup-plugin-json
by default. Users shouldn't have to know or care that a module in their dependency tree is usingrequire('./package')
pointing at a JSON file. Hope you'll open an issue on Rollup about this, and thanks for bringing it up :)ae7451c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. As a Node-based tool, overwhelmingly used by Node developers for projects designed using Node paradigms, it should follow suit.
I've opened rollup/rollup#1047.