@@ -8,19 +8,19 @@ and `propTypes` are declared in an ES6 class.
88
99By default, this rule will check for and warn about declaring any of the above properties outside of the class body.
1010
11- There are three key options are ` static public field ` , ` static getter ` , and ` property assignment ` .
11+ The three key options are ` static public field ` , ` static getter ` , and ` property assignment ` .
1212
1313### When ` static public field ` is enabled (default):
1414
1515Examples of ** incorrect** code for this rule:
1616
1717``` js
1818class MyComponent extends React .Component {
19- static get childContextTypes () { /* ...*/ }
20- static get contextTypes () { /* ...*/ }
21- static get contextType () { /* ...*/ }
22- static get displayName () { /* ...*/ }
23- static get defaultProps () { /* ...*/ }
19+ static get childContextTypes () { /* ...*/ }
20+ static get contextTypes () { /* ...*/ }
21+ static get contextType () { /* ...*/ }
22+ static get displayName () { /* ...*/ }
23+ static get defaultProps () { /* ...*/ }
2424 static get propTypes () { /* ...*/ }
2525}
2626```
@@ -39,11 +39,11 @@ Examples of **correct** code for this rule:
3939
4040``` js
4141class MyComponent extends React .Component {
42- static childContextTypes = { /* ...*/ };
43- static contextTypes = { /* ...*/ };
44- static contextType = { /* ...*/ };
45- static displayName = " Hello" ;
46- static defaultProps = { /* ...*/ };
42+ static childContextTypes = { /* ...*/ };
43+ static contextTypes = { /* ...*/ };
44+ static contextType = { /* ...*/ };
45+ static displayName = " Hello" ;
46+ static defaultProps = { /* ...*/ };
4747 static propTypes = { /* ...*/ };
4848}
4949```
@@ -54,11 +54,11 @@ Examples of **incorrect** code for this rule:
5454
5555``` js
5656class MyComponent extends React .Component {
57- static childContextTypes = { /* ...*/ };
58- static contextTypes = { /* ...*/ };
59- static contextType = { /* ...*/ };
60- static displayName = " Hello" ;
61- static defaultProps = { /* ...*/ };
57+ static childContextTypes = { /* ...*/ };
58+ static contextTypes = { /* ...*/ };
59+ static contextType = { /* ...*/ };
60+ static displayName = " Hello" ;
61+ static defaultProps = { /* ...*/ };
6262 static propTypes = { /* ...*/ };
6363}
6464```
@@ -77,11 +77,11 @@ Examples of **correct** code for this rule:
7777
7878``` js
7979class MyComponent extends React .Component {
80- static get childContextTypes () { /* ...*/ }
81- static get contextTypes () { /* ...*/ }
82- static get contextType () { /* ...*/ }
83- static get displayName () { /* ...*/ }
84- static get defaultProps () { /* ...*/ }
80+ static get childContextTypes () { /* ...*/ }
81+ static get contextTypes () { /* ...*/ }
82+ static get contextType () { /* ...*/ }
83+ static get displayName () { /* ...*/ }
84+ static get defaultProps () { /* ...*/ }
8585 static get propTypes () { /* ...*/ }
8686}
8787```
@@ -92,22 +92,22 @@ Examples of **incorrect** code for this rule:
9292
9393``` js
9494class MyComponent extends React .Component {
95- static childContextTypes = { /* ...*/ };
96- static contextTypes = { /* ...*/ };
97- static contextType = { /* ...*/ };
98- static displayName = " Hello" ;
99- static defaultProps = { /* ...*/ };
95+ static childContextTypes = { /* ...*/ };
96+ static contextTypes = { /* ...*/ };
97+ static contextType = { /* ...*/ };
98+ static displayName = " Hello" ;
99+ static defaultProps = { /* ...*/ };
100100 static propTypes = { /* ...*/ };
101101}
102102```
103103
104104``` js
105105class MyComponent extends React .Component {
106- static get childContextTypes () { /* ...*/ }
107- static get contextTypes () { /* ...*/ }
108- static get contextType () { /* ...*/ }
109- static get displayName () { /* ...*/ }
110- static get defaultProps () { /* ...*/ }
106+ static get childContextTypes () { /* ...*/ }
107+ static get contextTypes () { /* ...*/ }
108+ static get contextType () { /* ...*/ }
109+ static get displayName () { /* ...*/ }
110+ static get defaultProps () { /* ...*/ }
111111 static get propTypes () { /* ...*/ }
112112}
113113```
@@ -159,7 +159,7 @@ The `<string>` value must be one these options:
159159* ` static getter `
160160* ` property assignment `
161161
162- The ` options ` schema defined above allows you to specify different rules for the different property fields available.
162+ The ` options ` schema defined above allows you to specify different rules for the different property fields available.
163163
164164##### Example configuration:
165165_ This is only an example, we do not recommend this as a configuration._
0 commit comments