Fix lodash-es imports#7509
Conversation
|
It might be good to enforce this as an eslint rule https://eslint.org/docs/latest/rules/no-restricted-imports. @ljowen, what do you think? |
|
Before, I have been finding this stuff manually, but this week I configured Knip to find missing/unused dependencies and files for me. There's no point in adding a tool that constantly says "FAIL FAIL FAIL" though, so I was planning to make a PR with a Knip configuration after the worst offenses had been fixed. This PR, and #7506 were both found because of Knip. Edit: Knip complains about a lot of stuff I've found manually already too, the unused dependency PRs that Zoran has merged the last couple of days, along with #7397, #7399, #7411, #7484, #7491, #7492, and #7495. |
ed846e0 to
814e515
Compare
|
I am aware of Knip and have used it on various projects in the past; however, it does not provide feedback in real-time like ESLint does. You need to run it manually, which typically means deferring feedback for a developer to CI. That’s why I suggest setting up an ESLint rule to manage this and have it warn/error during development. |
|
I'm in favour of the lint rule :) |
This package depends on lodash-es, so import everything from that dependency.
This package uses lodash-es, so import that instead.
814e515 to
de7a0ed
Compare
|
Added the requested ESLint configuration. @ljowen ESLint 9 has deprecated/removed a bunch of checks and uses a flat configuration format which is quite different from the current format. The longer #7437 sits in the PR queue, the greater the risk is that some configuration changes will be lost in the upgrade when you finally decide to stop using the deprecated ESLint 8. |
What this PR does
This package depends on lodash-es,
so import everything from that
dependency.
Test me
I believe this is tested by CI?
Checklist
doc/.