Commit 0ed31aa
authored
chore(lint): Fix suppressed ESLint errors in
## Explanation
This fixes all suppressed ESLint errors in the `base-controller`
package.
## References
Closes #7344.
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Refactors BaseController types and tests to satisfy ESLint by adding
explicit return types, refining generics, and cleaning up imports;
removes related suppressions.
>
> - **Core (`packages/base-controller/src/BaseController.ts`)**
> - Add explicit return types to `state` getter, `applyPatches`,
`destroy`, and `update` result.
> - Rename generic/type params for clarity (`T`→`Type`), and tighten
typings (`StateChangeListener`, `StateDeriver`, `StateMetadata`).
> - Minor callback param rename in `produceWithPatches` cast
(`callbackFn`).
> - **Tests (`packages/base-controller/src/BaseController.test.ts`)**
> - Add explicit return types to controller overrides and helper
functions; annotate arrow properties.
> - Switch `sinon` import to default; reorder imports; add `//
eslint-disable-next-line no-new` where needed.
> - **Lint config**
> - Update `eslint-suppressions.json` to remove suppressions for
`base-controller` files now addressed.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
71469bd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->base-controller package (#7443)1 parent 9d56202 commit 0ed31aa
3 files changed
Lines changed: 46 additions & 51 deletions
File tree
- packages/base-controller/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | 702 | | |
725 | 703 | | |
726 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | | - | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
146 | 152 | | |
147 | 153 | | |
148 | | - | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | | - | |
| 158 | + | |
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| |||
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
542 | 550 | | |
543 | 551 | | |
544 | 552 | | |
| 553 | + | |
| 554 | + | |
545 | 555 | | |
546 | 556 | | |
547 | 557 | | |
| |||
633 | 643 | | |
634 | 644 | | |
635 | 645 | | |
636 | | - | |
| 646 | + | |
637 | 647 | | |
638 | 648 | | |
639 | 649 | | |
640 | 650 | | |
641 | 651 | | |
642 | | - | |
| 652 | + | |
643 | 653 | | |
644 | 654 | | |
645 | 655 | | |
646 | 656 | | |
647 | 657 | | |
648 | | - | |
| 658 | + | |
649 | 659 | | |
650 | 660 | | |
651 | 661 | | |
| |||
709 | 719 | | |
710 | 720 | | |
711 | 721 | | |
712 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
713 | 725 | | |
714 | 726 | | |
715 | 727 | | |
716 | 728 | | |
717 | 729 | | |
718 | | - | |
| 730 | + | |
719 | 731 | | |
720 | 732 | | |
721 | 733 | | |
722 | 734 | | |
723 | 735 | | |
724 | | - | |
| 736 | + | |
725 | 737 | | |
726 | 738 | | |
727 | 739 | | |
| |||
876 | 888 | | |
877 | 889 | | |
878 | 890 | | |
879 | | - | |
| 891 | + | |
880 | 892 | | |
881 | 893 | | |
882 | 894 | | |
| |||
900 | 912 | | |
901 | 913 | | |
902 | 914 | | |
903 | | - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
904 | 921 | | |
905 | 922 | | |
906 | 923 | | |
| |||
931 | 948 | | |
932 | 949 | | |
933 | 950 | | |
934 | | - | |
| 951 | + | |
935 | 952 | | |
936 | 953 | | |
937 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
0 commit comments