Skip to content

Commit 45aa7a6

Browse files
committed
fix all errors and warnings from eslint
1 parent 10fdb85 commit 45aa7a6

12 files changed

+35
-29
lines changed

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616
"browser": true,
1717
"es2020": true
1818
},
19+
"ignorePatterns" :["coverage", "dist"],
1920
"rules": {
2021
"react/react-in-jsx-scope": "off",
2122
"react/prop-types": "off"
23+
},
24+
"settings": {
25+
"react": {
26+
"version": "detect"
27+
}
2228
}
2329
}

src/components/BrainScaleSConfig.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function BrainScaleSConfig(props) {
5959
variant="outlined"
6060
value={formatArray(props.config.HICANN)}
6161
onChange={(event) => handleChange("HICANN", event.target.value)}
62-
onBlur={(event) => removeEmptyItems("HICANN")}
62+
onBlur={() => removeEmptyItems("HICANN")}
6363
/>
6464
<TextField
6565
id="bss-config-fpga"

src/components/CodeWidget.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ function validURL(value) {
1515
return value.startsWith("http"); // todo: use a regex
1616
}
1717

18+
function getPathFromDriveURI(uri, collab) {
19+
if (uri.startsWith("drive:")) {
20+
const prefix = `drive://${collab}`;
21+
return uri.substring(prefix.length + 1);
22+
} else if (uri.length > 0) {
23+
console.warn("Expected 'drive:' URL, got " + uri);
24+
}
25+
return uri;
26+
}
27+
1828
function EditorSizeButtons({ currentHeight, setHeight }) {
1929
let buttons = [
2030
<Tooltip key="larger-editor-button" title="Increase editor size">
@@ -67,26 +77,16 @@ function CodeWidget(props) {
6777
props.onChange(`drive://${props.collab}/${value}`);
6878
};
6979

70-
const getPathFromDriveURI = (uri) => {
71-
if (uri.startsWith("drive:")) {
72-
const prefix = `drive://${props.collab}`;
73-
return uri.substring(prefix.length + 1);
74-
} else if (uri.length > 0) {
75-
console.warn("Expected 'drive:' URL, got " + uri);
76-
}
77-
return uri;
78-
};
79-
8080
useEffect(() => {
8181
if (props.initialTab === "editor") {
8282
setCodeFromEditor(props.code || "");
8383
} else if (props.initialTab === "from-url") {
8484
setCodeURL(props.code || "");
8585
} else if (props.initialTab === "drive") {
86-
setCodeFromDrive(getPathFromDriveURI(props.code) || "");
86+
setCodeFromDrive(getPathFromDriveURI(props.code, props.collab) || "");
8787
}
8888
setCurrentTab(props.initialTab);
89-
}, [props.initialTab, props.code]);
89+
}, [props.initialTab, props.code, props.collab]);
9090

9191
return (
9292
<Box

src/components/CreateJobForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function CreateJobForm(props) {
6565
setTags(tags.map((item) => item.trim()).filter((item) => item.length > 0));
6666
};
6767

68-
const handleSubmit = (event) => {
68+
const handleSubmit = () => {
6969
const newJob = {
7070
hardware_platform: hardware,
7171
code: code,

src/components/DriveBrowser.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function DriveBrowser(props) {
4949
setLoading(false);
5050
}
5151
fetchData();
52-
}, [props.collab, path]);
52+
}, [props.collab, path, auth]);
5353

5454
// todo: only show .py, .tar, .tar.gz, .tgz, .zip files
5555

src/components/Introduction.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Stack from "@mui/material/Stack";
44
import Box from "@mui/material/Box";
55
import Typography from "@mui/material/Typography";
66
import Container from "@mui/material/Container";
7-
import Link from "@mui/material/Link";
87

98
function Introduction() {
109
{
@@ -29,8 +28,9 @@ function Introduction() {
2928
</Typography>
3029
<Typography variant="h6" align="center" color="text.secondary" paragraph>
3130
If you or your colleagues have already run neuromorphic jobs in EBRAINS, you will see
32-
below a list of workspaces ("collabs") that contain neuromorphic results. If this is your
33-
first time using the EBRAINS neuromorphic systems, click on "Getting started".
31+
below a list of workspaces (&ldquo;collabs&rdquo;) that contain neuromorphic results. If
32+
this is your first time using the EBRAINS neuromorphic systems, click on &ldquo;Getting
33+
started&rdquo;.
3434
</Typography>
3535
<Stack sx={{ pt: 4 }} direction="row" spacing={2} justifyContent="center">
3636
<Button

src/components/JobDetail.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function JobDetail(props) {
4343
}, 5000);
4444
return () => clearInterval(intervalID);
4545
}
46-
}, [props]);
46+
}, [props, job, revalidator]);
4747

