eslint-plugin-mui-v7 1.6.2 โ 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +608 -665
- package/index.cjs +817 -850
- package/index.js +822 -854
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1,665 +1,608 @@
|
|
|
1
|
-
# eslint-plugin-mui-v7
|
|
2
|
-
|
|
3
|
-
> ESLint plugin focused on Material-UI V6 to V7 **breaking changes** with educational error messages
|
|
4
|
-
|
|
5
|
-
Automatically detect code that **BREAKS** when migrating from MUI V6 to V7 and teach developers the correct way through helpful messages with emojis and examples!
|
|
6
|
-
|
|
7
|
-
## ๐ฏ Philosophy
|
|
8
|
-
|
|
9
|
-
This plugin focuses on **breaking changes only** - code that will actually break when upgrading to V7. We don't warn about best practices or style preferences, just things that will cause errors.
|
|
10
|
-
|
|
11
|
-
**๐ Complete Coverage:** Detects **100% of all detectable MUI V7 breaking changes**
|
|
12
|
-
|
|
13
|
-
## โจ Features
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'mui-v7/no-
|
|
80
|
-
'mui-v7/no-
|
|
81
|
-
'mui-v7/no-
|
|
82
|
-
'mui-v7/no-
|
|
83
|
-
'mui-v7/no-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
import
|
|
142
|
-
import
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
'mui-v7/no-
|
|
194
|
-
'mui-v7/no-
|
|
195
|
-
'mui-v7/no-
|
|
196
|
-
'mui-v7/no-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
'mui-v7/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
'mui-v7/no-
|
|
217
|
-
'mui-v7/no-
|
|
218
|
-
'mui-v7/no-
|
|
219
|
-
'mui-v7/
|
|
220
|
-
'mui-v7/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
//
|
|
241
|
-
import Grid from '@mui/material
|
|
242
|
-
import
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
// โ
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
##
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
-
|
|
465
|
-
|
|
466
|
-
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
-
|
|
491
|
-
-
|
|
492
|
-
|
|
493
|
-
### v1.
|
|
494
|
-
|
|
495
|
-
####
|
|
496
|
-
- โจ
|
|
497
|
-
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
-
|
|
504
|
-
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
-
|
|
510
|
-
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
**Solution:** Run the plugin on all files and review spread props carefully.
|
|
611
|
-
|
|
612
|
-
### 4. **Best Practices vs Breaking Changes**
|
|
613
|
-
|
|
614
|
-
The plugin focuses on **breaking changes only**. Some MUI best practices are not enforced:
|
|
615
|
-
|
|
616
|
-
- โ
Detects: Code that **breaks** in V7
|
|
617
|
-
- โ Doesn't detect: Deprecated but still working code (unless it's in the migration path)
|
|
618
|
-
|
|
619
|
-
### ๐ For Complex Cases
|
|
620
|
-
|
|
621
|
-
For complex migrations, consider using MUI's official codemods:
|
|
622
|
-
|
|
623
|
-
```bash
|
|
624
|
-
# Official MUI codemods
|
|
625
|
-
npx @mui/codemod v7.0.0/grid-props <path>
|
|
626
|
-
npx @mui/codemod v7.0.0/lab-removed-components <path>
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
**This plugin complements the codemods by providing continuous validation!**
|
|
630
|
-
|
|
631
|
-
## ๐งช Testing
|
|
632
|
-
|
|
633
|
-
Run the comprehensive test suite:
|
|
634
|
-
|
|
635
|
-
```bash
|
|
636
|
-
npm test
|
|
637
|
-
```
|
|
638
|
-
|
|
639
|
-
Watch mode for development:
|
|
640
|
-
|
|
641
|
-
```bash
|
|
642
|
-
npm run test:watch
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
## ๐ค Contributing
|
|
646
|
-
|
|
647
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
648
|
-
|
|
649
|
-
## ๐ License
|
|
650
|
-
|
|
651
|
-
MIT ยฉ Matheus Pimenta (Koda AI Studio)
|
|
652
|
-
|
|
653
|
-
## ๐ Links
|
|
654
|
-
|
|
655
|
-
- [Material-UI V7 Migration Guide](https://mui.com/material-ui/migration/upgrade-to-v7/)
|
|
656
|
-
- [GitHub Repository](https://github.com/Just-mpm/eslint-plugin-mui-v7)
|
|
657
|
-
- [npm Package](https://www.npmjs.com/package/eslint-plugin-mui-v7)
|
|
658
|
-
|
|
659
|
-
## โค๏ธ Credits
|
|
660
|
-
|
|
661
|
-
Created by **Matheus Pimenta** (Koda AI Studio) + **Claude Code**
|
|
662
|
-
|
|
663
|
-
---
|
|
664
|
-
|
|
665
|
-
**Keywords:** eslint, mui, material-ui, mui-v7, react, typescript, linter, code-quality, migration, breaking-changes
|
|
1
|
+
# eslint-plugin-mui-v7
|
|
2
|
+
|
|
3
|
+
> ESLint plugin focused on Material-UI V6 to V7 **breaking changes** with educational error messages
|
|
4
|
+
|
|
5
|
+
Automatically detect code that **BREAKS** when migrating from MUI V6 to V7 and teach developers the correct way through helpful messages with emojis and examples!
|
|
6
|
+
|
|
7
|
+
## ๐ฏ Philosophy
|
|
8
|
+
|
|
9
|
+
This plugin focuses on **breaking changes only** - code that will actually break when upgrading to V7. We don't warn about best practices or style preferences, just things that will cause errors.
|
|
10
|
+
|
|
11
|
+
**๐ Complete Coverage:** Detects **100% of all detectable MUI V7 breaking changes** with **100% autofix support** (8/8 rules)!
|
|
12
|
+
|
|
13
|
+
## โจ Features
|
|
14
|
+
|
|
15
|
+
- โ ๏ธ **Catch Grid2 usage** - Grid2 was renamed to Grid in V7
|
|
16
|
+
- ๐ฏ **Grid item prop detection** - Grid doesn't use `item` prop anymore, use `size` instead
|
|
17
|
+
- โจ **Find moved @mui/lab components** - Alert, Skeleton, Rating, etc. are now in @mui/material
|
|
18
|
+
- ๐ **Detect deprecated props** - onBackdropClick, size="normal", Hidden/PigmentHidden components
|
|
19
|
+
- ๐จ **Catch deprecated imports** - createMuiTheme, experimentalStyled, StyledEngineProvider wrong location
|
|
20
|
+
- ๐ฆ **Deep imports detection** - Deep imports break in V7 due to exports field
|
|
21
|
+
- ๐ง **Components/componentsProps deprecation** - Suggests slots/slotProps API
|
|
22
|
+
- ๐ก **Theme variables suggestion** - Use `theme.vars.*` for automatic dark mode support (optional)
|
|
23
|
+
- ๐ง **Auto-fix available** for 8/8 rules (100%)! ๐ฏ
|
|
24
|
+
|
|
25
|
+
## ๐ฆ Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install --save-dev eslint-plugin-mui-v7
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## ๐ Complete Setup Tutorial
|
|
32
|
+
|
|
33
|
+
### Step 1: Install the Plugin
|
|
34
|
+
|
|
35
|
+
Choose your package manager:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# npm
|
|
39
|
+
npm install --save-dev eslint-plugin-mui-v7
|
|
40
|
+
|
|
41
|
+
# yarn
|
|
42
|
+
yarn add -D eslint-plugin-mui-v7
|
|
43
|
+
|
|
44
|
+
# pnpm
|
|
45
|
+
pnpm add -D eslint-plugin-mui-v7
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 2: Configure ESLint
|
|
49
|
+
|
|
50
|
+
#### For ESLint 9+ (Flat Config) - Recommended โจ
|
|
51
|
+
|
|
52
|
+
Create or update your `eslint.config.js` file:
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
// eslint.config.js
|
|
56
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
57
|
+
|
|
58
|
+
export default [
|
|
59
|
+
// Use the recommended preset (easiest option!)
|
|
60
|
+
muiV7Plugin.configs.recommended,
|
|
61
|
+
|
|
62
|
+
// Your other ESLint configs...
|
|
63
|
+
]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**That's it!** The plugin is now configured with all breaking changes as errors and best practices as warnings.
|
|
67
|
+
|
|
68
|
+
#### For ESLint <9 (Legacy .eslintrc)
|
|
69
|
+
|
|
70
|
+
Create or update your `.eslintrc.js` file:
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
// .eslintrc.js
|
|
74
|
+
module.exports = {
|
|
75
|
+
plugins: ['mui-v7'],
|
|
76
|
+
rules: {
|
|
77
|
+
// Breaking changes - ERRORS
|
|
78
|
+
'mui-v7/no-grid2-import': 'error',
|
|
79
|
+
'mui-v7/no-grid-item-prop': 'error',
|
|
80
|
+
'mui-v7/no-lab-imports': 'error',
|
|
81
|
+
'mui-v7/no-deprecated-props': 'error',
|
|
82
|
+
'mui-v7/no-deprecated-imports': 'error',
|
|
83
|
+
'mui-v7/no-deep-imports': 'error',
|
|
84
|
+
|
|
85
|
+
// Best practices - WARNINGS
|
|
86
|
+
'mui-v7/prefer-slots-api': 'warn',
|
|
87
|
+
'mui-v7/prefer-theme-vars': 'warn',
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 3: Run ESLint on Your Code
|
|
93
|
+
|
|
94
|
+
Check your code for MUI V7 breaking changes:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Check all files
|
|
98
|
+
npx eslint .
|
|
99
|
+
|
|
100
|
+
# Check specific directory
|
|
101
|
+
npx eslint src/
|
|
102
|
+
|
|
103
|
+
# Check and auto-fix issues
|
|
104
|
+
npx eslint . --fix
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 4: Review and Fix Issues
|
|
108
|
+
|
|
109
|
+
The plugin will show you:
|
|
110
|
+
- โ **Errors** - Code that WILL BREAK in MUI V7
|
|
111
|
+
- โ ๏ธ **Warnings** - Best practices and deprecated patterns
|
|
112
|
+
|
|
113
|
+
Most issues can be auto-fixed with `--fix`! ๐ฏ
|
|
114
|
+
|
|
115
|
+
### Step 5: Fix Remaining Issues Manually
|
|
116
|
+
|
|
117
|
+
For issues that can't be auto-fixed (like spread props), the plugin provides helpful messages:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
โ mui-v7/no-grid-item-prop
|
|
121
|
+
|
|
122
|
+
๐ฏ Grid in MUI V7 no longer uses the `item` prop!
|
|
123
|
+
|
|
124
|
+
๐ง Old way (V6):
|
|
125
|
+
<Grid item xs={12} sm={6}>
|
|
126
|
+
|
|
127
|
+
โ
New way (V7):
|
|
128
|
+
<Grid size={{ xs: 12, sm: 6 }}>
|
|
129
|
+
|
|
130
|
+
๐ก The new syntax is cleaner and more powerful!
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Complete Example
|
|
134
|
+
|
|
135
|
+
Here's a complete `eslint.config.js` for a React + TypeScript + MUI project:
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
// eslint.config.js
|
|
139
|
+
import js from '@eslint/js'
|
|
140
|
+
import tseslint from 'typescript-eslint'
|
|
141
|
+
import reactPlugin from 'eslint-plugin-react'
|
|
142
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
143
|
+
|
|
144
|
+
export default [
|
|
145
|
+
js.configs.recommended,
|
|
146
|
+
...tseslint.configs.recommended,
|
|
147
|
+
reactPlugin.configs.flat.recommended,
|
|
148
|
+
|
|
149
|
+
// Add MUI V7 plugin
|
|
150
|
+
muiV7Plugin.configs.recommended,
|
|
151
|
+
|
|
152
|
+
{
|
|
153
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
154
|
+
languageOptions: {
|
|
155
|
+
parserOptions: {
|
|
156
|
+
ecmaFeatures: {
|
|
157
|
+
jsx: true,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## ๐ Quick Start
|
|
166
|
+
|
|
167
|
+
### ESLint 9+ (Flat Config) - Recommended
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
// eslint.config.js
|
|
171
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
172
|
+
|
|
173
|
+
export default [
|
|
174
|
+
muiV7Plugin.configs.recommended, // โ
Apply all recommended rules
|
|
175
|
+
]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Manual Configuration
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
// eslint.config.js
|
|
182
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
183
|
+
|
|
184
|
+
export default [
|
|
185
|
+
{
|
|
186
|
+
plugins: {
|
|
187
|
+
'mui-v7': muiV7Plugin,
|
|
188
|
+
},
|
|
189
|
+
rules: {
|
|
190
|
+
// Breaking changes - ERRORS (cรณdigo quebra)
|
|
191
|
+
'mui-v7/no-grid2-import': 'error',
|
|
192
|
+
'mui-v7/no-grid-item-prop': 'error',
|
|
193
|
+
'mui-v7/no-lab-imports': 'error',
|
|
194
|
+
'mui-v7/no-deprecated-props': 'error',
|
|
195
|
+
'mui-v7/no-deprecated-imports': 'error',
|
|
196
|
+
'mui-v7/no-deep-imports': 'error',
|
|
197
|
+
|
|
198
|
+
// Best practices - WARNINGS (sugestรตes)
|
|
199
|
+
'mui-v7/prefer-slots-api': 'warn',
|
|
200
|
+
'mui-v7/prefer-theme-vars': 'warn',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### ESLint <9 (Legacy Config)
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
// .eslintrc.js
|
|
210
|
+
module.exports = {
|
|
211
|
+
plugins: ['mui-v7'],
|
|
212
|
+
rules: {,
|
|
213
|
+
'mui-v7/no-grid2-import': 'error',
|
|
214
|
+
'mui-v7/no-grid-item-prop': 'error',
|
|
215
|
+
'mui-v7/no-lab-imports': 'error',
|
|
216
|
+
'mui-v7/no-deprecated-props': 'error',
|
|
217
|
+
'mui-v7/no-deprecated-imports': 'error',
|
|
218
|
+
'mui-v7/no-deep-imports': 'error',
|
|
219
|
+
'mui-v7/prefer-slots-api': 'warn',
|
|
220
|
+
'mui-v7/prefer-theme-vars': 'warn',
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## ๐ Rules
|
|
226
|
+
|
|
227
|
+
### ๐จ Breaking Changes (Errors)
|
|
228
|
+
|
|
229
|
+
These rules detect code that **WILL BREAK** in MUI V7.
|
|
230
|
+
|
|
231
|
+
#### `mui-v7/no-grid2-import`
|
|
232
|
+
|
|
233
|
+
Grid2 was renamed to Grid in V7.
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
// โ Breaks in V7
|
|
237
|
+
import Grid2 from '@mui/material/Grid2'
|
|
238
|
+
import { grid2Classes } from '@mui/material/Grid2'
|
|
239
|
+
|
|
240
|
+
// โ
Recommended
|
|
241
|
+
import { Grid } from '@mui/material'
|
|
242
|
+
import { gridClasses } from '@mui/material'
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### `mui-v7/no-grid-item-prop` โจ IMPROVED in v1.3.0
|
|
246
|
+
|
|
247
|
+
Grid doesn't use `item` prop anymore, use `size` instead. Now with **auto-fix**!
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
// โ Breaks in V7
|
|
251
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
252
|
+
Content
|
|
253
|
+
</Grid>
|
|
254
|
+
|
|
255
|
+
// โ
Works in V7
|
|
256
|
+
<Grid size={{ xs: 12, sm: 6, md: 4 }}>
|
|
257
|
+
Content
|
|
258
|
+
</Grid>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
#### `mui-v7/no-lab-imports`
|
|
262
|
+
|
|
263
|
+
Components moved from @mui/lab to @mui/material.
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
// โ Breaks in V7
|
|
267
|
+
import { Alert } from '@mui/lab'
|
|
268
|
+
import { Skeleton } from '@mui/lab'
|
|
269
|
+
|
|
270
|
+
// โ
Recommended
|
|
271
|
+
import { Alert } from '@mui/material'
|
|
272
|
+
import { Skeleton } from '@mui/material'
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Moved components:** Alert, AlertTitle, Autocomplete, AvatarGroup, Pagination, PaginationItem, Rating, Skeleton, SpeedDial, SpeedDialAction, SpeedDialIcon, ToggleButton, ToggleButtonGroup
|
|
276
|
+
|
|
277
|
+
**Still in @mui/lab:** LoadingButton, Masonry, TabContext, TabList, TabPanel, Timeline (and related components)
|
|
278
|
+
|
|
279
|
+
**Moved to MUI X:** TreeView and TreeItem moved to @mui/x-tree-view (not @mui/material)
|
|
280
|
+
|
|
281
|
+
#### `mui-v7/no-deprecated-props` โจ IMPROVED in v1.3.0
|
|
282
|
+
|
|
283
|
+
Detects props and components removed in V7.
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
// โ Dialog.onBackdropClick - REMOVED
|
|
287
|
+
<Dialog onBackdropClick={handleClick}>
|
|
288
|
+
|
|
289
|
+
// โ Modal.onBackdropClick - REMOVED (NEW!)
|
|
290
|
+
<Modal onBackdropClick={handleClick}>
|
|
291
|
+
|
|
292
|
+
// โ
Use onClose with reason check
|
|
293
|
+
<Dialog onClose={(event, reason) => {
|
|
294
|
+
if (reason === 'backdropClick') {
|
|
295
|
+
// Your logic here
|
|
296
|
+
}
|
|
297
|
+
}}>
|
|
298
|
+
|
|
299
|
+
// โ InputLabel size="normal" - RENAMED
|
|
300
|
+
<InputLabel size="normal">
|
|
301
|
+
|
|
302
|
+
// โ
Use size="medium" (with auto-fix!)
|
|
303
|
+
<InputLabel size="medium">
|
|
304
|
+
|
|
305
|
+
// โ Hidden component - REMOVED
|
|
306
|
+
<Hidden xlUp><Paper /></Hidden>
|
|
307
|
+
|
|
308
|
+
// โ PigmentHidden component - REMOVED (NEW!)
|
|
309
|
+
<PigmentHidden xlUp><Paper /></PigmentHidden>
|
|
310
|
+
|
|
311
|
+
// โ
Use sx prop
|
|
312
|
+
<Paper sx={{ display: { xl: 'none' } }} />
|
|
313
|
+
|
|
314
|
+
// โ
Or use useMediaQuery
|
|
315
|
+
const hidden = useMediaQuery(theme => theme.breakpoints.up('xl'))
|
|
316
|
+
return hidden ? null : <Paper />
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
#### `mui-v7/no-deprecated-imports` โจ IMPROVED in v1.5.1
|
|
320
|
+
|
|
321
|
+
Detects deprecated imports removed in V7.
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
// โ createMuiTheme - REMOVED
|
|
325
|
+
import { createMuiTheme } from '@mui/material/styles'
|
|
326
|
+
|
|
327
|
+
// โ
Use createTheme (with auto-fix!)
|
|
328
|
+
import { createTheme } from '@mui/material/styles'
|
|
329
|
+
|
|
330
|
+
// โ experimentalStyled - REMOVED
|
|
331
|
+
import { experimentalStyled } from '@mui/material/styles'
|
|
332
|
+
|
|
333
|
+
// โ
Use styled (with auto-fix!)
|
|
334
|
+
import { styled } from '@mui/material/styles'
|
|
335
|
+
|
|
336
|
+
// โ StyledEngineProvider from wrong location - REMOVED (NEW in v1.5.1!)
|
|
337
|
+
import { StyledEngineProvider } from '@mui/material'
|
|
338
|
+
|
|
339
|
+
// โ
Import from correct location (with auto-fix!)
|
|
340
|
+
import { StyledEngineProvider } from '@mui/material/styles'
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### `mui-v7/no-deep-imports` โจ NEW in v1.4.0
|
|
344
|
+
|
|
345
|
+
Detects deep imports that break in V7 due to the exports field.
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
// โ Deep imports don't work anymore
|
|
349
|
+
import Button from '@mui/material/Button/Button'
|
|
350
|
+
|
|
351
|
+
// โ
Use main entry point (with auto-fix!)
|
|
352
|
+
import { Button } from '@mui/material'
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### ๐ก Best Practices (Warnings)
|
|
356
|
+
|
|
357
|
+
These are suggestions, not breaking changes.
|
|
358
|
+
|
|
359
|
+
#### `mui-v7/prefer-slots-api` โจ NEW in v1.3.0
|
|
360
|
+
|
|
361
|
+
Recommends using slots/slotProps instead of components/componentsProps.
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
// โ ๏ธ Deprecated (still works but will be removed)
|
|
365
|
+
<TextField
|
|
366
|
+
components={{ Input: CustomInput }}
|
|
367
|
+
componentsProps={{ input: { className: 'custom' } }}
|
|
368
|
+
/>
|
|
369
|
+
|
|
370
|
+
// โ
Recommended: New slots API
|
|
371
|
+
<TextField
|
|
372
|
+
slots={{ input: CustomInput }}
|
|
373
|
+
slotProps={{ input: { className: 'custom' } }}
|
|
374
|
+
/>
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### `mui-v7/prefer-theme-vars` โจ IMPROVED in v1.5.0
|
|
378
|
+
|
|
379
|
+
When using `cssVariables: true`, use `theme.vars.*` for better performance and automatic dark mode. Now with **auto-fix**!
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
// โ ๏ธ Works but doesn't change with dark mode automatically
|
|
383
|
+
const Custom = styled('div')(({ theme }) => ({
|
|
384
|
+
color: theme.palette.text.primary,
|
|
385
|
+
}))
|
|
386
|
+
|
|
387
|
+
// โ
Better: Changes automatically with dark mode (with auto-fix!)
|
|
388
|
+
const Custom = styled('div')(({ theme }) => ({
|
|
389
|
+
color: theme.vars.palette.text.primary,
|
|
390
|
+
}))
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## ๐ Example Messages
|
|
394
|
+
|
|
395
|
+
The plugin provides educational messages with emojis and examples:
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
๐ฏ Grid in MUI V7 no longer uses the `item` prop!
|
|
399
|
+
|
|
400
|
+
๐ง Old way (V6):
|
|
401
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
402
|
+
|
|
403
|
+
โ
New way (V7):
|
|
404
|
+
<Grid size={{ xs: 12, sm: 6, md: 4 }}>
|
|
405
|
+
|
|
406
|
+
๐ก The new syntax is cleaner and more powerful!
|
|
407
|
+
You can use: size, offset, responsive spacing, and more.
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
## ๐ง Configuration Presets
|
|
411
|
+
|
|
412
|
+
### `recommended` - Balanced (Default)
|
|
413
|
+
|
|
414
|
+
Breaking changes as **errors**, best practices as **warnings**.
|
|
415
|
+
|
|
416
|
+
```javascript
|
|
417
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
418
|
+
|
|
419
|
+
export default [
|
|
420
|
+
muiV7Plugin.configs.recommended,
|
|
421
|
+
]
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### `strict` - Strict Mode
|
|
425
|
+
|
|
426
|
+
Everything as **errors** (including best practices).
|
|
427
|
+
|
|
428
|
+
```javascript
|
|
429
|
+
import muiV7Plugin from 'eslint-plugin-mui-v7'
|
|
430
|
+
|
|
431
|
+
export default [
|
|
432
|
+
muiV7Plugin.configs.strict,
|
|
433
|
+
]
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## ๐ What's New
|
|
437
|
+
|
|
438
|
+
### v1.5.1 (2025-11-14) - Complete Coverage! โ
|
|
439
|
+
|
|
440
|
+
#### Added
|
|
441
|
+
- โจ **StyledEngineProvider import detection** in `no-deprecated-imports`
|
|
442
|
+
- Detects incorrect imports from `@mui/material` instead of `@mui/material/styles`
|
|
443
|
+
- Automatic fix to correct import location
|
|
444
|
+
- Completes **100% coverage** of all detectable MUI V7 breaking changes!
|
|
445
|
+
|
|
446
|
+
#### Coverage Achievement
|
|
447
|
+
- โ
**8/8** rules with autofix support (100%)
|
|
448
|
+
- โ
**0** known false positives
|
|
449
|
+
|
|
450
|
+
### v1.5.0 (2025-11-14) - 100% Autofix! ๐ฏ
|
|
451
|
+
|
|
452
|
+
#### Added
|
|
453
|
+
- โจ **Autofix for `prefer-theme-vars`**: Automatically transforms `theme.palette.*` โ `theme.vars.palette.*`
|
|
454
|
+
- Works in styled components, sx props, template literals, and object expressions
|
|
455
|
+
- Safely handles edge cases (ternary conditionals, non-null assertions)
|
|
456
|
+
- **Achieved 100% autofix coverage for all 10 rules!** ๐ฏ
|
|
457
|
+
|
|
458
|
+
### v1.4.1 (2025-11-14) - Critical Bug Fix! ๐ง
|
|
459
|
+
|
|
460
|
+
#### Fixed
|
|
461
|
+
- ๐ **Removed 12 false positives** from `no-lab-imports` rule:
|
|
462
|
+
- **Timeline components** (7): Still in `@mui/lab`, not moved to `@mui/material`
|
|
463
|
+
- **Tab components** (3): TabContext, TabList, TabPanel still in `@mui/lab`
|
|
464
|
+
- **TreeView components** (2): Moved to `@mui/x-tree-view`, not `@mui/material`
|
|
465
|
+
|
|
466
|
+
### v1.4.0 (2025-11-14) - New Rules! ๐
|
|
467
|
+
|
|
468
|
+
#### Added
|
|
469
|
+
- โจ **no-deep-imports**: Detects deep imports that break due to exports field (with auto-fix!)
|
|
470
|
+
|
|
471
|
+
#### Enhanced
|
|
472
|
+
- ๐ง **no-grid-item-prop**: Added safety check to prevent autofix when spread props are present
|
|
473
|
+
- ๐ **Documentation**: Added "Known Limitations" section explaining edge cases
|
|
474
|
+
|
|
475
|
+
### v1.3.0 (2025-11-14) - Major Update! ๐
|
|
476
|
+
|
|
477
|
+
#### New Rules
|
|
478
|
+
- โจ **no-deprecated-imports**: Detects `createMuiTheme` and `experimentalStyled` (with auto-fix!)
|
|
479
|
+
- โจ **prefer-slots-api**: Recommends `slots`/`slotProps` over `components`/`componentsProps`
|
|
480
|
+
|
|
481
|
+
#### Enhanced Rules
|
|
482
|
+
- ๐ง **no-deprecated-props**: Now detects `Modal.onBackdropClick` and `PigmentHidden` component
|
|
483
|
+
- ๐ง **no-deprecated-props**: Auto-fix for `InputLabel size="normal"` โ `size="medium"`
|
|
484
|
+
- ๐ง **no-grid-item-prop**: Smart auto-fix that converts breakpoint props to `size` object
|
|
485
|
+
- ๐ง **no-grid2-import**: Improved fix that properly renames `Grid2` โ `Grid` and `grid2Classes` โ `gridClasses`
|
|
486
|
+
|
|
487
|
+
#### Code Quality
|
|
488
|
+
- โ
Added comprehensive test suite with 50+ test cases
|
|
489
|
+
- ๐ก๏ธ Added optional chaining (`?.`) for safer AST navigation
|
|
490
|
+
- ๐ฆ Updated package.json with proper test scripts
|
|
491
|
+
- ๐ Updated to run tests before publishing (`prepublishOnly`)
|
|
492
|
+
|
|
493
|
+
### v1.2.1 (2025-10-30)
|
|
494
|
+
|
|
495
|
+
#### UX Improvements
|
|
496
|
+
- โจ Enhanced `no-lab-imports` to show **all moved components** in error messages
|
|
497
|
+
- ๐ Before: `Este componente foi movido` (showed only first component)
|
|
498
|
+
- ๐ฏ Now: `3 componente(s) movido(s)` with complete list: `Alert, Autocomplete, Rating`
|
|
499
|
+
|
|
500
|
+
### v1.2.0 (2025-10-30)
|
|
501
|
+
|
|
502
|
+
#### Performance
|
|
503
|
+
- โก Optimized `no-lab-imports`: O(nรm) โ O(n) using Set lookup instead of Array.includes
|
|
504
|
+
- โก Optimized `prefer-theme-vars`: Added WeakMap cache for getText() calls to eliminate duplicate I/O
|
|
505
|
+
- ๐งน Improved code readability with optional chaining and early returns
|
|
506
|
+
- ๐ Moved `MOVED_COMPONENTS` to module scope to avoid recreation on every rule invocation
|
|
507
|
+
|
|
508
|
+
#### Internal
|
|
509
|
+
- ๐๏ธ Formalized AST traversal depth tracking with MAX_DEPTH constant
|
|
510
|
+
- ๐พ Source text caching to prevent redundant file reads
|
|
511
|
+
|
|
512
|
+
## โ ๏ธ Known Limitations
|
|
513
|
+
|
|
514
|
+
This plugin has some limitations to ensure safe and reliable autofixes:
|
|
515
|
+
|
|
516
|
+
### 1. **Spread Props are Not Auto-Fixed**
|
|
517
|
+
|
|
518
|
+
When a component has spread props (`{...props}`), the autofix is disabled to avoid potential issues:
|
|
519
|
+
|
|
520
|
+
```tsx
|
|
521
|
+
// โ Plugin detects the issue but WON'T auto-fix (safe!)
|
|
522
|
+
<Grid {...props} item xs={12}>Content</Grid>
|
|
523
|
+
|
|
524
|
+
// Why? If props contains { item: true, xs: 6 }, the spread would override our fix
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
**Solution:** Fix manually or remove the spread props first.
|
|
528
|
+
|
|
529
|
+
### 2. **Dynamic Props are Not Auto-Fixed**
|
|
530
|
+
|
|
531
|
+
Complex expressions and variables are not auto-fixed:
|
|
532
|
+
|
|
533
|
+
```tsx
|
|
534
|
+
// โ Plugin detects but WON'T auto-fix (safe!)
|
|
535
|
+
<Grid item xs={isMobile ? 12 : 6}>Content</Grid>
|
|
536
|
+
<Grid item xs={colSize}>Content</Grid>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
**Solution:** These require manual migration to `size` prop.
|
|
540
|
+
|
|
541
|
+
### 3. **Cross-File Dependencies**
|
|
542
|
+
|
|
543
|
+
The plugin cannot detect issues that span multiple files:
|
|
544
|
+
|
|
545
|
+
```tsx
|
|
546
|
+
// File 1: component-props.ts
|
|
547
|
+
export const gridProps = { item: true, xs: 12 }
|
|
548
|
+
|
|
549
|
+
// File 2: Component.tsx - Plugin won't detect this!
|
|
550
|
+
<Grid {...gridProps}>Content</Grid>
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
**Solution:** Run the plugin on all files and review spread props carefully.
|
|
554
|
+
|
|
555
|
+
### 4. **Best Practices vs Breaking Changes**
|
|
556
|
+
|
|
557
|
+
The plugin focuses on **breaking changes only**. Some MUI best practices are not enforced:
|
|
558
|
+
|
|
559
|
+
- โ
Detects: Code that **breaks** in V7
|
|
560
|
+
- โ Doesn't detect: Deprecated but still working code (unless it's in the migration path)
|
|
561
|
+
|
|
562
|
+
### ๐ For Complex Cases
|
|
563
|
+
|
|
564
|
+
For complex migrations, consider using MUI's official codemods:
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
# Official MUI codemods
|
|
568
|
+
npx @mui/codemod v7.0.0/grid-props <path>
|
|
569
|
+
npx @mui/codemod v7.0.0/lab-removed-components <path>
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
**This plugin complements the codemods by providing continuous validation!**
|
|
573
|
+
|
|
574
|
+
## ๐งช Testing
|
|
575
|
+
|
|
576
|
+
Run the comprehensive test suite:
|
|
577
|
+
|
|
578
|
+
```bash
|
|
579
|
+
npm test
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
Watch mode for development:
|
|
583
|
+
|
|
584
|
+
```bash
|
|
585
|
+
npm run test:watch
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
## ๐ค Contributing
|
|
589
|
+
|
|
590
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
591
|
+
|
|
592
|
+
## ๐ License
|
|
593
|
+
|
|
594
|
+
MIT ยฉ Matheus Pimenta (Koda AI Studio)
|
|
595
|
+
|
|
596
|
+
## ๐ Links
|
|
597
|
+
|
|
598
|
+
- [Material-UI V7 Migration Guide](https://mui.com/material-ui/migration/upgrade-to-v7/)
|
|
599
|
+
- [GitHub Repository](https://github.com/Just-mpm/eslint-plugin-mui-v7)
|
|
600
|
+
- [npm Package](https://www.npmjs.com/package/eslint-plugin-mui-v7)
|
|
601
|
+
|
|
602
|
+
## โค๏ธ Credits
|
|
603
|
+
|
|
604
|
+
Created by **Matheus Pimenta** (Koda AI Studio) + **Claude Code**
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
**Keywords:** eslint, mui, material-ui, mui-v7, react, typescript, linter, code-quality, migration, breaking-changes
|