diff --git a/.eslintrc.js b/.eslintrc.js index fefad92ce29d..76db6b6560e9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -134,6 +134,10 @@ module.exports = { { selector: ['variable', 'property'], format: ['camelCase', 'UPPER_CASE', 'PascalCase'], + filter: { + regex: '^private_[a-z][a-zA-Z0-9]+$', + match: false, + }, }, { selector: 'function', diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts index 5824a79532bd..fc95f08148db 100644 --- a/src/libs/DebugUtils.ts +++ b/src/libs/DebugUtils.ts @@ -617,7 +617,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) { fieldList: CONST.RED_BRICK_ROAD_PENDING_ACTION, permissions: CONST.RED_BRICK_ROAD_PENDING_ACTION, tripData: CONST.RED_BRICK_ROAD_PENDING_ACTION, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: CONST.RED_BRICK_ROAD_PENDING_ACTION, addWorkspaceRoom: CONST.RED_BRICK_ROAD_PENDING_ACTION, avatar: CONST.RED_BRICK_ROAD_PENDING_ACTION, diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 1ceeb705c7c2..aab4ea93b869 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -341,7 +341,6 @@ function getOptionData({ hasParentAccess: undefined, isIOUReportOwner: null, isChatRoom: false, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: undefined, shouldShowSubscript: false, isPolicyExpenseChat: false, @@ -364,7 +363,6 @@ function getOptionData({ result.isTaskReport = ReportUtils.isTaskReport(report); result.isInvoiceReport = ReportUtils.isInvoiceReport(report); result.parentReportAction = parentReportAction; - // eslint-disable-next-line @typescript-eslint/naming-convention result.private_isArchived = report?.private_isArchived; result.isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report); result.isExpenseRequest = ReportUtils.isExpenseRequest(report); diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index eb302fd7fda5..c926b5552d11 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -347,7 +347,6 @@ function deleteWorkspace(policyID: string, policyName: string) { oldPolicyName: allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]?.name, policyName: '', }), - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: currentTime, }, }); @@ -413,7 +412,6 @@ function deleteWorkspace(policyID: string, policyName: string) { statusNum, oldPolicyName, policyName: report?.policyName, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: null, }, }); diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 83f633115c8f..a1a2c3f3f6ac 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -252,7 +252,6 @@ function ReportScreen({route, navigation}: ReportScreenProps) { visibility: reportOnyx.visibility, oldPolicyName: reportOnyx.oldPolicyName, policyName: reportOnyx.policyName, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: reportOnyx.private_isArchived, lastMentionedTime: reportOnyx.lastMentionedTime, avatarUrl: reportOnyx.avatarUrl, diff --git a/src/types/form/DebugReportForm.ts b/src/types/form/DebugReportForm.ts index 203a75f39722..3d4ffec4bfa6 100644 --- a/src/types/form/DebugReportForm.ts +++ b/src/types/form/DebugReportForm.ts @@ -33,7 +33,6 @@ const INPUT_IDS = { POLICY_ID: 'policyID', POLICY_NAME: 'policyName', PRIVATE_NOTES: 'privateNotes', - // eslint-disable-next-line @typescript-eslint/naming-convention PRIVATE_IS_ARCHIVED: 'private_isArchived', REPORT_ID: 'reportID', REPORT_NAME: 'reportName', diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index 1ce9a76306e9..f13090dffd6b 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -224,7 +224,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback< }; /** Whether the report is archived */ - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived?: string; /** The report's welcome message */ diff --git a/src/types/onyx/ReportNameValuePairs.ts b/src/types/onyx/ReportNameValuePairs.ts index 8b5a50d8d5c8..9d2720c3b5f2 100644 --- a/src/types/onyx/ReportNameValuePairs.ts +++ b/src/types/onyx/ReportNameValuePairs.ts @@ -3,7 +3,6 @@ import type * as OnyxCommon from './OnyxCommon'; /** Model of additional report details */ type ReportNameValuePairs = OnyxCommon.OnyxValueWithOfflineFeedback<{ /** Whether the report is an archived room */ - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: boolean; }>; diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index f254f06b0aac..c2d66aa81f8f 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -151,7 +151,6 @@ type SearchReport = { unheldTotal?: number; /** Whether the report is archived */ - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived?: string; /** Whether the action is loading */ diff --git a/src/types/utils/whitelistedReportKeys.ts b/src/types/utils/whitelistedReportKeys.ts index 8fa8aab7adc1..0c5a9ad2a95d 100644 --- a/src/types/utils/whitelistedReportKeys.ts +++ b/src/types/utils/whitelistedReportKeys.ts @@ -61,7 +61,6 @@ type WhitelistedReport = OnyxCommon.OnyxValueWithOfflineFeedback< endDate: unknown; tripID: unknown; }; - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: unknown; welcomeMessage: unknown; }, diff --git a/tests/data/Invoice.ts b/tests/data/Invoice.ts index c94c7ce816be..b2f12846d79c 100644 --- a/tests/data/Invoice.ts +++ b/tests/data/Invoice.ts @@ -265,7 +265,6 @@ const convertedInvoiceChat: OnyxTypes.Report = { policyAvatar: '', policyID: 'CC048FA711B35B1F', policyName: "53019's Workspace", - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: '', reportID: '7605647250932303', reportName: 'Chat Report', diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index a393ce691277..e183e958ea04 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -258,12 +258,10 @@ describe('SidebarLinksData', () => { LHNTestUtils.getDefaultRenderedSidebarLinks(); const archivedReport: Report = { ...createReport(false), - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; const reportNameValuePairs = { type: 'chat', - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: true, }; diff --git a/tests/unit/DebugUtilsTest.ts b/tests/unit/DebugUtilsTest.ts index ac15d041bc2f..3eefc46492ae 100644 --- a/tests/unit/DebugUtilsTest.ts +++ b/tests/unit/DebugUtilsTest.ts @@ -787,7 +787,6 @@ describe('DebugUtils', () => { await Onyx.set(ONYXKEYS.NVP_PRIORITY_MODE, CONST.PRIORITY_MODE.DEFAULT); const reason = DebugUtils.getReasonForShowingRowInLHN({ ...baseReport, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: 'true', }); expect(reason).toBe('debug.reasonVisibleInLHN.isArchived'); @@ -1061,7 +1060,6 @@ describe('DebugUtils', () => { await Onyx.multiSet({ ...MOCK_REPORTS, [`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}2` as const]: { - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: false, }, [`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1` as const]: MOCK_REPORT_ACTIONS, diff --git a/tests/unit/OptionsListUtilsTest.ts b/tests/unit/OptionsListUtilsTest.ts index e4d39033ced3..2007fbaec991 100644 --- a/tests/unit/OptionsListUtilsTest.ts +++ b/tests/unit/OptionsListUtilsTest.ts @@ -152,7 +152,6 @@ describe('OptionsListUtils', () => { // This indicates that the report is archived stateNum: 2, statusNum: 2, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }, }; diff --git a/tests/unit/ReportUtilsTest.ts b/tests/unit/ReportUtilsTest.ts index 39912cf240a5..2a7bbd761302 100644 --- a/tests/unit/ReportUtilsTest.ts +++ b/tests/unit/ReportUtilsTest.ts @@ -341,7 +341,6 @@ describe('ReportUtils', () => { ...baseAdminsRoom, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; @@ -367,7 +366,6 @@ describe('ReportUtils', () => { ...baseUserCreatedRoom, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; @@ -413,7 +411,6 @@ describe('ReportUtils', () => { oldPolicyName: policy.name, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 55fd72173c65..d13d4415c2ce 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -832,7 +832,6 @@ describe('Sidebar', () => { chatType: CONST.REPORT.CHAT_TYPE.POLICY_ROOM, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; const report2 = LHNTestUtils.getFakeReport([1, 3]); @@ -984,7 +983,6 @@ describe('Sidebar', () => { statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, lastMessageText: 'test', - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), }; const report2 = { diff --git a/tests/unit/SidebarTest.ts b/tests/unit/SidebarTest.ts index a3ca6f4734e6..28d100062be3 100644 --- a/tests/unit/SidebarTest.ts +++ b/tests/unit/SidebarTest.ts @@ -47,7 +47,6 @@ describe('Sidebar', () => { chatType: CONST.REPORT.CHAT_TYPE.POLICY_ROOM, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), lastMessageText: 'test', }; @@ -102,7 +101,6 @@ describe('Sidebar', () => { chatType: CONST.REPORT.CHAT_TYPE.POLICY_ROOM, statusNum: CONST.REPORT.STATUS_NUM.CLOSED, stateNum: CONST.REPORT.STATE_NUM.APPROVED, - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: DateUtils.getDBTime(), lastMessageText: 'test', }; diff --git a/tests/utils/collections/optionData.ts b/tests/utils/collections/optionData.ts index adbb204cfc2d..28fa6ca87368 100644 --- a/tests/utils/collections/optionData.ts +++ b/tests/utils/collections/optionData.ts @@ -19,7 +19,6 @@ export default function createRandomOptionData(index: number): OptionData { policyName: randWord(), policyID: `policy_${index}`, accountID: randNumber(), - // eslint-disable-next-line @typescript-eslint/naming-convention private_isArchived: new Date().toISOString(), isPolicyExpenseChat: randBoolean(), chatType: rand(Object.values(CONST.REPORT.CHAT_TYPE)),