I noticed a few problems recently around the dependencies visitor ( (bugs and/or inefficiencies, including #134) because it was including indirect dependencies.
It is possible to manually filter out indirect dependencies (that's what NoUnused.Dependencies did for instance), but that requires additional and annoying work. You need to add a visitors to the elm.json file, store derived data from that, and then in the dependencies visitor filter out the indirect data using the derived data.
In all the rules I've written so far, I was able to replace all my usages of the dependencies visitors to the new "direct" one.
While I think that looking at indirect dependencies can be useful (for type information for instance potentially), it's rarely useful (it is still useful in NoUnapprovedLicense for instance).
Maybe in a future major version I will merge the 2 visitors in some way, but I didn't want to break the behavior of the current dependencies visitors for the current major version.
I noticed a few problems recently around the dependencies visitor ( (bugs and/or inefficiencies, including #134) because it was including indirect dependencies.
It is possible to manually filter out indirect dependencies (that's what
NoUnused.Dependencies
did for instance), but that requires additional and annoying work. You need to add a visitors to theelm.json
file, store derived data from that, and then in the dependencies visitor filter out the indirect data using the derived data.In all the rules I've written so far, I was able to replace all my usages of the dependencies visitors to the new "direct" one.
While I think that looking at indirect dependencies can be useful (for type information for instance potentially), it's rarely useful (it is still useful in
NoUnapprovedLicense
for instance).Maybe in a future major version I will merge the 2 visitors in some way, but I didn't want to break the behavior of the current dependencies visitors for the current major version.
Additions
This also adds
Review.Project.directDependencies
, but that's more of an implementation detail than a feature