Skip to content

Commit 92c4d34

Browse files
authored
Merge pull request #1312 from JulianKniephoff/enable-lints
Enable lints
2 parents 119a9da + 6044949 commit 92c4d34

File tree

224 files changed

+2445
-2452
lines changed

Some content is hidden

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

224 files changed

+2445
-2452
lines changed

eslint.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,12 @@ export default [
1111
{
1212
rules: {
1313
// TODO: We want to turn these on eventually
14-
"arrow-parens": "off",
1514
"camelcase": "off",
16-
"comma-dangle": "off",
1715
"indent": "off",
18-
"keyword-spacing": "off",
1916
"max-len": "off",
20-
"no-extra-boolean-cast": "off",
2117
"no-tabs": "off",
2218
"no-unused-expressions": "off",
23-
"object-curly-spacing": "off",
2419
"prefer-const": "off",
25-
"quotes": "off",
26-
"semi": "off",
2720
"spaced-comment": "off",
2821
"@typescript-eslint/await-thenable": "off",
2922
"@typescript-eslint/no-explicit-any": "off",
@@ -39,7 +32,7 @@ export default [
3932
"@typescript-eslint/no-unsafe-return": "off",
4033
"@typescript-eslint/require-await": "off",
4134
"@typescript-eslint/unbound-method": "off",
42-
}
43-
}
35+
},
36+
},
4437
];
4538

src/components/About.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import NavBar from "./NavBar";
44
import Footer from "./Footer";
55
import { useTranslation } from "react-i18next";
66
import { useLocation } from "react-router";
7-
import axios from 'axios';
7+
import axios from "axios";
88
import i18n from "../i18n/i18n";
99
import DOMPurify from "dompurify";
1010

@@ -25,12 +25,12 @@ const About = () => {
2525
setAboutContent(response.data);
2626
})
2727
.catch(error => {
28-
axios.get(getURL(typeof i18n.options.fallbackLng === 'string' ? i18n.options.fallbackLng : 'en-US'))
28+
axios.get(getURL(typeof i18n.options.fallbackLng === "string" ? i18n.options.fallbackLng : "en-US"))
2929
.then(response => {
3030
setAboutContent(response.data);
3131
})
3232
.catch(error => {
33-
console.error('Error while fetching data:', error);
33+
console.error("Error while fetching data:", error);
3434
setAboutContent(t("ABOUT.NOCONTENT").toString());
3535
});
3636
});
@@ -47,12 +47,12 @@ const About = () => {
4747
{
4848
path: "/about/imprint",
4949
accessRole: "ROLE_UI_USERS_VIEW",
50-
text: "ABOUT.IMPRINT"
50+
text: "ABOUT.IMPRINT",
5151
},
5252
{
5353
path: "/about/privacy",
5454
accessRole: "ROLE_UI_GROUPS_VIEW",
55-
text: "ABOUT.PRIVACY"
55+
text: "ABOUT.PRIVACY",
5656
},
5757
]}
5858
>

