Skip to content

Commit

Permalink
frontend: fix linter and sca warnings
Browse files Browse the repository at this point in the history
Fix the following npm lint warnings:

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-job/data-job-page.component.ts
   27:30  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times                            import/no-duplicates
   45:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times                            import/no-duplicates
  708:33  warning  Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead  @typescript-eslint/unbound-method

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-job/pages/details/data-job-details-page.component.spec.ts
  14:42  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates
  27:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-job/pages/details/data-job-details-page.component.ts
   16:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times                            import/no-duplicates
   35:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times                            import/no-duplicates
  335:21  warning  Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead  @typescript-eslint/unbound-method

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-job/pages/executions/data-job-execution-status/data-job-execution-status.component.html
  16:26  warning  Avoid calling expressions in templates  @angular-eslint/template/no-call-expression
  17:26  warning  Avoid calling expressions in templates  @angular-eslint/template/no-call-expression

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-job/pages/executions/data-job-executions-page/data-job-executions-page.component.ts
    6:21  warning  'OnInit' is defined but never used                                                                                                                                                                              @typescript-eslint/no-unused-vars
  184:21  warning  Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead  @typescript-eslint/unbound-method
  213:14  warning  Lifecycle interface 'OnInit' should be implemented for method 'ngOnInit'. (https://angular.io/styleguide#style-09-01)                                                                                           @angular-eslint/use-lifecycle-interface
  251:25  warning  Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead  @typescript-eslint/unbound-method

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/data-jobs-manage/components/grid/data-jobs-manage-grid.component.ts
  11:30  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates
  19:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/components/widgets/widget-execution-status-gauge/widget-execution-status-gauge.component.html
  27:32  warning  Avoid calling expressions in templates  @angular-eslint/template/no-call-expression

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/data-pipelines.module.ts
   26:37  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates
   31:8   warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates
  184:45  warning  Unexpected any. Specify a different type                                                                                                                                              @typescript-eslint/no-explicit-any

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/model/toast-definitions.model.ts
  6:30  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates
  8:23  warning  '/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/node_modules/@versatiledatakit/shared/fesm2015/versatiledatakit-shared.mjs' imported multiple times  import/no-duplicates

/Users/mdilyan/Projects/versatile-data-kit/projects/frontend/data-pipelines/gui/projects/data-pipelines/src/lib/shared/utils/data-job.util.ts
  47:37  warning  Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead  @typescript-eslint/unbound-method

Signed-off-by: Dilyan Marinov <[email protected]>
  • Loading branch information
Dilyan Marinov committed Apr 3, 2023
1 parent d882b46 commit 7d191a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export class DataJobExecutionsPageComponent
OnTaurusModelInit,
OnTaurusModelLoad,
OnTaurusModelChange,
OnTaurusModelError
OnTaurusModelError,
OnInit
{
readonly uuid = 'DataJobExecutionsPageComponent';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export class DataJobExecutionToGridDataJobExecution {
}
}

static convertToDataJobExecution(
static convertToDataJobExecution = (
dataJobExecution: DataJobExecutions,
): GridDataJobExecution[] {
): GridDataJobExecution[] => {
const formatDeltaPipe = new FormatDeltaPipe();

return dataJobExecution.reduce((accumulator, execution) => {
Expand All @@ -65,7 +65,7 @@ export class DataJobExecutionToGridDataJobExecution {

return accumulator;
}, [] as GridDataJobExecution[]);
}
};

static getStatusColorsMap() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export class DataJobUtil {
/**
* ** Predicate for Job Running.
*/
static isJobRunningPredicate(
static isJobRunningPredicate = (
jobExecution: DataJobExecution | DataJobExecutionDetails,
): boolean {
): boolean => {
return (
(jobExecution as DataJobExecution).status ===
DataJobExecutionStatus.RUNNING ||
Expand All @@ -34,7 +34,7 @@ export class DataJobUtil {
(jobExecution as DataJobExecutionDetails).status ===
DataJobExecutionStatusDeprecated.SUBMITTED
);
}
};

/**
* ** Find if some Job is running in provided Executions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ErrorEscalation: PlaceholderAutoSupportedStates = {

const ErrorImgSource: PlaceholderAutoSupportedStates = {
Generic: 'assets/images/placeholder/server-error.svg',
Offline: null,
Offline: '',
NotFound: 'assets/images/placeholder/not-found.svg'
};

Expand Down

0 comments on commit 7d191a7

Please sign in to comment.