Open danth opened 2 years ago
Hmm, this is a tall ask :sweat_smile:. I think it partly requires rethinking how the whole lint framework behaves altogether. Currently lints are expected to be as "local" as possible. When the lint runner approaches the node beginning at otherArg
it has to somehow know that otherArg: function arg otherArg
is not supposed to be linted because it was already linted as a part of arg: otherArg: function arg otherArg
. This partly helps fixes also to be "local" and easy to reason about. At the moment, I can't quite think of a way to implement this.
statix fix
is able to fix the this issue in one blow however (a single run, but multiple passes over the source).
Further to that, we can't simply skip linting of otherArg: function arg otherArg
as it could be a more complex expression containing other suggestions.
I came across this case while testing #5:
After applying the suggestion above, I get a new suggestion to eta-reduce
test7
further:Ideally, Statix would produce a single suggestion like: