Skip to content

Commit 10384b6

Browse files
committed
chore(eslint): added new eslint rule (for jsx)
1 parent 4d83bd5 commit 10384b6

File tree

26 files changed

+177
-166
lines changed

26 files changed

+177
-166
lines changed

eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export default tsEslint.config(
3131
rules: {
3232
'stylistic/arrow-parens': ['error', 'always'],
3333
'stylistic/object-curly-spacing': ['error', 'always'],
34+
'stylistic/jsx-pascal-case': 'error',
35+
'stylistic/jsx-curly-spacing': ['error', { when: 'never', children: true }],
36+
'stylistic/jsx-sort-props': 'error',
3437
'prettier/prettier': ['error', { singleQuote: true, semi: true, tabWidth: 2, trailingComma: 'all', quoteProps: 'preserve' }],
3538
'@typescript-eslint/no-floating-promises': 'off',
3639
'@typescript-eslint/no-misused-promises': ['off', { checksVoidReturn: false }],

src/plugins/album-actions/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,26 @@ export default createPlugin<
8181
<>
8282
<Show when={showUnDislike()}>
8383
<UnDislikeButton
84-
onClick={this.loadFullList}
8584
maskSize={unDislikeMaskSize()}
85+
onClick={this.loadFullList}
8686
/>
8787
</Show>
8888
<Show when={showDislike()}>
8989
<DislikeButton
90-
onClick={this.loadFullList}
9190
maskSize={dislikeMaskSize()}
91+
onClick={this.loadFullList}
9292
/>
9393
</Show>
9494
<Show when={showLike()}>
9595
<LikeButton
96-
onClick={this.loadFullList}
9796
maskSize={likeMaskSize()}
97+
onClick={this.loadFullList}
9898
/>
9999
</Show>
100100
<Show when={showUnLike()}>
101101
<UnLikeButton
102-
onClick={this.loadFullList}
103102
maskSize={unLikeMaskSize()}
103+
onClick={this.loadFullList}
104104
/>
105105
</Show>
106106
</>

src/plugins/album-actions/templates/dislike-button.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ export interface DislikeButtonProps {
66
export const DislikeButton = (props: DislikeButtonProps) => (
77
<div class="style-scope">
88
<button
9-
id="alldislike"
10-
data-type="dislike"
11-
data-filled="false"
12-
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
13-
aria-pressed="false"
149
aria-label="Dislike all"
10+
aria-pressed="false"
11+
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
12+
data-filled="false"
13+
data-type="dislike"
14+
id="alldislike"
1515
onClick={(e) => props.onClick?.(e)}
1616
>
1717
<div
18+
aria-hidden="true"
1819
class="yt-spec-button-shape-next__icon"
1920
style={{
2021
'color': 'var(--ytmusic-setting-item-toggle-active)',
2122
}}
22-
aria-hidden="true"
2323
>
2424
<div
25+
aria-hidden="true"
2526
class="yt-spec-button-shape-next__icon"
2627
style={{
2728
'color': 'white',
@@ -32,24 +33,23 @@ export const DislikeButton = (props: DislikeButtonProps) => (
3233
'z-index': 1,
3334
'position': 'absolute',
3435
}}
35-
aria-hidden="true"
3636
>
3737
<div style={{ 'width': '24px', 'height': '24px' }}>
3838
<svg
39-
viewBox="0 0 24 24"
40-
preserveAspectRatio="xMidYMid meet"
4139
class="style-scope yt-icon"
40+
preserveAspectRatio="xMidYMid meet"
4241
style={{
4342
'pointer-events': 'none',
4443
'display': 'block',
4544
'width': '100%',
4645
'height': '100%',
4746
}}
47+
viewBox="0 0 24 24"
4848
>
4949
<g class="style-scope yt-icon">
5050
<path
51-
d="M18,4h3v10h-3V4z M5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21c0.58,0,1.14-0.24,1.52-0.65L17,14V4H6.57 C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14z"
5251
class="style-scope yt-icon"
52+
d="M18,4h3v10h-3V4z M5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21c0.58,0,1.14-0.24,1.52-0.65L17,14V4H6.57 C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14z"
5353
/>
5454
</g>
5555
</svg>
@@ -62,20 +62,20 @@ export const DislikeButton = (props: DislikeButtonProps) => (
6262
}}
6363
>
6464
<svg
65-
viewBox="0 0 24 24"
66-
preserveAspectRatio="xMidYMid meet"
6765
class="style-scope yt-icon"
66+
preserveAspectRatio="xMidYMid meet"
6867
style={{
6968
'pointer-events': 'none',
7069
'display': 'block',
7170
'width': '100%',
7271
'height': '100%',
7372
}}
73+
viewBox="0 0 24 24"
7474
>
7575
<g class="style-scope yt-icon">
7676
<path
77-
d="M18,4h3v10h-3V4z M5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21c0.58,0,1.14-0.24,1.52-0.65L17,14V4H6.57 C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14z"
7877
class="style-scope yt-icon"
78+
d="M18,4h3v10h-3V4z M5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21c0.58,0,1.14-0.24,1.52-0.65L17,14V4H6.57 C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14z"
7979
/>
8080
</g>
8181
</svg>
@@ -87,8 +87,8 @@ export const DislikeButton = (props: DislikeButtonProps) => (
8787
}}
8888
>
8989
<div
90-
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
9190
aria-hidden="true"
91+
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
9292
>
9393
<div class="yt-spec-touch-feedback-shape__stroke" />
9494
<div class="yt-spec-touch-feedback-shape__fill" />

src/plugins/album-actions/templates/like-button.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ export interface LikeButtonProps {
66
export const LikeButton = (props: LikeButtonProps) => (
77
<div class="style-scope">
88
<button
9-
id="alllike"
10-
data-type="like"
11-
data-filled="false"
12-
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
13-
aria-pressed="false"
149
aria-label="Like all"
10+
aria-pressed="false"
11+
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
12+
data-filled="false"
13+
data-type="like"
14+
id="alllike"
1515
onClick={(e) => props.onClick?.(e)}
1616
>
1717
<div
18+
aria-hidden="true"
1819
class="yt-spec-button-shape-next__icon"
1920
style={{
2021
'color': 'var(--ytmusic-setting-item-toggle-active)',
2122
}}
22-
aria-hidden="true"
2323
>
2424
<div
25+
aria-hidden="true"
2526
class="yt-spec-button-shape-next__icon"
2627
style={{
2728
'color': 'white',
@@ -32,54 +33,53 @@ export const LikeButton = (props: LikeButtonProps) => (
3233
'z-index': 1,
3334
'position': 'absolute',
3435
}}
35-
aria-hidden="true"
3636
>
3737
<div style={{ 'width': '24px', 'height': '24px' }}>
3838
<svg
39-
viewBox="0 0 24 24"
40-
preserveAspectRatio="xMidYMid meet"
4139
class="style-scope yt-icon"
40+
preserveAspectRatio="xMidYMid meet"
4241
style={{
4342
'pointer-events': 'none',
4443
'display': 'block',
4544
'width': '100%',
4645
'height': '100%',
4746
}}
47+
viewBox="0 0 24 24"
4848
>
4949
<g class="style-scope yt-icon">
5050
<path
51-
d="M3,11h3v10H3V11z M18.77,11h-4.23l1.52-4.94C16.38,5.03,15.54,4,14.38,4c-0.58,0-1.14,0.24-1.52,0.65L7,11v10h10.43 c1.06,0,1.98-0.67,2.19-1.61l1.34-6C21.23,12.15,20.18,11,18.77,11z"
5251
class="style-scope yt-icon"
52+
d="M3,11h3v10H3V11z M18.77,11h-4.23l1.52-4.94C16.38,5.03,15.54,4,14.38,4c-0.58,0-1.14,0.24-1.52,0.65L7,11v10h10.43 c1.06,0,1.98-0.67,2.19-1.61l1.34-6C21.23,12.15,20.18,11,18.77,11z"
5353
/>
5454
</g>
5555
</svg>
5656
</div>
5757
</div>
5858
<div style={{ 'width': '24px', 'height': '24px' }}>
5959
<svg
60-
viewBox="0 0 24 24"
61-
preserveAspectRatio="xMidYMid meet"
6260
class="style-scope yt-icon"
61+
preserveAspectRatio="xMidYMid meet"
6362
style={{
6463
'pointer-events': 'none',
6564
'display': 'block',
6665
'width': '100%',
6766
'height': '100%',
6867
}}
68+
viewBox="0 0 24 24"
6969
>
7070
<g class="style-scope yt-icon">
7171
<path
72-
d="M3,11h3v10H3V11z M18.77,11h-4.23l1.52-4.94C16.38,5.03,15.54,4,14.38,4c-0.58,0-1.14,0.24-1.52,0.65L7,11v10h10.43 c1.06,0,1.98-0.67,2.19-1.61l1.34-6C21.23,12.15,20.18,11,18.77,11z"
7372
class="style-scope yt-icon"
73+
d="M3,11h3v10H3V11z M18.77,11h-4.23l1.52-4.94C16.38,5.03,15.54,4,14.38,4c-0.58,0-1.14,0.24-1.52,0.65L7,11v10h10.43 c1.06,0,1.98-0.67,2.19-1.61l1.34-6C21.23,12.15,20.18,11,18.77,11z"
7474
/>
7575
</g>
7676
</svg>
7777
</div>
7878
</div>
7979
<yt-touch-feedback-shape style={{ 'border-radius': 'inherit' }}>
8080
<div
81-
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
8281
aria-hidden="true"
82+
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
8383
>
8484
<div class="yt-spec-touch-feedback-shape__stroke" />
8585
<div class="yt-spec-touch-feedback-shape__fill" />

src/plugins/album-actions/templates/undislike-button.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ export interface UnDislikeButtonProps {
66
export const UnDislikeButton = (props: UnDislikeButtonProps) => (
77
<div class="style-scope">
88
<button
9-
id="allundislike"
10-
data-type="dislike"
11-
data-filled="true"
12-
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
13-
aria-pressed="false"
149
aria-label="Undislike all"
10+
aria-pressed="false"
11+
class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button"
12+
data-filled="true"
13+
data-type="dislike"
14+
id="allundislike"
1515
onClick={(e) => props.onClick?.(e)}
1616
>
1717
<div
18+
aria-hidden="true"
1819
class="yt-spec-button-shape-next__icon"
1920
style={{
2021
color: 'var(--ytmusic-setting-item-toggle-active)',
2122
}}
22-
aria-hidden="true"
2323
>
2424
<div
25+
aria-hidden="true"
2526
class="yt-spec-button-shape-next__icon"
2627
style={{
2728
'color': 'white',
@@ -32,7 +33,6 @@ export const UnDislikeButton = (props: UnDislikeButtonProps) => (
3233
'z-index': 1,
3334
'position': 'absolute',
3435
}}
35-
aria-hidden="true"
3636
>
3737
<div
3838
style={{
@@ -41,20 +41,20 @@ export const UnDislikeButton = (props: UnDislikeButtonProps) => (
4141
}}
4242
>
4343
<svg
44-
viewBox="0 0 24 24"
45-
preserveAspectRatio="xMidYMid meet"
4644
class="style-scope yt-icon"
45+
preserveAspectRatio="xMidYMid meet"
4746
style={{
4847
'pointer-events': 'none',
4948
'display': 'block',
5049
'width': '100%',
5150
'height': '100%',
5251
}}
52+
viewBox="0 0 24 24"
5353
>
5454
<g class="style-scope yt-icon">
5555
<path
56-
d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
5756
class="style-scope yt-icon"
57+
d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
5858
/>
5959
</g>
6060
</svg>
@@ -67,20 +67,20 @@ export const UnDislikeButton = (props: UnDislikeButtonProps) => (
6767
}}
6868
>
6969
<svg
70-
viewBox="0 0 24 24"
71-
preserveAspectRatio="xMidYMid meet"
7270
class="style-scope yt-icon"
71+
preserveAspectRatio="xMidYMid meet"
7372
style={{
7473
'pointer-events': 'none',
7574
'display': 'block',
7675
'width': '100%',
7776
'height': '100%',
7877
}}
78+
viewBox="0 0 24 24"
7979
>
8080
<g class="style-scope yt-icon">
8181
<path
82-
d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
8382
class="style-scope yt-icon"
83+
d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
8484
/>
8585
</g>
8686
</svg>
@@ -92,8 +92,8 @@ export const UnDislikeButton = (props: UnDislikeButtonProps) => (
9292
}}
9393
>
9494
<div
95-
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
9695
aria-hidden="true"
96+
class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
9797
>
9898
<div class="yt-spec-touch-feedback-shape__stroke" />
9999
<div class="yt-spec-touch-feedback-shape__fill" />

0 commit comments

Comments
 (0)