-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat(eslint-plugin): add no-deprecated-options rule
#6622
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 09c56ae:
|
0fa4fd5 to
e51074b
Compare
e51074b to
ac7232f
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 09c56ae. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## v4 #6622 +/- ##
==========================================
- Coverage 96.46% 96.19% -0.27%
==========================================
Files 45 26 -19
Lines 2261 946 -1315
Branches 641 279 -362
==========================================
- Hits 2181 910 -1271
+ Misses 77 30 -47
- Partials 3 6 +3 ☔ View full report in Codecov by Sentry. |
|
Thanks, I think we can ship this, but tbh, I don't really think it's worth it. The overlap of:
is probably very close to zero @Newbie012 what do you think? At least we would also need to update the docs please, and we should widen the rule to be |
Just to share my perspective, the rule in its current form is still incredibly helpful. At work we have a big monorepo with more than 100 apps, and although we are aware of the deprecation, it’s not easy to upgrade to v5 precisely because of the deprecated callbacks. With this ESLint rule, we can gradually turn on the rule. But with TypeScript, it’s kinda an all or nothing approach - you can’t really upgrade package by package as well as prevent hundreds of developers from using the callbacks in new code. |
|
I think @NMinhNguyen has a point. At work, we also didn't upgrade to v5 (due to other reasons). With ESLint, you can enforce rules incrementally, unlike upgrading to v5 which is all or nothing. LGTM. |
|
Understood. I would still like these 3 things please:
|
Could you please help enumerate what these are? Presumably there is a v4 alternative for each one of them? |
useQuery options
others
it's fine if we just do the |
|
Thank you so much for the review and suggestions, @TkDodo!
I decided to keep it simple for now and just handle the deprecated callbacks as well as Additionally, the rule would previously highlight the entire before
after
|
no-callbacks ruleno-deprecated-options rule
6c3c9cf to
69a0c87
Compare


Resolves #5279 (comment).
I took the existing
prefer-query-object-syntaxrule and modified it to look for deprecated callbacks.