@@ -185,7 +185,13 @@ ruleTester.run('no-typos', rule, {
185
185
} , {
186
186
code : [
187
187
'class Hello extends React.Component {' ,
188
+ ' componentWillMount() { }' ,
189
+ ' componentDidMount() { }' ,
190
+ ' componentWillReceiveProps() { }' ,
191
+ ' shouldComponentUpdate() { }' ,
192
+ ' componentWillUpdate() { }' ,
188
193
' componentDidUpdate() { }' ,
194
+ ' componentWillUnmount() { }' ,
189
195
' render() {' ,
190
196
' return <div>Hello {this.props.name}</div>;' ,
191
197
' }' ,
@@ -194,34 +200,43 @@ ruleTester.run('no-typos', rule, {
194
200
parserOptions : parserOptions
195
201
} , {
196
202
code : [
197
- 'class Hello extends React.Component {' ,
203
+ 'class MyClass {' ,
198
204
' componentWillMount() { }' ,
205
+ ' componentDidMount() { }' ,
206
+ ' componentWillReceiveProps() { }' ,
207
+ ' shouldComponentUpdate() { }' ,
208
+ ' componentWillUpdate() { }' ,
199
209
' componentDidUpdate() { }' ,
200
- ' render() {' ,
201
- ' return <div>Hello {this.props.name}</div>;' ,
202
- ' }' ,
210
+ ' componentWillUnmount() { }' ,
211
+ ' render() { }' ,
203
212
'}'
204
213
] . join ( '\n' ) ,
205
214
parserOptions : parserOptions
206
215
} , {
207
216
code : [
208
- 'class Hello extends React.Component {' ,
209
- ' componentWillUnmount() { }' ,
210
- ' componentWillMount() { }' ,
211
- ' render() {' ,
212
- ' return <div>Hello {this.props.name}</div>;' ,
213
- ' }' ,
217
+ 'class MyClass {' ,
218
+ ' componentwillmount() { }' ,
219
+ ' componentdidmount() { }' ,
220
+ ' componentwillreceiveprops() { }' ,
221
+ ' shouldcomponentupdate() { }' ,
222
+ ' componentwillupdate() { }' ,
223
+ ' componentdidupdate() { }' ,
224
+ ' componentwillUnmount() { }' ,
225
+ ' render() { }' ,
214
226
'}'
215
227
] . join ( '\n' ) ,
216
228
parserOptions : parserOptions
217
229
} , {
218
230
code : [
219
- 'class Hello extends React.Component {' ,
220
- ' shouldComponentUpdate() { }' ,
221
- ' componentWillReceiveProps() { }' ,
222
- ' render() {' ,
223
- ' return <div>Hello {this.props.name}</div>;' ,
224
- ' }' ,
231
+ 'class MyClass {' ,
232
+ ' Componentwillmount() { }' ,
233
+ ' Componentdidmount() { }' ,
234
+ ' Componentwillreceiveprops() { }' ,
235
+ ' Shouldcomponentupdate() { }' ,
236
+ ' Componentwillupdate() { }' ,
237
+ ' Componentdidupdate() { }' ,
238
+ ' ComponentwillUnmount() { }' ,
239
+ ' Render() { }' ,
225
240
'}'
226
241
] . join ( '\n' ) ,
227
242
parserOptions : parserOptions
@@ -414,7 +429,13 @@ ruleTester.run('no-typos', rule, {
414
429
} , {
415
430
code : [
416
431
'class Hello extends React.Component {' ,
432
+ ' ComponentWillMount() { }' ,
433
+ ' ComponentDidMount() { }' ,
434
+ ' ComponentWillReceiveProps() { }' ,
435
+ ' ShouldComponentUpdate() { }' ,
436
+ ' ComponentWillUpdate() { }' ,
417
437
' ComponentDidUpdate() { }' ,
438
+ ' ComponentWillUnmount() { }' ,
418
439
' render() {' ,
419
440
' return <div>Hello {this.props.name}</div>;' ,
420
441
' }' ,
@@ -424,12 +445,36 @@ ruleTester.run('no-typos', rule, {
424
445
errors : [ {
425
446
message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
426
447
type : 'MethodDefinition'
448
+ } , {
449
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
450
+ type : 'MethodDefinition'
451
+ } , {
452
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
453
+ type : 'MethodDefinition'
454
+ } , {
455
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
456
+ type : 'MethodDefinition'
457
+ } , {
458
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
459
+ type : 'MethodDefinition'
460
+ } , {
461
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
462
+ type : 'MethodDefinition'
463
+ } , {
464
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
465
+ type : 'MethodDefinition'
427
466
} ]
428
467
} , {
429
468
code : [
430
469
'class Hello extends React.Component {' ,
431
- ' componentwillreceiveprops() { }' ,
432
- ' render() {' ,
470
+ ' Componentwillmount() { }' ,
471
+ ' Componentdidmount() { }' ,
472
+ ' Componentwillreceiveprops() { }' ,
473
+ ' Shouldcomponentupdate() { }' ,
474
+ ' Componentwillupdate() { }' ,
475
+ ' Componentdidupdate() { }' ,
476
+ ' Componentwillunmount() { }' ,
477
+ ' Render() {' ,
433
478
' return <div>Hello {this.props.name}</div>;' ,
434
479
' }' ,
435
480
'}'
@@ -438,12 +483,38 @@ ruleTester.run('no-typos', rule, {
438
483
errors : [ {
439
484
message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
440
485
type : 'MethodDefinition'
486
+ } , {
487
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
488
+ type : 'MethodDefinition'
489
+ } , {
490
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
491
+ type : 'MethodDefinition'
492
+ } , {
493
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
494
+ type : 'MethodDefinition'
495
+ } , {
496
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
497
+ type : 'MethodDefinition'
498
+ } , {
499
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
500
+ type : 'MethodDefinition'
501
+ } , {
502
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
503
+ type : 'MethodDefinition'
504
+ } , {
505
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
506
+ type : 'MethodDefinition'
441
507
} ]
442
508
} , {
443
509
code : [
444
510
'class Hello extends React.Component {' ,
445
- ' componentWillReceiveProps() { }' ,
446
- ' componentWillupdate() { }' ,
511
+ ' componentwillmount() { }' ,
512
+ ' componentdidmount() { }' ,
513
+ ' componentwillreceiveprops() { }' ,
514
+ ' shouldcomponentupdate() { }' ,
515
+ ' componentwillupdate() { }' ,
516
+ ' componentdidupdate() { }' ,
517
+ ' componentwillunmount() { }' ,
447
518
' render() {' ,
448
519
' return <div>Hello {this.props.name}</div>;' ,
449
520
' }' ,
@@ -453,6 +524,24 @@ ruleTester.run('no-typos', rule, {
453
524
errors : [ {
454
525
message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
455
526
type : 'MethodDefinition'
527
+ } , {
528
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
529
+ type : 'MethodDefinition'
530
+ } , {
531
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
532
+ type : 'MethodDefinition'
533
+ } , {
534
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
535
+ type : 'MethodDefinition'
536
+ } , {
537
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
538
+ type : 'MethodDefinition'
539
+ } , {
540
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
541
+ type : 'MethodDefinition'
542
+ } , {
543
+ message : ERROR_MESSAGE_LIFECYCLE_METHOD ,
544
+ type : 'MethodDefinition'
456
545
} ]
457
546
} ]
458
547
} ) ;
0 commit comments