Skip to content

Commit d254367

Browse files
committed
chore: sync html prettier tests
1 parent d74c8bd commit d254367

File tree

216 files changed

+3977
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+3977
-45
lines changed

benchmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"@typescript-eslint/parser": "8.46.4",
1616
"dprint": "0.50.2",
1717
"eslint": "9.39.1",
18-
"prettier": "3.6.2"
18+
"prettier": "3.7.1"
1919
}
2020
}

crates/biome_formatter_test/src/prettier/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"start": "node prepare_tests"
55
},
66
"dependencies": {
7-
"prettier": "3.6.2"
7+
"prettier": "3.7.1"
88
},
99
"private": true
1010
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<button onclick="alert( '1')">click me!</button>
2+
3+
<div onclick="handleClick( event )" onmouseover="showTooltip( this )" onmouseout="hideTooltip( )">Hover me</div>
4+
5+
<img onerror='handleError( this )' onload="imageLoaded( event )" />
6+
7+
<button onclick="(event) => { console.log('clicked'); handleClick( event ); }">Modern JS</button>
8+
9+
<div onclick="processData( { id: 123, name: 'test' }, [ 1, 2, 3 ] )">Data</div>
10+
11+
<button onclick="api.user.get( 123 ).then( data => updateUI( data ) )">API Call</button>
12+
13+
<input onfocus="highlightField( this )" onblur="validateField( this.value )" />
14+
<select onchange="filterResults( this.value, this.selectedIndex )">
15+
<option>Option 1</option>
16+
</select>
17+
18+
<button onclick="
19+
alert(1); alert(2);
20+
">Click</button>
21+
22+
<button onclick="
23+
return false
24+
">Click</button>
25+
26+
<button onclick="
27+
console.log(arguments)
28+
">Click</button>
29+
30+
<button onclick="
31+
console.log(onclick)
32+
">Click</button>
33+
34+
<button onclick="
35+
'use strict'
36+
console.log(onclick)
37+
">Click</button>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<button onclick="alert('1')">click me!</button>
2+
3+
<div
4+
onclick="handleClick(event)"
5+
onmouseover="showTooltip(this)"
6+
onmouseout="hideTooltip()"
7+
>
8+
Hover me
9+
</div>
10+
11+
<img onerror="handleError(this)" onload="imageLoaded(event)" />
12+
13+
<button
14+
onclick="
15+
(event) => {
16+
console.log('clicked');
17+
handleClick(event);
18+
}
19+
"
20+
>
21+
Modern JS
22+
</button>
23+
24+
<div onclick="processData({ id: 123, name: 'test' }, [1, 2, 3])">Data</div>
25+
26+
<button onclick="api.user.get(123).then((data) => updateUI(data))">
27+
API Call
28+
</button>
29+
30+
<input onfocus="highlightField(this)" onblur="validateField(this.value)" />
31+
<select onchange="filterResults(this.value, this.selectedIndex)">
32+
<option>Option 1</option>
33+
</select>
34+
35+
<button
36+
onclick="
37+
alert(1);
38+
alert(2);
39+
"
40+
>
41+
Click
42+
</button>
43+
44+
<button onclick="return false;">Click</button>
45+
46+
<button onclick="console.log(arguments)">Click</button>
47+
48+
<button onclick="console.log(onclick)">Click</button>
49+
50+
<button
51+
onclick='
52+
"use strict";
53+
console.log(onclick);
54+
'
55+
>
56+
Click
57+
</button>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<button onclick="alert('1')">click me!</button>
2+
3+
<div
4+
onclick="handleClick(event)"
5+
onmouseover="showTooltip(this)"
6+
onmouseout="hideTooltip()"
7+
>
8+
Hover me
9+
</div>
10+
11+
<img onerror="handleError(this)" onload="imageLoaded(event)" />
12+
13+
<button
14+
onclick="
15+
(event) => {
16+
console.log('clicked');
17+
handleClick(event);
18+
}
19+
"
20+
>
21+
Modern JS
22+
</button>
23+
24+
<div onclick="processData({ id: 123, name: 'test' }, [1, 2, 3])">Data</div>
25+
26+
<button onclick="api.user.get(123).then((data) => updateUI(data))">
27+
API Call
28+
</button>
29+
30+
<input onfocus="highlightField(this)" onblur="validateField(this.value)" />
31+
<select onchange="filterResults(this.value, this.selectedIndex)">
32+
<option>Option 1</option>
33+
</select>
34+
35+
<button
36+
onclick="
37+
alert(1);
38+
alert(2);
39+
"
40+
>
41+
Click
42+
</button>
43+
44+
<button onclick="return false;">Click</button>
45+
46+
<button onclick="console.log(arguments)">Click</button>
47+
48+
<button onclick="console.log(onclick)">Click</button>
49+
50+
<button
51+
onclick="
52+
&quot;use strict&quot;;
53+
console.log(onclick);
54+
"
55+
>
56+
Click
57+
</button>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<iframe allow></iframe>
2+
<iframe allow=""></iframe>
3+
<iframe allow=" "></iframe>
4+
<iframe allow=" ; "></iframe>
5+
<iframe allow=" ; ; ; "></iframe>
6+
<iframe allow=" camera"></iframe>
7+
<iframe allow="payment; usb; serial"></iframe>
8+
<iframe allow=" camera;; microphone;;;"></iframe>
9+
<iframe allow=" camera 'self'; ambient-light-sensor 'self'"></iframe>
10+
<iframe allow=" camera 'self'; ambient-light-sensor 'self'"></iframe>
11+
<iframe allow=" camera
12+
'self';
13+
ambient-light-sensor 'self'"></iframe>
14+
<iframe allow="camera https://very-long-subdomain.very-long-domain-name.example.com https://another-very-long-subdomain.another-very-long-domain.example.org; microphone https://extremely-long-subdomain-name.extremely-long-domain-name.example.net"></iframe>
15+
<iframe allow="camera https://sub-domain.example.com:8080/path?query=value#fragment; microphone 'self'"></iframe>
16+
<iframe allow="camera https://subdomain1.example.com https://subdomain2.example.com https://subdomain3.example.com https://subdomain4.example.com https://subdomain5.example.com"></iframe>
17+
18+
<!-- Uppper case -->
19+
<iframe allow="CAMERA 'self'; MICROPHONE 'none'; GEOlocation https://example.com"></iframe>
20+
<iframe allow="CAMERA 'self'; UNKOWN-DIRECTIVE"></iframe>
21+
22+
<!-- Duplicated -->
23+
<iframe allow="camera 'none'; camera 'self'; CAMERA 'self'"></iframe>
24+
25+
<!-- None ASCII -->
26+
<iframe allow=" 中文-dirctive-name"></iframe>
27+
<iframe allow=" 中文-dirctive-name 'self' ; microphone 中文-origin"></iframe>
28+
29+
<!-- Not iframe-->
30+
<a allow="
31+
camera 'self';
32+
ambient-light-sensor 'self'
33+
"></a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<iframe allow></iframe>
2+
<iframe allow=""></iframe>
3+
<iframe allow=""></iframe>
4+
<iframe allow=""></iframe>
5+
<iframe allow=""></iframe>
6+
<iframe allow="camera"></iframe>
7+
<iframe allow="payment; usb; serial"></iframe>
8+
<iframe allow="camera; microphone"></iframe>
9+
<iframe allow="camera 'self'; ambient-light-sensor 'self'"></iframe>
10+
<iframe allow="camera 'self'; ambient-light-sensor 'self'"></iframe>
11+
<iframe allow="camera 'self'; ambient-light-sensor 'self'"></iframe>
12+
<iframe
13+
allow="
14+
camera https://very-long-subdomain.very-long-domain-name.example.com https://another-very-long-subdomain.another-very-long-domain.example.org;
15+
microphone https://extremely-long-subdomain-name.extremely-long-domain-name.example.net;
16+
"
17+
></iframe>
18+
<iframe
19+
allow="
20+
camera https://sub-domain.example.com:8080/path?query=value#fragment;
21+
microphone 'self';
22+
"
23+
></iframe>
24+
<iframe
25+
allow="
26+
camera https://subdomain1.example.com https://subdomain2.example.com https://subdomain3.example.com https://subdomain4.example.com https://subdomain5.example.com;
27+
"
28+
></iframe>
29+
30+
<!-- Uppper case -->
31+
<iframe
32+
allow="CAMERA 'self'; MICROPHONE 'none'; GEOlocation https://example.com"
33+
></iframe>
34+
<iframe allow="CAMERA 'self'; UNKOWN-DIRECTIVE"></iframe>
35+
36+
<!-- Duplicated -->
37+
<iframe allow="camera 'none'; camera 'self'; CAMERA 'self'"></iframe>
38+
39+
<!-- None ASCII -->
40+
<iframe allow="中文-dirctive-name"></iframe>
41+
<iframe allow="中文-dirctive-name 'self'; microphone 中文-origin"></iframe>
42+
43+
<!-- Not iframe-->
44+
<a
45+
allow="
46+
camera 'self';
47+
ambient-light-sensor 'self'
48+
"
49+
></a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<iframe allow="camera 'self'; microphone 'self'"></iframe>
2+
<iframe allow="camera ; microphone"></iframe>
3+
<iframe allow=""></iframe>
4+
<iframe allow=";"></iframe>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<iframe allow="camera 'self'; microphone 'self'"></iframe>
2+
<iframe allow="camera ; microphone"></iframe>
3+
<iframe allow=""></iframe>
4+
<iframe allow=";"></iframe>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<button
2+
onclick="[foo, bar].forEach((fn) => void fn())"
3+
></button>
4+
<button
5+
onclick="[foo, bar].forEach((fn) => void fn()); alert(1)"
6+
></button>

0 commit comments

Comments
 (0)