cleaning Lint Warnings
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/components/shared/sharedFilter/SharedHistory.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/components/shared/sharedFilter/SharedHistory.ts(29,24):
29:24 trailing whitespace
27 | this.isLoading = false;
28 | if (!data.data) {
> 29 | return;
| ^
30 | }
31 | this.handleResponse(data);
32 | }).catch((reason) => {
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(42,7): 42:7 trailing whitespace
40 | /**
41 | * Persists a FilterHistoryItem in the DB
> 42 | *
| ^
43 | * @param label name of item (string)
44 | * @param type one of the following entities: `observation`, `inspection`, `transect`, `section`,
45 | * `sectionevent`, `materialitem`, `newsitem` (case insensitive)
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(55,26): 55:26 trailing whitespace
53 | type: "${type}",
54 | isFavorite: ${isFavorite},
> 55 | filter: {
| ^
56 | id_is: "${filterId}"
57 | },
58 | })
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(62,25): 62:25 trailing whitespace
60 | filterHistory {
61 | label
> 62 | type
| ^
63 | filter
64 | isFavorite
65 | }
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(63,27): 63:27 trailing whitespace
61 | label
62 | type
> 63 | filter
| ^
64 | isFavorite
65 | }
66 | }
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(73,7): 73:7 trailing whitespace
71 | /**
72 | * Updates a FilterHistoryItem in the DB
> 73 | *
| ^
74 | * @param isFavorite true or false
75 | * @param filterId id of the updated filter
76 | */
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/helper/filter.service.ts(86,27): 86:27 trailing whitespace
84 | filterHistory {
85 | label
> 86 | filter
| ^
87 | isFavorite
88 | }
89 | }
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/types/filter.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/types/filter.ts(26,3): 26:3 statements are not aligned
24 | }
25 |
> 26 | export enum InspectionTableHeaders {
| ^
27 | transectId = "transectId",
28 | date = "date",
29 | time = "time",
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/types/index.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/types/index.ts(171,2): 171:2 file should end with a newline
169 | isFavorite: boolean;
170 | id: string;
> 171 | }
| ^
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(308,9): 308:9 Expected a 'for-of' loop instead of a 'for' loop with this simple iteration
306 | const sectionEvents = data.data.inspection.sectionEvents.collection;
307 | const speciesList = store.getters.getSpeciesList;
> 308 | for (let i = 0; i < sections.length; i++) {
| ^
309 | const sectionNode = sections[i];
310 | for (let j = 0; j < sectionEvents.length; j++) {
311 | const sectionEvent = sectionEvents[j];
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(310,13): 310:13 Expected a 'for-of' loop instead of a 'for' loop with this simple iteration
308 | for (let i = 0; i < sections.length; i++) {
309 | const sectionNode = sections[i];
> 310 | for (let j = 0; j < sectionEvents.length; j++) {
| ^
311 | const sectionEvent = sectionEvents[j];
312 | if (sectionNode.id === sectionEvent.section.id) {
313 | const sectionImageRefs =
this.setSectionsImagesRefs(sectionEvent.imageRefs.collection);
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(372,25): 372:25 Array type using 'Array' is forbidden for simple types. Use 'T[]' instead.
370 |
371 | private setSectionsImagesRefs(imageRefs: any) {
> 372 | const imageUrl: Array<string> = [];
| ^
373 | if (!imageRefs.length) {
374 | return imageUrl;
375 | }
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(399,32): 399:32 Array type using 'Array' is forbidden for simple types. Use 'T[]' instead.
397 | this.setMaxRowId(data);
398 | const sortedData = data.sort((a, b) => (a.rowId > b.rowId) ? 1 : ((b.rowId > a.rowId) ? -1 : 0));
> 399 | const observationRows: Array<ObservationTableRow> = [];
| ^
400 | [...Array(Math.ceil(sortedData.length / 7)).keys()].forEach((i) => {
401 | const row = sortedData.slice(i * 7, ( i + 1) * 7);
402 | const speciesItem = this.checkAndGetSpeciesItem(row[i], speciesList);
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(403,13): 403:13 Multiple variable declarations in the same statement are forbidden
401 | const row = sortedData.slice(i * 7, ( i + 1) * 7);
402 | const speciesItem = this.checkAndGetSpeciesItem(row[i], speciesList);
> 403 | let art, imago, male, female, cocoon, caterpillar, egg;
| ^
404 | let artImage, imagoImage, maleImage, femaleImage, cocoonImage, caterpillarImage, eggImage;
405 | for (let j = 0; j < row.length; j++) {
406 | const sex = row[j].sex;
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(404,13): 404:13 Multiple variable declarations in the same statement are forbidden
402 | const speciesItem = this.checkAndGetSpeciesItem(row[i], speciesList);
403 | let art, imago, male, female, cocoon, caterpillar, egg;
> 404 | let artImage, imagoImage, maleImage, femaleImage, cocoonImage, caterpillarImage, eggImage;
| ^
405 | for (let j = 0; j < row.length; j++) {
406 | const sex = row[j].sex;
407 | const stageID = row[j].developmentalStage.id.replace(/^\D+/g, "");
-
Warning in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts WARNING in /Users/nyiry/Documents/DEV/BioMe/frontend/app/src/views/TransectInspection.ts(405,13): 405:13 Expected a 'for-of' loop instead of a 'for' loop with this simple iteration
403 | let art, imago, male, female, cocoon, caterpillar, egg;
404 | let artImage, imagoImage, maleImage, femaleImage, cocoonImage, caterpillarImage, eggImage;
> 405 | for (let j = 0; j < row.length; j++) {
| ^
406 | const sex = row[j].sex;
407 | const stageID = row[j].developmentalStage.id.replace(/^\D+/g, "");
408 | if (stageID === "1" && sex === null) {