Skip to content

Commit fe47276

Browse files
authored
Merge pull request #1304 from Arnei/prefer-const
Activate eslint prefer-const
2 parents 92c4d34 + d47a813 commit fe47276

75 files changed

Lines changed: 317 additions & 314 deletions

File tree

Some content is hidden

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

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export default [
1616
"max-len": "off",
1717
"no-tabs": "off",
1818
"no-unused-expressions": "off",
19-
"prefer-const": "off",
19+
"object-curly-spacing": "off",
20+
"quotes": "off",
21+
"semi": "off",
2022
"spaced-comment": "off",
2123
"@typescript-eslint/await-thenable": "off",
2224
"@typescript-eslint/no-explicit-any": "off",

src/components/configuration/Themes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Themes = () => {
5151
loadThemes();
5252

5353
// Fetch themes every minute
54-
let fetchThemesInterval = setInterval(loadThemes, 5000);
54+
const fetchThemesInterval = setInterval(loadThemes, 5000);
5555

5656
return () => {
5757
allowLoadIntoTable = false;

src/components/events/Events.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const Events = () => {
6161
const events = useAppSelector(state => getTotalEvents(state));
6262
const isFetchingAssetUploadOptions = useAppSelector(state => getIsFetchingAssetUploadOptions(state));
6363

64-
let location = useLocation();
64+
const location = useLocation();
6565

6666
useEffect(() => {
6767
// State variable for interrupting the load function
@@ -92,7 +92,7 @@ const Events = () => {
9292
loadEvents();
9393

9494
// Fetch events every five seconds
95-
let fetchEventsInterval = setInterval(() => loadEvents(), 5000);
95+
const fetchEventsInterval = setInterval(() => loadEvents(), 5000);
9696

9797
return () => {
9898
allowLoadIntoTable = false;

src/components/events/Series.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const Series = () => {
3939
const newSeriesModalRef = useRef<ModalHandle>(null);
4040
const deleteModalRef = useRef<ModalHandle>(null);
4141

42-
let location = useLocation();
42+
const location = useLocation();
4343

4444
const series = useAppSelector(state => getTotalSeries(state));
4545
const showActions = useAppSelector(state => isShowActions(state));
@@ -72,7 +72,7 @@ const Series = () => {
7272
loadSeries();
7373

7474
// Fetch series every minute
75-
let fetchSeriesInterval = setInterval(() => loadSeries(), 5000);
75+
const fetchSeriesInterval = setInterval(() => loadSeries(), 5000);
7676

7777
return () => {
7878
allowLoadIntoTable = false;

src/components/events/partials/EventsDateCell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ const EventsDateCell = ({
2424

2525
// Filter with value of current cell
2626
const addFilter = async (date: string) => {
27-
let filter = filterMap.find(({ name }) => name === "startDate");
27+
const filter = filterMap.find(({ name }) => name === "startDate");
2828
if (filter) {
29-
let startDate = new Date(date);
29+
const startDate = new Date(date);
3030
startDate.setHours(0);
3131
startDate.setMinutes(0);
3232
startDate.setSeconds(0);
33-
let endDate = new Date(date);
33+
const endDate = new Date(date);
3434
endDate.setHours(23);
3535
endDate.setMinutes(59);
3636
endDate.setSeconds(59);

src/components/events/partials/EventsLocationCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const EventsLocationCell = ({
2121

2222
// Filter with value of current cell
2323
const addFilter = (location: string) => {
24-
let filter = filterMap.find(({ name }) => name === "location");
24+
const filter = filterMap.find(({ name }) => name === "location");
2525
if (filter) {
26-
dispatch(editFilterValue({ filterName: filter.name, value: location }));
26+
dispatch(editFilterValue({filterName: filter.name, value: location}));
2727
dispatch(fetchEvents());
2828
dispatch(loadEventsIntoTable());
2929
}

src/components/events/partials/EventsPresentersCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const EventsPresentersCell = ({
2121

2222
// Filter with value of current cell
2323
const addFilter = async (presenter: string) => {
24-
let filter = filterMap.find(
24+
const filter = filterMap.find(
2525
({ name }) => name === "presentersBibliographic",
2626
);
2727
if (filter) {

src/components/events/partials/EventsSeriesCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const EventsSeriesCell = ({
2121

2222
// Filter with value of current cell
2323
const addFilter = async (seriesId: string) => {
24-
let filter = filterMap.find(({ name }) => name === "series");
24+
const filter = filterMap.find(({ name }) => name === "series");
2525
if (filter) {
26-
await dispatch(editFilterValue({ filterName: filter.name, value: seriesId }));
26+
await dispatch(editFilterValue({filterName: filter.name, value: seriesId}));
2727
await dispatch(fetchEvents());
2828
dispatch(loadEventsIntoTable());
2929
}

src/components/events/partials/EventsTechnicalDateCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const EventsTechnicalDateCell = ({
2424

2525
// Filter with value of current cell
2626
const addFilter = async (date: string) => {
27-
let filter = filterMap.find(({ name }) => name === "technicalStart");
27+
const filter = filterMap.find(({ name }) => name === "technicalStart");
2828
if (filter) {
29-
await dispatch(editFilterValue({ filterName: filter.name, value: date + "/" + date }));
29+
await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date}));
3030
await dispatch(fetchEvents());
3131
dispatch(loadEventsIntoTable());
3232
}

src/components/events/partials/ModalTabsAndPages/DetailsMetadataTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const DetailsMetadataTab = ({
5656

5757
// set current values of metadata fields as initial values
5858
const getInitialValues = (metadataCatalog: MetadataCatalog) => {
59-
let initialValues: { [key: string]: any } = {};
59+
const initialValues: { [key: string]: any } = {};
6060

6161
// Transform metadata fields and their values provided by backend (saved in redux)
6262
metadataCatalog.fields.forEach(field => {

0 commit comments

Comments
 (0)