src/components/Footer.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ const Footer: React.FC = () => {
1919
const user = useAppSelector(state => getUserInformation(state));
2020
const orgProperties = useAppSelector(state => getOrgProperties(state));
2121

22-
const version = (user?.ocVersion?.version ?? '')
23-
.replace(/0\.0\.SNAPSHOT/, 'x')
24-
.replace(/\.([0-9]+)\.0/, '.$1');
25-
const lastModified = user?.ocVersion?.['last-modified']
26-
? new Date(user.ocVersion['last-modified']).toISOString().substring(0, 10)
27-
: 'unknown';
28-
const aboutEnabled = (orgProperties['org.opencastproject.admin.display_about'] || 'false').toLowerCase() === 'true';
22+
const version = (user?.ocVersion?.version ?? "")
23+
.replace(/0\.0\.SNAPSHOT/, "x")
24+
.replace(/\.([0-9]+)\.0/, ".$1");
25+
const lastModified = user?.ocVersion?.["last-modified"]
26+
? new Date(user.ocVersion["last-modified"]).toISOString().substring(0, 10)
27+
: "unknown";
28+
const aboutEnabled = (orgProperties["org.opencastproject.admin.display_about"] || "false").toLowerCase() === "true";
2929

3030
return (
3131
<footer id="main-footer">
@@ -35,14 +35,14 @@ const Footer: React.FC = () => {
3535
{user.ocVersion && (
3636
<li>
3737
{"Opencast "}
38-
<Tooltip title={t('BUILD.VERSION')}><span>{version}</span></Tooltip>
38+
<Tooltip title={t("BUILD.VERSION")}><span>{version}</span></Tooltip>
3939
{user.isAdmin && (
4040
<span>
4141
{user.ocVersion.buildNumber && (
42-
<>{" – "} <Tooltip title={t('BUILD.COMMIT')}><span>{user.ocVersion.buildNumber}</span></Tooltip></>
42+
<>{" – "} <Tooltip title={t("BUILD.COMMIT")}><span>{user.ocVersion.buildNumber}</span></Tooltip></>
4343
)}
4444
{lastModified && (
45-
<>{" – "} <Tooltip title={t('BUILD.DATE_DESC')}><span>{t("BUILD.BUILT_ON")} {lastModified}</span></Tooltip></>
45+
<>{" – "} <Tooltip title={t("BUILD.DATE_DESC")}><span>{t("BUILD.BUILT_ON")} {lastModified}</span></Tooltip></>
4646
)}
4747
</span>
4848
)}

src/components/Header.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ const Header = () => {
6060
};
6161

6262
const showRegistrationModal = () => {
63-
registrationModalRef.current?.open()
63+
registrationModalRef.current?.open();
6464
};
6565

6666
const showHotKeyCheatSheet = () => {
67-
hotKeyCheatSheetModalRef.current?.open()
67+
hotKeyCheatSheetModalRef.current?.open();
6868
};
6969

7070
const toggleHotKeyCheatSheet = () => {
7171
if (hotKeyCheatSheetModalRef.current?.isOpen?.()) {
72-
hotKeyCheatSheetModalRef.current?.close?.()
72+
hotKeyCheatSheetModalRef.current?.close?.();
7373
} else {
74-
hotKeyCheatSheetModalRef.current?.open()
74+
hotKeyCheatSheetModalRef.current?.open();
7575
}
7676
};
7777

@@ -86,9 +86,9 @@ const Header = () => {
8686
availableHotkeys.general.HOTKEY_CHEATSHEET.sequence,
8787
() => toggleHotKeyCheatSheet(),
8888
{
89-
description: t(availableHotkeys.general.HOTKEY_CHEATSHEET.description) ?? undefined
89+
description: t(availableHotkeys.general.HOTKEY_CHEATSHEET.description) ?? undefined,
9090
},
91-
[toggleHotKeyCheatSheet]
91+
[toggleHotKeyCheatSheet],
9292
);
9393

9494
useEffect(() => {
@@ -115,7 +115,7 @@ const Header = () => {
115115
};
116116

117117
// Fetching health status information at mount
118-
loadHealthStatus().then((r) => console.info(r));
118+
loadHealthStatus().then(r => console.info(r));
119119
// Fetch health status every minute
120120
const interval = setInterval(() => dispatch(fetchHealthStatus()), 5000);
121121

@@ -145,7 +145,7 @@ const Header = () => {
145145
<div className="nav-dd lang-dd" id="lang-dd" ref={containerLang}>
146146
<Tooltip active={!displayMenuLang} title={t("LANGUAGE")}>
147147
<button className="lang" onClick={() => setMenuLang(!displayMenuLang)}>
148-
<IconContext.Provider value={{ style: {fontSize: "20px"} }}>
148+
<IconContext.Provider value={{ style: { fontSize: "20px" } }}>
149149
<HiTranslate />
150150
</IconContext.Provider>
151151
</button>
@@ -419,7 +419,7 @@ const MenuUser = () => {
419419
// Here we broadcast logout, in order to redirect other tabs to login page!
420420
broadcastLogout();
421421
window.location.href = "/j_spring_security_logout";
422-
}
422+
};
423423
return (
424424
<ul className="dropdown-ul">
425425
<li>

src/components/NavBar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ const NavBar = ({
5252
const newResourceModalRef = useRef<ModalHandle>(null);
5353

5454
const showNewResourceModal = async () => {
55-
create && create.onShowModal && await create.onShowModal()
56-
newResourceModalRef.current?.open()
55+
create && create.onShowModal && await create.onShowModal();
56+
newResourceModalRef.current?.open();
5757
};
5858

5959
const hideNewResourceModal = () => {
60-
create && create.onHideModal && create.onHideModal()
61-
newResourceModalRef.current?.close?.()
60+
create && create.onHideModal && create.onHideModal();
61+
newResourceModalRef.current?.close?.();
6262
};
6363

6464
const toggleNavigation = () => {
@@ -69,7 +69,7 @@ const NavBar = ({
6969
(create && create.hotkeySequence) ?? [],
7070
() => showNewResourceModal(),
7171
{ description: create && create.hotkeyDescription ? t(create.hotkeyDescription) : undefined },
72-
[showNewResourceModal]
72+
[showNewResourceModal],
7373
);
7474

7575
return (
@@ -96,7 +96,7 @@ const NavBar = ({
9696
>
9797
{t(link.text)}
9898
</Link>
99-
))
99+
));
100100
})}
101101
</nav>
102102

src/components/configuration/Themes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Themes = () => {
5656
return () => {
5757
allowLoadIntoTable = false;
5858
clearInterval(fetchThemesInterval);
59-
}
59+
};
6060
// eslint-disable-next-line react-hooks/exhaustive-deps
6161
}, []);
6262

@@ -70,7 +70,7 @@ const Themes = () => {
7070
{
7171
path: "/configuration/themes",
7272
accessRole: "ROLE_UI_THEMES_VIEW",
73-
text: "CONFIGURATION.NAVIGATION.THEMES"
73+
text: "CONFIGURATION.NAVIGATION.THEMES",
7474
},
7575
]}
7676
create={{

src/components/configuration/partials/ThemesDateTimeCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ThemeDetailsType } from "../../../slices/themeSlice";
77
* This component renders the creation date cells of themes in the table view
88
*/
99
const ThemesDateTimeCell = ({
10-
row
10+
row,
1111
}: {
1212
row: ThemeDetailsType
1313
}) => {

src/components/configuration/partials/wizard/BumperPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const BumperPage = <T extends RequiredFormProps>({
2222
nextPage,
2323
previousPage,
2424
isTrailer,
25-
isEdit
25+
isEdit,
2626
}: {
2727
formik: FormikProps<T>,
2828
nextPage?: (values: T) => void,
@@ -39,7 +39,7 @@ const BumperPage = <T extends RequiredFormProps>({
3939
{t(
4040
!isTrailer
4141
? "CONFIGURATION.THEMES.DETAILS.BUMPER.DESCRIPTION"
42-
: "CONFIGURATION.THEMES.DETAILS.TRAILER.DESCRIPTION"
42+
: "CONFIGURATION.THEMES.DETAILS.TRAILER.DESCRIPTION",
4343
)}
4444
</p>
4545
{/* notifications */}
@@ -49,7 +49,7 @@ const BumperPage = <T extends RequiredFormProps>({
4949
{t(
5050
!isTrailer
5151
? "CONFIGURATION.THEMES.DETAILS.BUMPER.ACTIVE"
52-
: "CONFIGURATION.THEMES.DETAILS.TRAILER.ACTIVE"
52+
: "CONFIGURATION.THEMES.DETAILS.TRAILER.ACTIVE",
5353
)}
5454
</header>
5555
<div className="obj-container content-list padded">
@@ -59,7 +59,7 @@ const BumperPage = <T extends RequiredFormProps>({
5959
{t(
6060
!isTrailer
6161
? "CONFIGURATION.THEMES.DETAILS.BUMPER.ENABLE"
62-
: "CONFIGURATION.THEMES.DETAILS.TRAILER.ENABLE"
62+
: "CONFIGURATION.THEMES.DETAILS.TRAILER.ENABLE",
6363
)}
6464
</label>
6565
</div>
@@ -85,7 +85,7 @@ const BumperPage = <T extends RequiredFormProps>({
8585
{t(
8686
!isTrailer
8787
? "CONFIGURATION.THEMES.DETAILS.BUMPER.SELECT"
88-
: "CONFIGURATION.THEMES.DETAILS.TRAILER.SELECT"
88+
: "CONFIGURATION.THEMES.DETAILS.TRAILER.SELECT",
8989
)}
9090
</header>
9191
<div className="obj-container padded">

src/components/configuration/partials/wizard/NewThemeWizard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { postNewTheme, ThemeDetailsInitialValues } from "../../../../slices/them
1616
* This component manages the pages of the new theme wizard and the submission of values
1717
*/
1818
const NewThemeWizard = ({
19-
close
19+
close,
2020
}: {
2121
close: () => void
2222
}) => {
@@ -80,10 +80,10 @@ const NewThemeWizard = ({
8080
<Formik
8181
initialValues={snapshot}
8282
validationSchema={currentValidationSchema}
83-
onSubmit={(values) => handleSubmit(values)}
83+
onSubmit={values => handleSubmit(values)}
8484
>
8585
{/* Render wizard pages depending on current value of page variable */}
86-
{(formik) => {
86+
{formik => {
8787
// eslint-disable-next-line react-hooks/rules-of-hooks
8888
useEffect(() => {
8989
formik.validateForm();

src/components/configuration/partials/wizard/ThemeDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const ThemeDetails = ({
9191

9292
// update theme
9393
const handleSubmit = (values: ThemeDetailsInitialValues) => {
94-
dispatch(updateThemeDetails({id: themeDetails.id, values: values}));
94+
dispatch(updateThemeDetails({ id: themeDetails.id, values: values }));
9595
close();
9696
};
9797

@@ -108,10 +108,10 @@ const ThemeDetails = ({
108108
<Formik
109109
initialValues={initialValues}
110110
validationSchema={currentValidationSchema}
111-
onSubmit={(values) => handleSubmit(values)}
111+
onSubmit={values => handleSubmit(values)}
112112
>
113113
{/* render modal pages depending on current value of page variable */}
114-
{(formik) => (
114+
{formik => (
115115
<div>
116116
{page === 0 && <GeneralPage formik={formik} isEdit />}
117117
{page === 1 && <BumperPage formik={formik} isEdit />}

0 commit comments

Comments
 (0)