4848
const handleDeleteTag = async (tag) => {
4949
console.log(tag);

src/components/Preview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function Preview(props) {
7777
if (props.url && props.open) {
7878
fetchData(props.url, props.content_type, props.size);
7979
}
80-
}, [props.url]);
80+
}, [props.url, props.content_type, props.open, props.size]);
8181

8282
const handleClose = () => {
8383
props.onClose();

src/components/ProjectList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ProjectList(props) {
2222
if (fetcher.data && selectedProject) {
2323
fetcher.load();
2424
}
25-
}, [fetcher.data]);
25+
}, [fetcher.data, fetcher, selectedProject]);
2626

2727
const handleCloseEditDialog = (projectUpdate) => {
2828
if (projectUpdate) {

src/components/SpiNNakerConfig.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function SpiNNakerConfig(props) {
6464
variant="outlined"
6565
value={formatArray(props.config.extra_pip_installs)}
6666
onChange={(event) => handleChange("extra_pip_installs", event.target.value)}
67-
onBlur={(event) => removeEmptyItems("extra_pip_installs")}
67+
onBlur={() => removeEmptyItems("extra_pip_installs")}
6868
/>
6969
<TextField
7070
id="spinn-config-extra_git_repositories"
@@ -74,7 +74,7 @@ function SpiNNakerConfig(props) {
7474
variant="outlined"
7575
value={formatArray(props.config.extra_git_repositories)}
7676
onChange={(event) => handleChange("extra_git_repositories", event.target.value)}
77-
onBlur={(event) => removeEmptyItems("extra_git_repositories")}
77+
onBlur={() => removeEmptyItems("extra_git_repositories")}
7878
/>
7979
<TextField
8080
id="spinn-config-extra_makes"
@@ -84,7 +84,7 @@ function SpiNNakerConfig(props) {
8484
variant="outlined"
8585
value={formatArray(props.config.extra_makes)}
8686
onChange={(event) => handleChange("extra_makes", event.target.value)}
87-
onBlur={(event) => removeEmptyItems("extra_makes")}
87+
onBlur={() => removeEmptyItems("extra_makes")}
8888
/>
8989
<TextField
9090
id="spinn-config-extra-python-setups"
@@ -94,7 +94,7 @@ function SpiNNakerConfig(props) {
9494
variant="outlined"
9595
value={formatArray(props.config.extra_python_setups)}
9696
onChange={(event) => handleChange("extra_python_setups", event.target.value)}
97-
onBlur={(event) => removeEmptyItems("extra_python_setups")}
97+
onBlur={() => removeEmptyItems("extra_python_setups")}
9898
/>
9999
<TextField
100100
id="spinn-config-pyNN_version"

src/routes/home.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function getLoader(auth) {
2525
return loader;
2626
}
2727

28-
function Home(props) {
28+
function Home() {
2929
const data = useLoaderData();
3030
const navigate = useNavigate();
3131
const requestedCollabId = useContext(RequestedCollabContext);
@@ -34,7 +34,7 @@ function Home(props) {
3434
if (requestedCollabId) {
3535
navigate(`/${requestedCollabId}/jobs/`);
3636
}
37-
}, [requestedCollabId]);
37+
}, [requestedCollabId, navigate]);
3838

3939
return (
4040
<div>

src/routes/job-creation.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function submitJob(auth) {
1313
const { collabId } = params;
1414
const jobData = await request.json();
1515
if (request.method === "POST") {
16-
const response = await createJob(collabId, jobData, auth);
16+
await createJob(collabId, jobData, auth);
1717
return redirect(`/${collabId}/jobs/`);
1818
} else {
1919
throw new Error("unexpected request method");
@@ -22,7 +22,7 @@ function submitJob(auth) {
2222
return wrappedSubmitJob;
2323
}
2424

25-
function JobCreationRoute(props) {
25+
function JobCreationRoute() {
2626
let { collabId } = useParams();
2727

2828
return (

0 commit comments

Comments
 (0)