-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add no-extraneous-dependencies
rule
#241
Add no-extraneous-dependencies
rule
#241
Conversation
There are a few todos blocked on #234 merging into master, but I made some changes and pushed to another branch: 266eb18 Thought it might be simpler to write the code than the English 😅 Fundamentally, I just added a I also changed the We may want to add a cache for the resolved package dependencies, but I think there is goodness in #234 that will make that easier too. I'd also like to get AMD support via #234, but that shouldn't block merging + deploying this. Things that need to get done either way:
|
BTW I just made you a collaborator, figured that would make this and the |
Thanks!
Should I make a new PR with that new branch to discuss stuff there, or do you want to wait until #234 lands? Sounds like a good idea to me.
Ah, that sounds like a good idea yeah! 👍
My bad, I did them in my project, forgot to do that here. Will do that some time later. I noticed you changed the Given the following directory:
// foo/bar/a.js
import './baz' // sibling
import './baz/index.js' // sibling
import '../' // parent
import './' // index
import './index' // index In short, |
New PR: I think that makes sense, we can hack on it together in this repo. I'm not sure when I'll get a chance to actually do the module-utils stuff (probably not sooner than Tuesday), so you can open the PR whenever feels right. On It actually probably makes sense to go ahead and merge and ship the first version of this. I don't think the No rush, though, we can just merge it as soon as some minimum of documentation is in place (if you concur). |
FYI: just flushed the other pending changes to npm with v1.5.0, ready to ship this as soon as docs are ready (I just didn't have quite enough time to do that and get the rest shipped this morning) |
Sure, will try to add this tonight! |
- lookup package.json relative to file being linted - added 'project' import type, which is ignored - uses resolved path to disambiguate some types of imports
b3ac0f8
to
ceea5dc
Compare
I have updated this branch to use what you've made in the branch of this repo. I've added documentation to your branch (and rebased the whole thing). |
ceea5dc
to
73ff01e
Compare
Thanks, looks good! I need to undo the breaking change I made to the 'index' type, but I'll do that post merge. |
Cool! |
Ah, got it. I should have looked there first, had just undone it in |
Experiment: closes #126 |
Add
no-extraneous-dependencies
rule(kinda) Continuous of jfmengels/eslint-plugin-import-order#9.
I've added two files :
core/importType
andcore/staticRequire
. I use those inimport-order
for the import-order` rule, and will also use them in the no builtin rule probably.Let me know if there's anything I need to change :)
(If this gets merged, I'll get started on the PRs for
import-order
and no builtin, but this reuses some of the same code)