From c992539b68966ed587dccc451d7c42d6a7a792b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Dostie?= <35579930+gdostie@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:43:28 -0500 Subject: [PATCH] ci(lint): fix CI workflow not linting files (#898) * ci: run lint during CI workflow * chore(format): run lint fix * build(lint): stop running eslint on pre-commit We lint on the CI anyway so no need to slowdown the commit process * refactor(npm): remove echo in lint script --- .github/workflows/ci.yml | 2 ++ package.json | 6 +--- src/resources/ApiKeys/ApiKeysInterfaces.ts | 35 +++++++++++----------- src/resources/Enums.ts | 9 +++--- src/resources/License/LicenseInterfaces.ts | 2 +- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48feae03e..4683ddc1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: - name: Check merge commit if: github.event_name == 'merge_group' uses: ./.github/actions/merge-commit + - name: Statical analysis + uses: ./.github/actions/lint - name: Tests run: npm test - name: Build diff --git a/package.json b/package.json index 0efcea135..84e61785f 100644 --- a/package.json +++ b/package.json @@ -56,11 +56,7 @@ "typescript-eslint": "8.4.0" }, "lint-staged": { - "**/*.{ts,js}": [ - "prettier --write", - "eslint . --fix" - ], - "**/*.{md,json,yml}": [ + "**/*.{ts,js,md,json,yml}": [ "prettier --write" ] }, diff --git a/src/resources/ApiKeys/ApiKeysInterfaces.ts b/src/resources/ApiKeys/ApiKeysInterfaces.ts index aba31bf64..a2d291c34 100644 --- a/src/resources/ApiKeys/ApiKeysInterfaces.ts +++ b/src/resources/ApiKeys/ApiKeysInterfaces.ts @@ -1,5 +1,6 @@ import {GranularResource, PrivilegeModel} from '../BaseInterfaces.js'; -import {ApiKeyStatus,ApiKeyExposureReportSeverity,ApiKeyReportCreationType} from '../Enums.js'; +import {ApiKeyExposureReportSeverity, ApiKeyReportCreationType, ApiKeyStatus} from '../Enums.js'; +import {UserModel} from '../Users/UserInterfaces.js'; export interface ApiKeyBaseModel extends GranularResource { /** @@ -191,29 +192,27 @@ interface ImpersonationRestrictionsModel { interface ExposureReport { /** - * API Key logger id associated to the Exposure Report + * API Key logger id associated to the Exposure Report */ - apiKeyLoggerId: string, + apiKeyLoggerId: string; /** - * The severity of the exposure + * The severity of the exposure */ - severity: ApiKeyExposureReportSeverity, + severity: ApiKeyExposureReportSeverity; /** - * The reason behind the exposure report for a given API key + * The reason behind the exposure report for a given API key */ - reason: string, + reason: string; /** * The date the key should be deactivated */ - deactivationDate: number, - /** - * The way the API key report has been created - */ - creationType: ApiKeyReportCreationType, - /** - * Represents the user that has created the report - */ - createdBy: any + deactivationDate: number; + /** + * The way the API key report has been created + */ + creationType: ApiKeyReportCreationType; + /** + * Represents the user that has created the report + */ + createdBy: UserModel; } - - diff --git a/src/resources/Enums.ts b/src/resources/Enums.ts index 724eaf0c1..afdbb0d2a 100644 --- a/src/resources/Enums.ts +++ b/src/resources/Enums.ts @@ -1176,19 +1176,18 @@ export enum ApiKeyStatus { EXPIRED = 'EXPIRED', SOON_TO_BE_EXPIRED = 'SOON_TO_BE_EXPIRED', SOON_TO_BE_DISABLED = 'SOON_TO_BE_DISABLED', - DISABLED_EXPOSED = 'DISABLED_EXPOSED' + DISABLED_EXPOSED = 'DISABLED_EXPOSED', } export enum ApiKeyReportCreationType { MANUAL = 'MANUAL', - AUTOMATED = 'AUTOMATED' + AUTOMATED = 'AUTOMATED', } - export enum ApiKeyExposureReportSeverity { CRITICAL = 'CRITICAL', HIGH = 'HIGH', MEDIUM = 'MEDIUM', LOW = 'LOW', - WARN = 'WARN' -} \ No newline at end of file + WARN = 'WARN', +} diff --git a/src/resources/License/LicenseInterfaces.ts b/src/resources/License/LicenseInterfaces.ts index c3b08307d..49e98e466 100644 --- a/src/resources/License/LicenseInterfaces.ts +++ b/src/resources/License/LicenseInterfaces.ts @@ -155,7 +155,7 @@ export interface EntitlementModel { /** * Use case of the entitlement */ - useCase: string; + useCase: string; /** * Limit of users for the entitlement */