Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Update private_ prefix lint rule for variable naming #56666

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@ module.exports = {
{
selector: ['variable', 'property'],
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
// This filter excludes variables and properties that start with "private_" to make them valid.
//
// Examples:
// - "private_a" → valid
// - "private_test" → valid
// - "private_" → not valid
filter: {
regex: '^private_[a-z][a-zA-Z0-9]+$',
regex: '^private_[a-z][a-zA-Z0-9]*$',
match: false,
},
},
Expand Down
1 change: 0 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,6 @@ function createOption(
if (report) {
result.isChatRoom = reportUtilsIsChatRoom(report);
result.isDefaultRoom = isDefaultRoom(report);
// eslint-disable-next-line @typescript-eslint/naming-convention
result.private_isArchived = getReportNameValuePairs(report.reportID)?.private_isArchived;
result.isExpenseReport = isExpenseReport(report);
result.isInvoiceRoom = isInvoiceRoom(report);
Expand Down
1 change: 0 additions & 1 deletion src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ function deleteWorkspace(policyID: string, policyName: string) {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`,
value: {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: null,
},
});
Expand Down
2 changes: 0 additions & 2 deletions src/libs/migrations/NVPMigration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const migrations = {
preferredLocale: ONYXKEYS.NVP_PREFERRED_LOCALE,
preferredEmojiSkinTone: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
frequentlyUsedEmojis: ONYXKEYS.FREQUENTLY_USED_EMOJIS,
// eslint-disable-next-line @typescript-eslint/naming-convention
private_blockedFromConcierge: ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE,
// eslint-disable-next-line @typescript-eslint/naming-convention
private_pushNotificationID: ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID,
tryFocusMode: ONYXKEYS.NVP_TRY_FOCUS_MODE,
introSelected: ONYXKEYS.NVP_INTRO_SELECTED,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/DebugUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ describe('DebugUtils', () => {
});
it('returns correct reason when report is archived', async () => {
const reportNameValuePairs = {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
};
await Onyx.set(ONYXKEYS.NVP_PRIORITY_MODE, CONST.PRIORITY_MODE.DEFAULT);
Expand Down
1 change: 0 additions & 1 deletion tests/unit/OptionsListUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ describe('OptionsListUtils', () => {
};

const reportNameValuePairs = {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
};

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/SidebarOrderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ describe('Sidebar', () => {

const reportNameValuePairsCollectionDataSet: ReportNameValuePairsCollectionDataSet = {
[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report1.reportID}`]: {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
},
};
Expand Down Expand Up @@ -1005,7 +1004,6 @@ describe('Sidebar', () => {

const reportNameValuePairsCollectionDataSet: ReportNameValuePairsCollectionDataSet = {
[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report1.reportID}`]: {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
},
};
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/SidebarTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('Sidebar', () => {
};

const reportNameValuePairs = {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
};

Expand Down Expand Up @@ -121,7 +120,6 @@ describe('Sidebar', () => {
},
};
const reportNameValuePairs = {
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: DateUtils.getDBTime(),
};

Expand Down