Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hampus-andersson-op committed Mar 13, 2024
1 parent 4ba106d commit 391bac6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/azuredevopsboard/PenetrationTestTicketService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WebApi } from 'azure-devops-node-api';
import { WorkItemQueryResult, WorkItemReference } from 'azure-devops-node-api/interfaces/WorkItemTrackingInterfaces';
import { WorkItem, WorkItemQueryResult, WorkItemReference } from 'azure-devops-node-api/interfaces/WorkItemTrackingInterfaces';
import { IWorkItemTrackingApi } from 'azure-devops-node-api/WorkItemTrackingApi';

export class PenetrationTestTicketService {
Expand Down Expand Up @@ -105,7 +105,7 @@ export class PenetrationTestTicketService {
let numberOfActiveTickets: number = 0;

for (const workItem of workItems) {
const workItemFetched = await witApi.getWorkItem(workItem.id!);
const workItemFetched: WorkItem = await witApi.getWorkItem(workItem.id!);

Check warning on line 108 in src/azuredevopsboard/PenetrationTestTicketService.ts

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
const state: string = await workItemFetched.fields!['System.State'];

Check warning on line 109 in src/azuredevopsboard/PenetrationTestTicketService.ts

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
if (state === 'Closed' || state === 'Done') {
numberOfClosedTickets++;
Expand Down
4 changes: 2 additions & 2 deletions src/azuredevopsboard/ThreatModelingTicketService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WebApi } from 'azure-devops-node-api';
import { WorkItemQueryResult, WorkItemReference } from 'azure-devops-node-api/interfaces/WorkItemTrackingInterfaces';
import { WorkItem, WorkItemQueryResult, WorkItemReference } from 'azure-devops-node-api/interfaces/WorkItemTrackingInterfaces';
import { IWorkItemTrackingApi } from 'azure-devops-node-api/WorkItemTrackingApi';

export class ThreatModelingTicketService {
Expand Down Expand Up @@ -105,7 +105,7 @@ export class ThreatModelingTicketService {
let numberOfActiveTickets: number = 0;

for (const workItem of workItems) {
const workItemFetched = await witApi.getWorkItem(workItem.id!);
const workItemFetched: WorkItem = await witApi.getWorkItem(workItem.id!);

Check warning on line 108 in src/azuredevopsboard/ThreatModelingTicketService.ts

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
const state: string = await workItemFetched.fields!['System.State'];

Check warning on line 109 in src/azuredevopsboard/ThreatModelingTicketService.ts

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
if (state === 'Closed' || state === 'Done') {
numberOfClosedTickets++;
Expand Down
5 changes: 3 additions & 2 deletions src/scatools/DependabotService.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { Octokit } from '@octokit/rest';
import { OctokitResponse } from '@octokit/types';

export class DependabotService {
public static async setDependabotFindings(): Promise<void> {
try {
const { owner, repo }: { owner: string; repo: string } = github.context.repo;
const token: string = core.getInput('PAT-token');

const octokit = new Octokit({
const octokit: Octokit = new Octokit({
auth: token,
});

// https://www.npmjs.com/package/octokit#pagination
const iterator = octokit.paginate.iterator(octokit.dependabot.listAlertsForRepo, {
const iterator: AsyncIterableIterator<OctokitResponse<any>> = octokit.paginate.iterator(octokit.dependabot.listAlertsForRepo, {

Check warning on line 17 in src/scatools/DependabotService.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
owner: owner,
repo: repo,
per_page: 100,
Expand Down
2 changes: 1 addition & 1 deletion src/scatools/ScaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DependabotService } from './DependabotService';
export class ScaService {
public static async getStateOfScaTool(scaTool: { nameOfTool: string }): Promise<void> {
console.log('\n Running SCA control');
let sca = scaTool.nameOfTool;
let sca: string = scaTool.nameOfTool;
if (process.env.scaTool) {
sca = process.env.scaTool;
}
Expand Down

0 comments on commit 391bac6

Please sign in to comment.