Skip to content

Commit 08aaed9

Browse files
committed
Lint
1 parent ed8ea16 commit 08aaed9

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

special-pages/pages/duckplayer/app/components/MobileApp.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function MobileApp({ embed }) {
2323
const settings = useSettings();
2424
const telemetry = useTelemetry();
2525
const ytError = useYouTubeError();
26-
26+
2727
const features = createAppFeaturesFrom(settings);
2828
return (
2929
<>

special-pages/pages/duckplayer/app/components/Player.jsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const PLAYER_ERRORS = {
1212
botDetected: 'bot-detected',
1313
ageRestricted: 'age-restricted',
1414
noEmbed: 'no-embed',
15-
}
15+
};
1616

1717
export const PLAYER_ERROR_IDS = Object.values(PLAYER_ERRORS);
1818

@@ -57,7 +57,7 @@ export function Player({ src, layout }) {
5757
}
5858

5959
/**
60-
* @param {PlayerError} kind
60+
* @param {PlayerError} kind
6161
* @returns {{heading: Element, message: Element, solutions: Element[]}}
6262
*/
6363
function useErrorStrings(kind) {
@@ -70,15 +70,15 @@ function useErrorStrings(kind) {
7070
const solutionsMap = {
7171
['invalid-id']: [],
7272
['bot-detected']: [
73-
<span dangerouslySetInnerHTML={{ __html: t('botDetectedErrorTip1') }} />,
74-
<span dangerouslySetInnerHTML={{ __html: t('botDetectedErrorTip2') }} />,
75-
]
76-
}
73+
<span dangerouslySetInnerHTML={{ __html: t('botDetectedErrorTip1') }} />,
74+
<span dangerouslySetInnerHTML={{ __html: t('botDetectedErrorTip2') }} />,
75+
],
76+
};
7777
const messageMap = {
7878
['invalid-id']: '',
7979
['age-restricted']: <span dangerouslySetInnerHTML={{ __html: t('blockedVideoErrorMessage') }} />,
80-
}
81-
80+
};
81+
8282
const heading = headingsMap[kind] || headingsMap['invalid-id'];
8383
const solutions = solutionsMap[kind] || solutionsMap['invalid-id'];
8484
const message = messageMap[kind] || messageMap['invalid-id'];
@@ -98,8 +98,8 @@ export function PlayerError({ kind, layout }) {
9898
[styles.mobile]: layout === 'mobile',
9999
})}
100100
>
101-
{ kind === 'invalid-id' && <InvalidIdError kind={kind} />}
102-
{ kind !== 'invalid-id' && <YouTubeError kind={kind} /> }
101+
{kind === 'invalid-id' && <InvalidIdError kind={kind} />}
102+
{kind !== 'invalid-id' && <YouTubeError kind={kind} />}
103103
</div>
104104
);
105105
}
@@ -131,15 +131,18 @@ export function YouTubeError({ kind }) {
131131
<div className={classes}>
132132
<div className={styles.youtubeErrorContainer}>
133133
<span className={styles.youtubeErrorIcon}></span>
134-
134+
135135
<h1 className={styles.youtubeErrorHeading}>{heading}</h1>
136-
136+
137137
{message && <p className={styles.youtubeErrorMessage}>{message}</p>}
138138

139-
{solutions &&
139+
{solutions && (
140140
<ul className={styles.youtubeErrorList}>
141-
{solutions.map(item => <li>{item}</li>)}
142-
</ul>}
141+
{solutions.map((item) => (
142+
<li>{item}</li>
143+
))}
144+
</ul>
145+
)}
143146
</div>
144147
</div>
145148
);

special-pages/pages/duckplayer/app/features/error-detection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ const nodeContainsError = (node) => {
7070
const errorElement = element.querySelector('ytp-error');
7171

7272
if (errorElement) {
73-
return 'bot-detected'; // TODO: More generic naming
73+
return 'bot-detected'; // TODO: More generic naming
7474
}
7575
}
7676

7777
return null;
78-
}
78+
};
7979

8080
/**
8181
* Analyses attributes of a node to determine if it contains an error state
@@ -88,7 +88,7 @@ const nodeIsError = (node) => {
8888
if (node?.nodeType === Node.ELEMENT_NODE) {
8989
const element = /** @type {HTMLElement} */ (node);
9090
if (element.classList.contains('ytp-error')) {
91-
return 'bot-detected'; // TODO: More generic naming
91+
return 'bot-detected'; // TODO: More generic naming
9292
}
9393
// Add other error detection logic here
9494
}

special-pages/pages/duckplayer/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function init(messaging, telemetry, baseEnvironment) {
6565
let initialYouTubeError = null;
6666
const ytErrorParam = baseEnvironment.urlParams.get('youtubeError');
6767
if (ytErrorParam && PLAYER_ERROR_IDS.includes(ytErrorParam)) {
68-
initialYouTubeError = /** @type {import('./components/Player').PlayerError} */(ytErrorParam);
68+
initialYouTubeError = /** @type {import('./components/Player').PlayerError} */ (ytErrorParam);
6969
}
7070

7171
const embed = createEmbedSettings(window.location.href, settings);

special-pages/pages/duckplayer/app/providers/YouTubeErrorProvider.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function YouTubeErrorProvider({ initial = null, children }) {
2727
useEffect(() => {
2828
/** @type {(event: CustomEvent) => void} */
2929
const errorEventHandler = (event) => {
30-
const error = event.detail?.error
30+
const error = event.detail?.error;
3131
if (PLAYER_ERROR_IDS.includes(error) || error === null) {
3232
setError(error);
3333
}

special-pages/pages/duckplayer/integration-tests/duck-player.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ export class DuckPlayerPage {
335335
}
336336

337337
/**
338-
*
339-
* @param {string} text
338+
*
339+
* @param {string} text
340340
*/
341341
async hasShownErrorMessage(text = 'ERROR: Invalid video id') {
342342
await expect(this.page.getByText(text)).toBeVisible();

0 commit comments

Comments
 (0)