1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

fix(enums-eslint): Enum Rule for ESLint (#14650)

* fix(enums-eslint): Enum Rule for ESLint - Added enums in the warnings for eslint.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error in both places for enums.

* fix(enums-eslint): Enum Rule for ESLint - Added new eslint plugin for warning on enums.

* fix(enums-eslint): Enum Rule for ESLint - Changed based on suggestion.

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>

* refactor(browser-platform-utils): Remove Deprecation and Fix Code - Changed usages of firefox to private and moved the usages to the preferred public method and removed the deprecations.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error and added disable rules for all other places.

* fix(enums-eslint): Enum Rule for ESLint - Undid other changes by accident
This commit is contained in:
Patrick-Pimentel-Bitwarden
2025-05-13 10:07:38 -04:00
committed by GitHub
parent 9f3310ed7e
commit 0b0397c3f0
156 changed files with 445 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ import { Jsonify } from "type-fest";
import { KeyDefinitionLike, MigrationHelper } from "../migration-helper";
import { Migrator } from "../migrator";
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum ProviderUserStatusType {
Invited = 0,
Accepted = 1,
@@ -12,6 +14,8 @@ enum ProviderUserStatusType {
Revoked = -1,
}
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum ProviderUserType {
ProviderAdmin = 0,
ServiceUser = 1,

View File

@@ -3,6 +3,8 @@
import { KeyDefinitionLike, MigrationHelper } from "../migration-helper";
import { Migrator } from "../migrator";
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum PolicyType {
TwoFactorAuthentication = 0, // Requires users to have 2fa enabled
MasterPassword = 1, // Sets minimum requirements for master password complexity

View File

@@ -7,6 +7,8 @@ import { Migrator } from "../migrator";
// Local declarations of `OrganizationData` and the types of it's properties.
// Duplicated to remain frozen in time when migration occurs.
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum OrganizationUserStatusType {
Invited = 0,
Accepted = 1,
@@ -14,6 +16,8 @@ enum OrganizationUserStatusType {
Revoked = -1,
}
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum OrganizationUserType {
Owner = 0,
Admin = 1,
@@ -40,11 +44,15 @@ type PermissionsApi = {
manageScim: boolean;
};
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum ProviderType {
Msp = 0,
Reseller = 1,
}
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum ProductType {
Free = 0,
Families = 1,

View File

@@ -3,6 +3,8 @@
import { KeyDefinitionLike, MigrationHelper } from "../migration-helper";
import { Migrator } from "../migrator";
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
export enum SendType {
Text = 0,
File = 1,

View File

@@ -3,6 +3,8 @@
import { KeyDefinitionLike, MigrationHelper } from "../migration-helper";
import { Migrator } from "../migrator";
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
enum KdfType {
PBKDF2_SHA256 = 0,
Argon2id = 1,

View File

@@ -57,6 +57,8 @@ const vaultTimeoutTypeRollbackRecord: Record<VaultTimeout, any> = {
onIdle: -4,
};
// FIXME: update to use a const object instead of a typescript enum
// eslint-disable-next-line @bitwarden/platform/no-enums
export enum ClientType {
Web = "web",
Browser = "browser",