@@ -14,30 +14,33 @@ There is a configurable number of attributes that are acceptable in one-line cas
1414:-1 : Examples of ** incorrect** code for this rule:
1515
1616``` html
17- <component lorem =" 1" ipsum =" 2" dolor =" 3" sit =" 4" >
18- </component >
17+ <MyComponent lorem =" 1" ipsum =" 2" />
1918
20- <component
19+ <MyComponent
20+ lorem =" 1" ipsum =" 2"
21+ />
22+
23+ <MyComponent
2124 lorem =" 1" ipsum =" 2"
2225 dolor =" 3"
23- sit =" 4"
24- >
25- </component >
26+ />
2627```
2728
2829:+1 : Examples of ** correct** code for this rule:
2930
3031``` html
31- <component lorem =" 1" ipsum =" 2" dolor =" 3" >
32- </component >
32+ <MyComponent lorem =" 1" />
33+
34+ <MyComponent
35+ lorem =" 1"
36+ ipsum =" 2"
37+ />
3338
34- <component
39+ <MyComponent
3540 lorem =" 1"
3641 ipsum =" 2"
3742 dolor =" 3"
38- sit =" 4"
39- >
40- </component >
43+ />
4144```
4245
4346### :wrench : Options
@@ -55,67 +58,67 @@ There is a configurable number of attributes that are acceptable in one-line cas
5558```
5659
5760#### ` allowFirstLine `
61+
5862For multi-line declarations, defines if allows attributes to be put in the first line. (Default false)
5963
6064:-1 : Example of ** incorrect** code for this setting:
65+
6166``` html
62- // [{ "multiline": { "allowFirstLine": false }}]
63- <component foo =" John" bar = " Smith "
64- foobar = {5555555} >
65- </ component >;
67+ <!-- [{ "multiline": { "allowFirstLine": false }}] -->
68+ <MyComponent foo =" John"
69+ bar = " Smith "
70+ />
6671```
6772
6873:+1 : Example of ** correct** code for this setting:
74+
6975``` html
70- // [{ "multiline": { "allowFirstLine": false }}]
71- <component
76+ <!-- [{ "multiline": { "allowFirstLine": false }}] -->
77+ <MyComponent
7278 foo =" John"
7379 bar =" Smith"
74- foobar ={5555555}
75- >
76- </component >;
80+ />
7781```
7882
79-
8083#### ` singleline `
81- Number of maximum attributes per line when the opening tag is in a single line. (Default is 3)
84+
85+ Number of maximum attributes per line when the opening tag is in a single line. (Default is 1)
8286
8387:-1 : Example of ** incorrect** code for this setting:
8488``` html
85- // [{"singleline": 2,}]
86- <component foo =" John" bar =" Smith" foobar = {5555555} ></ component >;
89+ <!-- [{"singleline": 1}] -->
90+ <MyComponent foo =" John" bar =" Smith" />
8791```
8892
8993:+1 : Example of ** correct** code for this setting:
9094``` html
91- // [{"singleline": 3,}]
92- <component foo =" John" bar = " Smith " foobar = {5555555} ></ component >;
95+ <!-- [{"singleline": 1}] -->
96+ <MyComponent foo =" John" />
9397```
9498
95-
9699#### ` multiline `
100+
97101Number of maximum attributes per line when a tag is in multiple lines. (Default is 1)
98102
99103:-1 : Example of ** incorrect** code for this setting:
104+
100105``` html
101- // [{"multiline": 1}]
102- <component foo = " John " bar = " Smith "
103- foobar = {5555555} >
104- </ component >;
106+ <!-- [{"multiline": 1}] -->
107+ <MyComponent
108+ foo = " John " bar = " Smith "
109+ />
105110```
106111
107112:+1 : Example of ** correct** code for this setting:
113+
108114``` html
109- // [{"multiline": 1}]
110- <component
115+ <!-- [{"multiline": 1}] -->
116+ <MyComponent
111117 foo =" John"
112118 bar =" Smith"
113- foobar ={5555555}
114- >
115- </component >;
119+ />
116120```
117121
118122## When Not To Use It
119123
120124If you do not want to check the number of attributes declared per line you can disable this rule.
121-
0 commit comments