-
Notifications
You must be signed in to change notification settings - Fork 39
deprecation warnings from barrel #2
Comments
Hey, thanks for reporting the issue! To be honest - I'm not the author of this plugin's code and neither spent any significant time to understand it yet. So for now I would not be able to do any adjustments to this rule. However I might look into it some time later but not very soon anyway. Also you are very welcome to try and adjust it yourself if you like and have time =) Regarding your points. I agree with your second point that it should not complain about deprecated things that are marked as deprecated, however if you are using them even withing your own code-base I believe it should still report it as that is old API no matter where it's used. And about first point - I think that even re-exporting code is still considered a usage, because if that code is removed - your code will simply break. So I think that it should still report even re-exports. |
Ah that's good to know. I'll see what I can do about it :) Fair points. But tests import deprecated own-code-functions until they're removed :) I usually go for a clean lint output as even warnings are a slippery slope. Also if we don't do anything about the warnings why are they on in the first place :) So that's my reasoning |
I can partially agree - when you reference/re-export your own deprecated code then yes you might want to remove those from checks as you control this piece of code. But when you reference/re-export someone else's deprecated code then this is potentially dangerous as you do not control when that code will be removed - so I think it should be reported as the whole point of this plugin is to find and report all places where you rely on deprecated (3rd party) code so you are prepared for next major for example. But detecting internal/external code boundaries is tricky:
Also there is a use-case when you develop in monorepo - then suddenly your internal code is not on the same level as you might have different packages that live together but use each other as separate/external packages. And now it's even trickier to decide what to report and what not =) EDIT: BTW if you are testing your deprecated code - you may simply disable this rule in that test case file |
This is very insightful :) |
This issues might be partially fixed by #6 so you might give it a shot in new release. |
Hi, with the following setting
I get warnings from my barrel (index.ts)
Like this
But it's not using anything, it's exporting
Another thing. It's warning about functions from my own source files that have been marked as
@deprecated
. Perhaps that could be an option if it should do that or not.The text was updated successfully, but these errors were encountered: